Commit graph

26547 commits

Author SHA1 Message Date
Dawid Wolosowicz
14c30af7d8 SpaceAnalyzer: Enable icons within the breadcrumbbar
The breadcrumbbar in here serves exactly the same purpose as the one in
File Manager. Given that, I believe it's worth to keep these two
visually consistent.
2021-09-01 23:00:28 +02:00
Thitat Auareesuksakul
1600d5a446 SoundPlayer: Use GUI::ActionGroup for Visualization menu
Removed the old custom checkbox selection code in the Visualization
menu and replaced them with GUI::ActionGroup with set_exclusive
enabled instead :^)
2021-09-01 19:19:35 +02:00
Brian Gianforcaro
4de0f68486 Profiler: Minor static code analysis issues in FlameGraphView 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
16f0248ca2 Profiler: Use = default for empty destructor 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
c0341215de Kernel: Use = default for empty destructors 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
e15be89e18 Meta: Add Sonar Cloud link / badge to the README.md 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
511822c9fe HackStudio: Fix typo in C++ file extension mapping code
This looks like a copy past bug where we were checking "cc" twice
instead of checking for the equivalent header extension.

Found by Sonar Cloud.
2021-09-01 18:06:14 +02:00
Brian Gianforcaro
0bd089b282 SoundPlayer: Fix file leak in M3UParser::from_file(..)
Found by Sonar Cloud.
2021-09-01 18:06:14 +02:00
Brian Gianforcaro
afa0fb55b0 Kernel: Don't cast to NetworkOrdered<u16>* from random data
NetworkOrdered is a non trivial type, and it's undefined behavior to
cast a random pointer to it and then pretend it's that type.

Instead just call AK::convert_between_host_and_network_endian on the
individual u16*. This suppresses static analysis warnings.

I don't think there was a "bug" in the previous code, it worked, but
it was very brittle.
2021-09-01 18:06:14 +02:00
Brian Gianforcaro
668c429900 Kernel: Convert UserOrKernelBuffer callbacks to use AK::Bytes 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
f3baa5d8c9 Kernel: Convert random bytes interface to use AK::Bytes 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
0678ac265c Kernel: Pass InodeMetadata by reference in TmpFSInode::create
This struct is non-trivially large, it makes sense to pass it by
reference instead of by value in the factory method.

Found by Sonar Cloud.
2021-09-01 18:06:14 +02:00
Brian Gianforcaro
fee2a03ba9 AK: Pass AK::Format TypeErasedFormatParams by reference in AK::String
This silences a overeager warning in sonar cloud, warning that
slicing could occur with `VariadicFormatParams` which derives from
`TypeErasedFormatParams`.

Reference:
https://sonarcloud.io/project/issues?id=SerenityOS_serenity&issues=AXuVPBW3k92xXUF3qXTE&open=AXuVPBW3k92xXUF3qXTE

This is a continuation of f0b3aa0331.
2021-09-01 18:06:14 +02:00
Linus Groh
8105d3f3d6 LibJS: Change offset in ISODateTimeWithinLimits to actually 24h
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/1d61d6f
2021-09-01 15:11:35 +01:00
Linus Groh
59df50a950 LibJS: Throw RangeError for +/-∞ argument values in Temporal.Duration()
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/ababe1b
2021-09-01 15:11:35 +01:00
Linus Groh
f169ad61a4 LibJS: Make 'options' argument of Calendar prototype functions optional
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/9cc913e
2021-09-01 15:11:35 +01:00
Linus Groh
ed98c1afc7 LibJS: Throw RangeError in PrepareTemporalFields for +/-∞
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/499282a
2021-09-01 15:11:35 +01:00
Linus Groh
e845e7c814 LibJS: Throw TypeError if Instant.prototype.round() options is undefined
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/943018f
2021-09-01 15:11:35 +01:00
Linus Groh
38bef3e28e LibJS: Handle undefined, NaN, and Infinity in ToTemporalDurationRecord
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/d4b9bcf
2021-09-01 15:11:35 +01:00
Timothy Flynn
fd0011989a LibUnicode: Resolve the most likely territory alias when there are many 2021-09-01 14:14:47 +01:00
Timothy Flynn
1fbc5dba08 LibUnicode: Generate Unicode locale likely subtag data
CLDR contains a set of likely subtag data where, given a locale, you can
resolve what is the most likely language, script, or territory of that
locale. This data is needed for resolving territory aliases. These
aliases might contain multiple territories, and we need to resolve which
of those territories is most likely correct for a locale.

Note that the likely subtag data is quite huge (a few thousand entries).
As an optimization encouraged by the spec, we only generate the smallest
subset of this data that we actually need (about 150 entries).
2021-09-01 14:14:47 +01:00
Timothy Flynn
72f49e42b4 LibUnicode: Perform complex Unicode locale alias substitution 2021-09-01 14:14:47 +01:00
Timothy Flynn
9ae7ac4c87 LibUnicode: Generate complex Unicode locale alias matching
Most alias substitutions are "simple", meaning that alias matching is
done by examining a single locale subtag. However, there are a handful
of "complex" aliases where matching is done by examining multiple
subtags. For example, the variant subtag "lojban" causes the locale
"art-lojban" to be canonicalized to "jbo", but only when the language
subtag is "art" (i.e. this should not occur for the locale "en-lojban").

This generates a method to perform complex alias matching.
2021-09-01 14:14:47 +01:00
Timothy Flynn
da89cf9afb LibUnicode: Canonicalize calendar subtags
Calendar subtags are a bit of an odd-man-out in that we must match the
variants "ethiopic-amete-alem" in that order, without any other variant
in the locale. So a separate method is needed for this, and we now defer
sorting the variant list until after other canonicalization is done.
2021-09-01 14:14:47 +01:00
Timothy Flynn
8458f477a4 LibUnicode: Canonicalize timezone subtags 2021-09-01 14:14:47 +01:00
Timothy Flynn
335f985b31 LibUnicode: Canonicalize the subtag "imperial" to "uksystem" 2021-09-01 14:14:47 +01:00
Timothy Flynn
2d90144888 LibUnicode: Canonicalize the subtag "primary" and "tertiary" to "levelN" 2021-09-01 14:14:47 +01:00
Timothy Flynn
409f39b336 LibUnicode: Canonicalize the subtag "names" to "prprname" 2021-09-01 14:14:47 +01:00
Timothy Flynn
f907a7dc38 LibUnicode: Canonicalize the subtag "yes" to "true" 2021-09-01 14:14:47 +01:00
Timothy Flynn
556374a904 LibUnicode: Substitute Unicode locale aliases during canonicalization
Unicode TR35 defines how locale subtag aliases should be emplaced when
converting a locale to canonical form. For most subtags, it is a simple
substitution. Language subtags depend on context; for example, the
language "sh" should become "sr-Latn", but if the original locale has a
script subtag already ("sh-Cyrl"), then only the language subtag of the
alias should be taken ("sr-Latn").

To facilitate this, we now make two passes when canonicalizing a locale.
In the first pass, we convert the LocaleID structure to canonical syntax
(where the conversions all happen in-place). In the second pass, we form
the canonical string based on the canonical syntax.
2021-09-01 14:14:47 +01:00
Timothy Flynn
9b118f1f06 LibUnicode: Generate Unicode locale alias data
CLDR contains a set of aliases for languages, territories, etc. that no
longer are meant to be used (e.g. due to deprecation). For example, the
language "aam" is deprecated and should be canonicalized as "aas".
2021-09-01 14:14:47 +01:00
Timothy Flynn
d13142f015 LibJS+LibUnicode: Store parsed Unicode locale data as full strings
Originally, it was convenient to store the parsed Unicode locale data as
views into the original string being parsed. But to implement locale
aliases will require mutating the data that was parsed. To prepare for
that, store the parsed data as proper strings.
2021-09-01 14:14:47 +01:00
Timothy Flynn
caf5b6fa6f LibUnicode: Extract cldr-core dataset from CLDR database 2021-09-01 14:14:47 +01:00
Timothy Flynn
6f5fb87d3b LibJS: Handle Unicode locale extensions in LookupMatcher AO 2021-09-01 14:14:47 +01:00
davidot
def8b44c40 LibJS: Add support for public fields in classes 2021-09-01 13:39:14 +01:00
davidot
3b6a8d1d53 LibJS: Fix small issues in parser
- Fix some places where escaped keywords are (not) allowed.
- Be more strict about parameters for functions with 'use strict'.
- Fix that expressions statements allowed functions and classes.
- Fix that class expressions were not allowed.
- Added a new next_token() method for checking the look ahead.
- Fix that continue labels could jump to non iterating targets.
- Fix that generator functions cannot be declared in if statements.
2021-09-01 13:39:14 +01:00
Tobias Christiansen
8a7ce4eea3 PixelPaint: Add "Change Offset" to the GuideTool
This opens the EditGuideDialog with the values of the currently
selected Guide and allows the user to change them to the desired values.
:^)
2021-09-01 13:46:44 +02:00
Tobias Christiansen
e9595dcb79 PixelPaint: Add setter for the orientation of a Guide
Also add an additional value to the Orientation enum called "Unset".
2021-09-01 13:46:44 +02:00
Tobias Christiansen
c9e6afe6a8 PixelPaint: Allow initial values for the EditGuideDialog
This way we can feed it the values if we wanted to change an existing
Guide and handle the default as before.
That we have to pass a String here is a bit ugly.
2021-09-01 13:46:44 +02:00
Tobias Christiansen
7e2028a3cd PixelPaint: Move the conversion to pixels into the EditGuideDialog
This seems like the most appropriate location to put this.
2021-09-01 13:46:44 +02:00
Tobias Christiansen
abcb982485 PixelPaint: Rename CreateNewGuideDialog to EditGuideDialog
This doesn't change the behavior at all but sets the naming up be more
descriptive on what it does in the next patches.
2021-09-01 13:46:44 +02:00
Andrew Kaster
b3e3e4d45d Tests: Convert remaining LibC tests to LibTest
Convert them to using outln instead of printf at the same time.
2021-09-01 13:44:24 +02:00
Marcus Nilsson
1d253880e6 PixelPaint: Tweak palette height
The height of the bottom color container was cut off at the bottom.
This adjusts the heights and also the primary/secondary color
widget so that it's in line.
2021-09-01 13:43:55 +02:00
Ali Mohammad Pur
9b2f0613ef LibRegex: Correctly advance string positions in Compare::compare_string
Fixes a bug where backreferences could cause desync between the
code point index and regular index, making comparison off-by-N.
2021-09-01 13:36:53 +02:00
Ali Mohammad Pur
dd82c2e9b4 LibRegex: Correctly handle failing in the middle of explicit repeats
- Make sure that all the Repeat ops are reset (otherwise the operation
  would not be correct when going over the Repeat op a second time)
- Make sure that all matches that are allowed to fail are backed by a
  fork, otherwise the last failing fork would not have anywhere to
  return to.
Fixes #9707.
2021-09-01 13:36:53 +02:00
Andrew Kaster
fcdd7aa990 Kernel: Only unlock Mutex once in execve when PT_TRACE_ME is enabled
Fixes a regression introduced in 70518e6. Fixes #9704.
2021-09-01 13:36:26 +02:00
Peter Elliott
33d7fdca28 Everywhere: Use my cool new @serenityos.org email address 2021-09-01 11:37:25 +04:30
Andreas Kling
9206efaabe LibELF: Don't copy read-only data sections
The dynamic loader was mistakenly assuming that there are only two types
of program load headers: text (RX) and data (RW).

Now that we're linking with `-z separate-code`, we will also get some
read-onlydata (R) segments. These can be memory-mapped directly without
making a private per-process copy.

To solve this, the code now instead separates the headers into map/copy
instead of text/data. Writable segments get copied, while non-writable
segments get memory-mapped. :^)
2021-09-01 01:36:18 +02:00
Brian Gianforcaro
10f5a046c4 AK: Remove dead store from Time:operator+
This is written, but never read again, and is thus useless.
2021-09-01 01:22:14 +02:00
Brian Gianforcaro
271d6f494f RequestServer: Use smart pointers for allocating protocols 2021-09-01 01:22:14 +02:00