Commit graph

33405 commits

Author SHA1 Message Date
Timothy Flynn 6f8e89a905 Meta: Download USB and PCI ID data with fallible download function 2022-01-26 00:22:53 +00:00
Timothy Flynn e2bcf5fafd Meta: Download PNP ID data with fallible download function 2022-01-26 00:22:53 +00:00
Timothy Flynn 931302c500 Meta: Download TZDB data with fallible download function 2022-01-26 00:22:53 +00:00
Timothy Flynn c7ef86f5d9 Meta: Download UCD and CLDR data with fallible download function 2022-01-26 00:22:53 +00:00
Timothy Flynn e805fce46e Meta: Add a CMake function to download remote files during the build
This function will handle download failures. It doesn't support hashing
for integrity yet, but if the download times out or otherwise fails, the
build itself will fail. But default, file(DOWNLOAD) in CMake doesn't
fail the build; we must pass in and check a STATUS variable.
2022-01-26 00:22:53 +00:00
davidot b40308d0a4 Tests+LibJS: Add very simple bytecode LibJS tests
These tests are not meant as a replacement to test-js with the -b option
but are meant to test simple cases until that works.
Before this it was very easy to accidentally break bytecode since no
tests were run in bytecode mode. This hopefully makes it easier to spot
such regressions :^).
2022-01-25 23:26:14 +00:00
davidot f06e7dd13f Meta: Fix my .mailmap entry by adding the name 2022-01-25 23:26:14 +00:00
Valtteri Koskivuori 7a537ad08f WindowServer: Rename default_positioned() -> is_default_positioned()
Tiny change, but it really bothered me that this was the only function
not named like the rest.
2022-01-25 23:22:10 +00:00
Timothy Flynn 82509ca0c8 date: Display time zone information in all output formats 2022-01-25 23:21:30 +00:00
Timothy Flynn 29c8ec5eb6 LibCore: Support (and use) DateTime string formatting of the form %Z
This formats the time zone name. This is now used in the default format
string because DateTime is meant to represent local time; it only makes
sense to include the time zone by default now that we support non-UTC.
2022-01-25 23:21:30 +00:00
Timothy Flynn 9605be19bb LibCore: Support DateTime string formatting of the form %:z
This formats the time zone offset as "+hh:mm" or "-hh:mm". This doesn't
appear to be strictly POSIX, but it is how Linux implements this format.
2022-01-25 23:21:30 +00:00
Timothy Flynn d9ee218701 LibCore: Support DateTime string formatting of the form %z
This formats the time zone offset as "+hhmm" or "-hhmm".
2022-01-25 23:21:30 +00:00
Idan Horowitz 6e38076b48 AK: Use x86 specific fast path in fast_u32{fill, copy} on x86_64 2022-01-26 01:16:43 +02:00
Timothy Flynn 59ca435172 LibJS: Use new construct AO overload where easily applicable 2022-01-25 22:09:13 +00:00
Timothy Flynn 67e02f6ca6 LibJS: Add templated overloads for the construct AO to create its MVL
Instead of requiring callers to construct a MarkedValueList, add a
variadic templated overload to construct the MVL on the caller's behalf.
2022-01-25 22:09:13 +00:00
Timothy Flynn 4661a0f228 LibJS: Use forwarding references for call's variadic template arguments 2022-01-25 22:09:13 +00:00
Timothy Flynn 5c4b1e3d23 LibJS: Remove erroneous variadic template from some call overloads
These function do not use the Args variadic template.
2022-01-25 22:09:13 +00:00
Ali Mohammad Pur 5fac41f733 LibRegex: Implement ECMA262 multiline matching without splitting lines
As ECMA262 regex allows `[^]` and literal newlines to match newlines in
the input string, we shouldn't split the input string into lines, rather
simply make boundaries and catchall patterns capable of checking for
these conditions specifically.
2022-01-26 00:53:09 +03:30
Ali Mohammad Pur 98183ef572 Meta: Correct the PNP ID download condition
`PNP_IDS_PATH` does not exist, set this to `PNP_IDS_EXPORT_PATH` to
avoid redownloading the database every reconfigure.
2022-01-26 00:53:09 +03:30
Ali Mohammad Pur aa20210119 LibRegex: Don't return empty vectors from RegexStringView::lines()
Instead, return a vector of one empty string.
2022-01-26 00:53:09 +03:30
Idan Horowitz c9d026d7bc Kernel: Perform DeviceManagement initialization after MM is initialized
There's no need to perform it this early, and until the MemoryManager
is initialized we have very limited kmalloc capacity, so let's try and
keep anything that's not required to be there out of there.
2022-01-25 22:41:26 +02:00
Idan Horowitz fa0a052fc6 Kernel: Use PARTUUID: instead of PARTUUID= as the partition uuid prefix
This makes the functionality work again, as we no longer allow any
equal signs inside boot parameter values.
2022-01-25 22:41:17 +02:00
Idan Horowitz 971ab3b919 Kernel: Use u64 instead of size_t in the STORAGE_DEVICE_GET_SIZE ioctl
This ensures the device size doesn't get truncated on i686.
2022-01-25 22:41:17 +02:00
Idan Horowitz d1ed554dc8 Kernel: Use u64 instead of u32 and u16 in StorageDevice::{read, write}
This ensures offsets will not be truncated on large filesystems on i686
2022-01-25 22:41:17 +02:00
Idan Horowitz b9cce82cf3 Kernel: Stop using unsigned when adjusting offsets in DiskPartition
These can only contain 32 bit values, and so will truncate very large
offsets.
2022-01-25 22:41:17 +02:00
Idan Horowitz 2065a73727 Kernel: Use u64 instead of size_t for BlockBasedFileSystem::read_block
This ensures offsets will not be truncated on large filesystems on i686
2022-01-25 22:41:17 +02:00
Idan Horowitz 0b2e93cf43 Kernel: Use u64 instead of size_t for BlockBasedFileSystem::write_block
This ensures offsets will not be truncated on large filesystems on i686
2022-01-25 22:41:17 +02:00
Idan Horowitz 664ca58746 Kernel: Use u64 instead of size_t for File::can_write offset
This ensures offsets will not be truncated on large files on i686.
2022-01-25 22:41:17 +02:00
Idan Horowitz 9ce537d703 Kernel: Use u64 instead of size_t for File::can_read offset
This ensures offsets will not be truncated on large files on i686.
2022-01-25 22:41:17 +02:00
Timothy Flynn 0c630d5687 LibJS: Implement Intl.RelativeTimeFormat.prototype.resolvedOptions 2022-01-25 19:02:59 +00:00
Timothy Flynn b50880f28c LibJS: Fix errors in Intl.DateTimeFormat.prototype.resolvedOptions tests
Noticed these while implementing this prototype for RelativeTimeFormat.
2022-01-25 19:02:59 +00:00
Timothy Flynn cf166c1d93 LibJS: Implement Intl.RelativeTimeFormat.supportedLocalesOf 2022-01-25 19:02:59 +00:00
Timothy Flynn 47e9e7c2d0 js: Implement pretty-printing of Intl.RelativeTimeFormat 2022-01-25 19:02:59 +00:00
Timothy Flynn a2e31ed736 LibJS: Implement the Intl.RelativeTimeFormat constructor 2022-01-25 19:02:59 +00:00
Timothy Flynn 79fdec85de LibJS: Implement a nearly empty Intl.RelativeTimeFormat object
This adds plumbing for the Intl.RelativeTimeFormat object, constructor,
and prototype.
2022-01-25 19:02:59 +00:00
Timothy Flynn 0865f71d37 LibJS: Convert Intl.NumberFormat to use Unicode::Style 2022-01-25 19:02:59 +00:00
Timothy Flynn 25e67f63a2 LibJS: Convert Intl.DisplayNames to use Unicode::Style 2022-01-25 19:02:59 +00:00
Timothy Flynn bced4e9324 LibJS+LibUnicode: Convert Intl.ListFormat to use Unicode::Style
Remove ListFormat's own definition of the Style enum, which was further
duplicated by a generated ListPatternStyle enum with the same values.
2022-01-25 19:02:59 +00:00
Timothy Flynn e261132e8b LibUnicode: Add helper methods to convert a Style to and from a string
This conversion is duplicated a few times in our Intl implementation, so
let's just define these once and be done with it.
2022-01-25 19:02:59 +00:00
Timothy Flynn 7f6edb7976 LibUnicode: Remove the Unicode::Style::Numeric value
It is unused.
2022-01-25 19:02:59 +00:00
Timothy Flynn a027ccad75 LibTimeZone+Userland: Rename current_time_zone to system_time_zone
This renames the current implementation of current_time_zone to
system_time_zone to more clearly indicate what it is. Then reimplements
current_time_zone to return whatever was set up by tzset, falling back
to UTC if something went awry, for convenience.
2022-01-25 18:39:36 +00:00
Timothy Flynn ede5c9548e Userland: Invoke tzset in applications that care about time zones
In most applications, we invoke tzset once at startup for now. Most of
these are short lived and don't need to know about time zone changes.

The exception is the ClockWidget in the taskbar. Here, we invoke tzset
each time we update the system time. This way, any time zone changes can
take effect immediately.
2022-01-25 18:39:36 +00:00
Timothy Flynn 010ec36d20 LibC: Ensure most time tests run under UTC
This ensures these tests pass even if the user has changed the system
time zone away from UTC.
2022-01-25 18:39:36 +00:00
Timothy Flynn 024f869f09 LibC: Ensure tzname and related fields are intialized
If a program never invokes tzset, the tzname variable should have system
dependent default values.
2022-01-25 18:39:36 +00:00
Timothy Flynn cd0e5ccd3f LibC: Revert localtime_r to use time zone information set by tzset
Now that tzset actually detects time zones, parties interested in time
zone offsets should invoke tzset.
2022-01-25 18:39:36 +00:00
Timothy Flynn 11f1f04a4c LibC: Invoke tzset from time functions required to update time zone info
From POSIX:

    the ctime(), localtime(), mktime(), strftime(), and strftime_l()
    functions are required to set timezone information as if by calling
    tzset()

ctime is excluded here because it invokes localtime, so there's no need
to invoke tzset twice.
2022-01-25 18:39:36 +00:00
Timothy Flynn b1ea585149 LibC: Implement tzset with time zone awareness in accordance with POSIX 2022-01-25 18:39:36 +00:00
Timothy Flynn 6095500263 LibC: Define the POSIX TZNAME_MAX limit
POSIX defines this as the "Maximum number of bytes supported for the
name of a timezone (not of the TZ variable)." It must have a minimum
value of _POSIX_TZNAME_MAX (6). The longest time zone name in the TZDB
is about 40 chars, so 64 is chosen here for a little wiggle room, and
to round up to a power of 2.
2022-01-25 18:39:36 +00:00
Timothy Flynn 1f051a8e25 LibTimeZone: Handle time zones which begin the year in daylight savings 2022-01-25 18:39:36 +00:00
Timothy Flynn 7103012c7d LibTimeZone: Add an API to retrieve both daylight and standard offsets
This API will also include the formatted name of the time zone, with
respect for DST (e.g. EST vs EDT for America/New_York).
2022-01-25 18:39:36 +00:00