Commit graph

44173 commits

Author SHA1 Message Date
Linus Groh
947ea92bf6 LibJS: Convert ArrayBuffer::create() to NonnullGCPtr 2022-12-14 09:59:45 +00:00
Linus Groh
91b0123eaf LibJS: Convert Array::create{,_from}() to NonnullGCPtr 2022-12-14 09:59:45 +00:00
Linus Groh
0c50751c13 LibJS: Convert AggregateError::create() to NonnullGCPtr 2022-12-14 09:59:45 +00:00
Linus Groh
2b92c15b34 LibJS: Convert Accessor::create() to NonnullGCPtr 2022-12-14 09:59:45 +00:00
Timothy Flynn
0ec433edce LibJS: Explictly assert that a null GCPtr is not dereferenced 2022-12-14 09:59:35 +00:00
Xexxa
8379b87d4e Base: Adjust size of emoji flags
🏴󠁵󠁡󠀰󠀵󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0030 U+E0035 U+E007F
UA-05 Vinnychchyna
🏴󠁵󠁡󠀰󠀷󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0030 U+E0037 U+E007F
UA-07 Volyn
🏴󠁵󠁡󠀰󠀹󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0030 U+E0039 U+E007F
UA-09 Luhanshchyna
🏴󠁵󠁡󠀱󠀲󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0031 U+E0032 U+E007F
UA-12 Dnipropetrovshchyna
🏴󠁵󠁡󠀱󠀴󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0031 U+E0034 U+E007F
UA-14 Donechchyna
🏴󠁵󠁡󠀱󠀸󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0031 U+E0038 U+E007F
UA-18 Zhytomyrshchyna
🏴󠁵󠁡󠀲󠀱󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0032 U+E0031 U+E007F
UA-21 Zakarpattia
🏴󠁵󠁡󠀲󠀳󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0032 U+E0033 U+E007F
UA-23 Zaporizhzhya
🏴󠁵󠁡󠀲󠀶󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0032 U+E0036 U+E007F
UA-26 Prykarpattia
🏴󠁵󠁡󠀳󠀰󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0033 U+E0030 U+E007F
UA-30 Kiev
🏴󠁵󠁡󠀳󠀲󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0033 U+E0032 U+E007F
UA-32 Kyivshchyna
🏴󠁵󠁡󠀳󠀵󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0033 U+E0035 U+E007F
UA-35 Kirovohradschyna
🏴󠁵󠁡󠀴󠀰󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0034 U+E0030 U+E007F
UA-40 Sevastopol
🏴󠁵󠁡󠀴󠀳󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0034 U+E0033 U+E007F
UA-43 Crimea
🏴󠁵󠁡󠀴󠀶󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0034 U+E0036 U+E007F
UA-46 Lvivshchyna
🏴󠁵󠁡󠀴󠀸󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0034 U+E0038 U+E007F
UA-48 Mykolayivschyna
🏴󠁵󠁡󠀵󠀱󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0035 U+E0031 U+E007F
UA-51 Odeshchyna
🏴󠁵󠁡󠀵󠀳󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0035 U+E0033 U+E007F
UA-53 Poltavshchyna
🏴󠁵󠁡󠀵󠀶󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0035 U+E0036 U+E007F
UA-56 Rivnenshchyna
🏴󠁵󠁡󠀵󠀹󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0035 U+E0039 U+E007F
UA-59 Sumshchyna
🏴󠁵󠁡󠀶󠀱󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0036 U+E0031 U+E007F
UA-61 Ternopilshchyna
🏴󠁵󠁡󠀶󠀳󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0036 U+E0033 U+E007F
UA-63 Kharkivshchyna
🏴󠁵󠁡󠀶󠀵󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0036 U+E0035 U+E007F
UA-65 Khersonshchyna
🏴󠁵󠁡󠀶󠀸󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0036 U+E0038 U+E007F
UA-68 Khmelnychchyna
🏴󠁵󠁡󠀷󠀱󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0037 U+E0031 U+E007F
UA-71 Cherkashchyna
🏴󠁵󠁡󠀷󠀴󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0037 U+E0034 U+E007F
UA-74 Chernihivshchyna
🏴󠁵󠁡󠀷󠀷󠁿 - U+1F3F4 U+E0075 U+E0061 U+E0037 U+E0037 U+E007F
UA-77 Chernivtsi Oblast
2022-12-14 09:59:19 +00:00
Filiph Siitam Sandström
f050534991 Lagom: Don't compile with -fPIC on WIN32 2022-12-13 21:53:29 +00:00
Luke Wilde
ce39c907fd LibJS: Support MM/DD/YYYY HH:MM <timezone-offset> format for Date
Required by Discord to determine if it should show Christmas themed
loading tips on the loading screen.
Fixes #16473.
2022-12-13 21:42:28 +00:00
Timothy Flynn
bb6a84cc85 LibTimeZone: Update to TZDB version 2022g
https://mm.icann.org/pipermail/tz-announce/2022-November/000076.html
2022-12-13 16:04:32 -05:00
Drew DeVault
c7f8d74c1c LibCore: Fix struct msghdr initialization
The previous approach could leave behind uninitialized fields on
platforms which have additional fields in this structure (e.g. padding
fields on musl libc).
2022-12-13 10:12:59 -08:00
kleines Filmröllchen
a06b277471 LibIPC: Support sending Variants over IPC
The format is quite simply the type index followed by the type in its
own native encoding; just implementing the receive side with static
typing is a bit convoluted. The only limitation of this implementation
is that the variant type has to contain an Empty somewhere as it is not
default constructible otherwise.

Co-authored-by: Ali Mohammad Pur <mpfard@serenityos.org>
2022-12-13 10:24:59 -05:00
kleines Filmröllchen
5b4818df22 AK: Make Variant's index type public
This will allow the IPC system to use the exact required index type,
saving transmission space, once it can send variants.
2022-12-13 10:24:59 -05:00
Andrew Kaster
232b40fefc Ports: Update CMake port to 3.25.1 2022-12-13 11:36:14 +01:00
Andrew Kaster
d9e76254a8 CMake: Bump cmake_minimum_required to 3.25
The SerenityOS platform files we upstreamed were first released in
version 3.25.0
2022-12-13 11:36:14 +01:00
Andrew Kaster
d2f78a9411 Toolchain: Remove upstreamed CMake platform files :^) 2022-12-13 11:36:14 +01:00
Andrew Kaster
e28bc77778 Ports: Find cmake in Toolchain/Local/cmake if built
If a developer built cmake (or we built it for them) from source, make
sure that port builds can find that version of CMake that has the
SerenityOS platform files included.
2022-12-13 11:36:14 +01:00
Andrew Kaster
3ca661314f Meta: Build CMake from source if version is too old in serenity.sh 2022-12-13 11:36:14 +01:00
Andrew Kaster
e4a59f664b Toolchain+Meta: Add script to build CMake from source
Since we upstreamed CMake support for Serenity, we can use the Platform
files from upstream instead of keeping our local copy. While not added
in this commit, we can add patching capabilities for the platform files
similar to what we do for gdb, llvm, gcc, and binutils later.
2022-12-13 11:36:14 +01:00
Cody Hein
8855334fcc PixelPaint: Use source alpha for CloneTool drawing
Prior to this change when using CloneTool on a transparent background
the output was a solid black brush stroke. Now it is based on the
source content alpha as well as it's color blended with the target.
2022-12-13 11:35:25 +01:00
Tim Schumacher
ceb118e1fa Base: Reenable the disabled LibCore::Stream tests 2022-12-13 11:34:38 +01:00
Daniel Bertalan
24d2c90a28 BindingsGenerator+CMake: Keep track of IDL dependencies
This commit teaches BindingsGenerator to generate depfiles, which can be
used by CMake to ensure that bindings are properly regenerated when
imported IDL files change.

Two new options, `--depfile` and `--depfile-target` are added.
- `--depfile` sets the path for the dependency file.
- `--depfile-target` lets us set a target name different than the output
  file in the depfile. This option is needed because generated files are
  first written to a temporary file, but depfiles have to refer to the
  final location.
These are analogous to GCC's `-MF` and `-MT` options respectively. The
depfile's syntax matches the ones generated by GCC.

Note: This changes the minimal required CMake version to 3.20 if the
Make generator is used, and to 3.21 for the Xcode generator. Ninja is
not affected.
2022-12-13 11:31:24 +01:00
Daniel Bertalan
8d1ad592a1 BindingsGenerator: Write generated code to disk instead of stdout
This commit adds the `-o` option for specifying an output path to
BindingsGenerator.
2022-12-13 11:31:24 +01:00
Andreas Kling
30d3f2789e Kernel: Propagate errors during network adapter detection/initialization
When scanning for network adapters, we give each driver a chance to
claim the PCI device and whoever claims it first gets to keep it.
Before this patch, the driver API returned a LockRefPtr<AdapterType>,
which made it impossible to propagate errors that occurred during
detection and/or initialization.

This patch changes the API so that errors can bubble all the way out
the PCI enumeration in NetworkingManagement::initialize() where we
perform all the network adapter auto-detection on boot.

When we eventually start to support hot-plugging network adapter in the
future, it will be even more important to propagate errors instead of
swallowing them.

Importantly, before this patch, some errors were "handled" by panicking
the kernel. This is no longer the case.

7 FIXMEs were killed in the making of this commit. :^)
2022-12-13 11:20:11 +01:00
EWouters
9a849c10ae Ports/git: Update git to version 2.39.0 2022-12-13 11:20:03 +01:00
Ali Mohammad Pur
ad120606fd AK: Fix build with !USING_AK_GLOBALLY
A couple headers expected names to be in the global namespace, qualify
those names to make sure they're resolved even when the names are not
exported.
One header placed its functions in the global namespace, move those to
the AK namespace to make the concepts resolve.
2022-12-13 08:09:56 +03:30
Jan200101
483c18437b Meta: Detect ccache being passed as the compiler
This prevents ccache from being invoking itself.
Icecc fails to ran this way because of recursion detection.
2022-12-12 21:34:09 -07:00
Jan200101
10d40af167 Meta: Separate ccache setup into its own component 2022-12-12 21:34:09 -07:00
Tim Schumacher
0bd9a94bea LibHTTP: Don't read and drop data if status line can't be read
The idea of reading some amount of data presumably was to check if the
stream is still operable. However, this permanently breaks the request
format, as those 64 bytes are just lost forever.

Instead, just let the request fail instantly for now and think about
making it retry some time in the future. Since `can_read_line` updates
the read buffer beforehand, this should only happen in the rarest of
cases anyways.
2022-12-12 20:59:03 -07:00
Linus Groh
3b64610834 LibJS: Add spec comments to AggregateErrorConstructor 2022-12-12 21:26:12 +00:00
Linus Groh
172738222c LibJS: Update get_substitution() section number & parameter name 2022-12-12 21:26:12 +00:00
Linus Groh
19ea0d8dcf LibJS: Add spec comments to get_this_environment() 2022-12-12 21:26:12 +00:00
Linus Groh
c6638f53c0 LibJS: Add spec comments to new_object_environment() 2022-12-12 21:26:12 +00:00
Linus Groh
1cd46af7b0 LibJS: Add spec comments to new_declarative_environment() 2022-12-12 21:26:12 +00:00
Linus Groh
d51ab20aaa LibJS: Add spec comment to length_of_array_like() 2022-12-12 21:26:12 +00:00
Linus Groh
e4b388ea5a LibJS: Use modulo() for modulo operations in Value.cpp 2022-12-12 21:26:12 +00:00
Cody Hein
074ba104c8 PixelPaint: Single-clicking the BrushTool now adds to undo_stack
Simple change, prior to this BrushTool and EraseTool would not
have update the undo_stack for the ImageEditor unless you were
clicking and dragging.
2022-12-12 17:34:35 +00:00
Oleg Kosenkov
28bb3367cb Games: Add ColorLines 2022-12-12 17:30:04 +00:00
Ali Mohammad Pur
d987ddc0ee AK: Actually don't include <unistd.h> for windows in Platform.h
I got the conditions wrong last time, oops :^)
2022-12-12 17:01:16 +00:00
Andrea Giancola
21647b9a4e Games: Add help entries for Solitaire and Spider 2022-12-12 16:25:46 +00:00
Arda Cinar
a559e26f68 shuf: Use the newly introduced AK::shuffle function 2022-12-12 16:23:03 +00:00
Arda Cinar
352048ce0e Minesweeper: Revise the maximum mine limit in custom game settings
After improving the mine field generation method, fields with greater
than 50% mines no longer take too long to generate. So, the mine limit
for a given size can be increased to its maximum possible value.
2022-12-12 16:23:03 +00:00
Arda Cinar
71537f4903 Minesweeper: Make sure icons of cells are set after generating field
In reset() function, the icons of labels in the game area were initially
set as mine icon or null. And then, after generation, only the number
icon was set. In the old field generation algorithm, this did not cause
a very visible issue (The displayed mine icons in the game over screen
were from a previously generated game field, which was only slightly
wrong).

However, the newer field generation caused a "no mine icons are shown in
the game over screen" issue. To fix that, the label icon is set to null
initially, and then it is set to a mine or number bitmap.
2022-12-12 16:23:03 +00:00
Arda Cinar
5562ef6cc5 Minesweeper: Use a faster method to generate game field
The existing method was simply using a "randomly generate until it fits
our criteria" method to generate a game field. While this worked OK in
most cases, the run time was increasing seriously in boards whose
mine count / board size ratio was too big.

The new approach simply generates every possible mine location, shuffles
the array and picks its head. This uses more memory (shouldn't be a big
deal since minesweeper boards are generally miniscule) but runs much
quicker. The generation could still use some improvement (regarding
error handling), though :^)
2022-12-12 16:23:03 +00:00
Arda Cinar
1cdd3bb74f AK: Add a shuffle utility function
This implements a shuffle function in AK/Random.h which works on any
container with size() and curly brace operators. It uses fisher-yates
shuffle.
2022-12-12 16:23:03 +00:00
Tim Schumacher
30abd47099 LibCompress: Port DeflateDecompressor to Core::Stream 2022-12-12 16:21:39 +00:00
Tim Schumacher
f909cfbe75 LibCore: Use the new Handle type for the BitStream types
This allows us to either pass a reference, which keeps compatibility
with old code, or to pass a NonnullOwnPtr, which allows us to
comfortably chain streams as usual.
2022-12-12 16:21:39 +00:00
Tim Schumacher
8b5df161af LibCore: Add Stream::Handle
This essentially wraps a `NonnullOwnPtr` or a reference, allowing us to
either have a stream own a dependent stream that it uses or to just hold
a reference if a stream is already owned by somebody else and we just
want to use it temporarily.
2022-12-12 16:21:39 +00:00
Lucas CHOLLET
6c83bd8fd4 AK: Introduce the DerivedFrom concept 2022-12-12 16:21:39 +00:00
Lucas CHOLLET
3750687821 LibCore: Use Core::System::poll() in PosixSocketHelper 2022-12-12 16:14:11 +00:00
Lucas CHOLLET
5532640b71 LibCore: Add a wrapper for poll() 2022-12-12 16:14:11 +00:00