Commit Graph

32088 Commits

Author SHA1 Message Date
Andrew Kaster
d809637023 Userland: Resolve tautological-constant-out-of-range-compare warnings
Stop comparing platform-specific sized integer types to max() values of
other interger types. Enable the warning everywhere.
2022-01-04 07:51:31 +00:00
Andrew Kaster
a103a85ae6 Userland: Locally suppress -Wc99-designator and re-enable globally
There's only two places where we're using the C99 feature of array
designated initalizers. This feature seemingly wasn't included with
C++20 designated initalizers for classes and structs. The only two
places we were using this feature are suitably old and isolated that
it makes sense to just suppress the warning at the usage sites while
discouraging future array designated intializers in new code.
2022-01-04 07:51:31 +00:00
Andrew Kaster
c8cfd6661a Userland: Resolve -Woverloaded-virtual in LibGUI and SoundPlayer
Enable the warning project-wide. It catches when a non-virtual method
creates an overload set with a virtual method. This might cause
surprising overload resolution depending on how the method is invoked.
2022-01-04 07:51:31 +00:00
Andrew Kaster
ed3cb88898 Meta: Enable -Wexpansion-to-defined warning for Clang
The Clang implementation of this warning protects against some undefined
pre-processor behavior while ignoring function-like macros. The gcc
implementation also warns on function-like macros, and is therefore
noisy.
2022-01-04 07:51:31 +00:00
Andrew Kaster
ba2ca54660 Meta: Re-enable toolchain version checks
These were removed in the Superbuild conversion. Re-add the checks that
make sure that if there's a toolchain update, developers re-build their
toolchain.
2022-01-04 07:51:31 +00:00
Andrew Kaster
170a7e263c Userland: Fail Core::find_executable_in_path on empty inputs
Before this patch, `which ""` or `type ""` would say that the empty
string is `/usr/local/bin/`.

Convert callers to consistently call is_empty() on the returned string
while we're at it, to support eventually removing the is_null() String
state in the future.
2022-01-04 07:38:42 +00:00
mjz19910
7f9bd34d07 wc: Port to LibMain 2022-01-04 07:33:23 +00:00
mjz19910
fc78bbe78c which: Port to LibMain 2022-01-04 07:33:23 +00:00
mjz19910
92493b210a wsctl: Port to LibMain 2022-01-04 07:33:23 +00:00
mjz19910
d4748c608c xargs: Port to LibMain 2022-01-04 07:33:23 +00:00
mjz19910
f705f57d9a yes: Port to LibMain 2022-01-04 07:33:23 +00:00
mjz19910
e9a15995fd uname: Port to LibMain 2022-01-04 07:33:23 +00:00
mjz19910
91f5fc796b LibCore: Add an ErrorOr wrapper for uname 2022-01-04 07:33:23 +00:00
mjz19910
35cd7c9a91 uniq: Port to LibMain 2022-01-04 07:33:23 +00:00
Maciej
28ea412251 PixelPaint: Make paste action create new image if no editor is opened
This matches GIMP behaviour.
2022-01-04 07:29:50 +00:00
Maciej
41d02bd5e6 PixelPaint: Add a way to quickly create an image from clipboard
Ctrl+Shift+V, like in GIMP.
2022-01-04 07:29:50 +00:00
Jesse Buhagiar
eefad5ccd7 LibC: Include strings.h in string.h
Certain C Libraries have (unfortunately) included strings.h as a
part of string.h, which violates the POSIX spec for that specific
header. Some applications rely on this being the case, so let's
include it in our string.h
2022-01-04 07:27:04 +00:00
Tom
857c8850f3 WindowServer: Fix loading MainScreen setting from configuration 2022-01-04 06:31:59 +00:00
circl
69c757e92f tar: Implement -C option
This allows specifying which directory to extract to or create
from.

I would have used the *at variants of the functions, but some
weren't implemented yet.
2022-01-04 06:22:34 +00:00
B0IIZZ
6124050187 AK: Fix UFixedBigInt comparison operators
Instead of using the specified type U like we want,
we were using the type T all along when comparing with
smaller integers. This is now fixed.
2022-01-04 06:01:22 +00:00
Linus Groh
143465b23a LibJS: Propagate errors from TypedArray for_each_item{,_from_last} calls
Another mistake uncovered by moving away from manual exception checks
and relying on correct completion types instead :^)
2022-01-03 22:11:35 +01:00
Jean-Paul Balabanian
913511249b Toolchain: Add support for Clang on MacOS
This commit adds Darwin as a possible host for building the toolchain
with Clang.
2022-01-04 00:40:11 +03:30
Linus Groh
044c70fb46 LibJS: Add a ton of spec comments to AST.cpp 2022-01-03 21:50:50 +01:00
Linus Groh
da856d7742 LibJS: Update AST to use completions :^)
This is another major milestone on our journey towards removing global
VM exception state :^)
Does pretty much exactly what it says on the tin: updating
ASTNode::execute() to return a Completion instead of a plain value. This
will *also* allow us to eventually remove the non-standard unwinding
mechanism and purely rely on the various completion types.
2022-01-03 21:50:50 +01:00
Linus Groh
95acb1ce88 LibJS: Don't assume non-empty [[Value]] in Completion TRY() helpers 2022-01-03 21:50:50 +01:00
Linus Groh
032e6a2d28 LibJS: Remove redundant abrupt completion check
A throw completion is always an abrupt completion, no need to check :^)
2022-01-03 21:50:50 +01:00
Linus Groh
85f0fc2b83 LibJS: Return Optional<T> from Completion::{value,target}(), not T
In the end this is a nicer API than having separate has_{value,target}()
and having to check those first, and then making another Optional from
the unwrapped value:

    completion.has_value() ? completion.value() : Optional<Value> {}
    //                       ^^^^^^^^^^^^^^^^^^
    //         Implicit creation of non-empty Optional<Value>

This way we need to unwrap the optional ourselves, but can easily pass
it to something else as well.

This is in anticipation of the AST using completions :^)
2022-01-03 21:50:50 +01:00
martinfalisse
b39aede8fe Spreadsheet: Background fill color after reaching vertical end
When selecting a cell in the spreadsheet that was added
automatically as per the InfinitelyScrollableTableView
implementation, the background color is now filled correctly.

Previously, when navigating horizontally in a spreadsheet, after
a certain point the cells would not have the same background fill
color as the user would have experienced in the previous column
ranges (A-Z).
2022-01-03 22:30:04 +03:30
Samuel Bowman
4711d789c9 CrashReporter: Move progressbar into main window
Previously we would create a temporary progress window to show a
progressbar while the coredump is processed. Since we're only waiting
on backtraces and CPU register states, we can move the progressbar
into the main window and show everything else immediately while the
slow parts are generated in a BackgroundAction.
2022-01-03 16:19:47 +01:00
creator1creeper1
74d1eb6502 Applets/ResourceGraph: Propagate errors in JSON decoding 2022-01-03 16:01:42 +01:00
creator1creeper1
e46f08ff33 Applets/Network: Propagate errors using custom try_create
We now move-construct the bitmaps into the NetworkWidget.
2022-01-03 16:01:42 +01:00
creator1creeper1
f125d52622 Applets/Network: Propagate errors with try_set_main_widget
Use try_set_main_widget instead of set_main_widget.
2022-01-03 16:01:42 +01:00
creator1creeper1
43ecf1d429 Applets/Audio: Propagate errors using custom try_create
We now move-construct the bitmaps into the AudioWidget.
2022-01-03 16:01:42 +01:00
creator1creeper1
a550c20c35 Applets/Audio: Propagate errors with try_set_main_widget
Use try_set_main_widget instead of set_main_widget.
2022-01-03 16:01:42 +01:00
bugreport0
99e0b69c0c WindowServer: Tighten pledged promises 2022-01-03 15:56:41 +01:00
bugreport0
764f455d21 Taskbar: Tighten pledged promises, remove incorrect comment 2022-01-03 15:56:41 +01:00
bugreport0
0d78693b6a RequestServer: Tighten pledged promises 2022-01-03 15:56:41 +01:00
bugreport0
1d6ed50dd0 ChessEngine: Remove unused 'rpath' promise 2022-01-03 15:56:41 +01:00
Corey Williamson
79805a3f80 Keymaps: Add colemak-caps-backspace mapping
This patch adds the colemak keymap with caps lock remapped to backspace
(as is the default for colemak)
2022-01-03 15:54:32 +01:00
Corey Williamson
f51834d610 Kernel: Allow backspace '\b' to be remapped
Previously, one could put '\b' in a keymap, but in non-Terminal
applications, it would just insert a literal '\b' character instead of
behaving like backspace. This patch modifes
`visible_code_point_to_key_code` to include backspace, as well as
renaming it to `code_point_to_key_code` since '\b' is not a visible
character. Additionally, `KeyboardDevice::key_state_changed` has been
rearranged to apply the user's keymap before checking for things like
caps lock.
2022-01-03 15:54:32 +01:00
martinfalisse
452150c632 LibGUI: Bring entire cell into view after auto scroll into view
On account of row and column headers, when a user navigates to
a cell (for example in the spreadsheet application) that is
outside of the view, the cell is not properly aligned and so
is partially cut-off. This fix takes into account the row and
column headers when calculating the Rect to pass to the
scroll_into_view function.
2022-01-03 15:49:07 +01:00
Maciej
e824a2da90 WebServer: Make ErrorOr unwrapping more idiomatic
This still not propagates errors properly, but is at least (more)
consistent with the codebase.
2022-01-03 15:44:56 +01:00
Timothy Flynn
022b416570 LibJS: Implement the Extend TimeZoneName Option Proposal
This is a stage 4 proposal that was recently merged into the main
ECMA-402 spec. See:

https://github.com/tc39/ecma402/commit/1ba5ee7
2022-01-03 15:11:59 +01:00
Timothy Flynn
126a3fe180 LibUnicode: Add minimal support for generic & offset-based time zones
ECMA-402 now supports short-offset, long-offset, short-generic, and
long-generic time zone name formatting. For example, in the en-US locale
the America/Eastern time zone would be formatted as:

    short-offset: GMT-5
    long-offset: GMT-05:00
    short-generic: ET
    long-generic: Eastern Time

We currently only support the UTC time zone, however. Therefore, this
very minimal implementation does not consider GMT offset or generic
display names. Instead, the CLDR defines specific strings for UTC.
2022-01-03 15:11:59 +01:00
Brian Gianforcaro
d2ac40bcd7 Kernel: Enumerate PCI devices a single time in StorageManagement
Previously we were enumerating multiple times for each storage type.
We can easily enumerate once instead.
2022-01-03 13:26:12 +01:00
Andrew Kaster
eb672aef31 Toolchain: Add CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME to Platform
This property tells CMake that if a library is missing a SONAME field,
the link editor(s) we use will insert the full path to the library into
the binary. This is the behaivor of GNU ld compatible linkers, so let's
avoid that possiblity by telling CMake that it really doesn't want to
let the linker embed the full path to the lib. This is especially
important when cross-compiling things for ports and such, as the full
path to the lib will have absolutely nothing to do with the runtime path
2022-01-03 11:08:45 +00:00
Andrew Kaster
4dc538da0e Ports: Remove build-crt patch from llvm
This patch has been integrated into the toolchain.patch file.
2022-01-03 11:08:45 +00:00
Andrew Kaster
c5898806d2 Toolchain: Use Platform/SerenityOS.cmake in LLVM toolchain build
By setting CMAKE_MODULE_PATH in the LLVM initial cache scripts, we can
make the "SerenityOS" CMAKE_SYSTEM_NAME usable in the builds of
compiler-rt, libunwind, libcxxabi and libcxx.

This simplifies some toolchain patches and brings the cross-compiler
patches closer to the Port's patches, and closer to something
upstreamable.
2022-01-03 11:08:45 +00:00
Jesse Buhagiar
af31253a16 Kernel: Use try_create not must_create in SysFSUSB::create
The function `KString::must_create()` can only be enforced
during early boot (that is, when `g_in_early_boot` is true), hence
the use of this function during runtime causes a `VERIFY` to assert,
leading to a Kernel Panic.
We should instead use `TRY()` along with `try_create()` to prevent
this from crashing whenever a USB device is inserted into the system,
and we don't have enough memory to allocate the device's KString.
2022-01-03 10:39:56 +02:00
Jamie Mansfield
1d7d7d39b7 Spider: Redraw completely when drawing cards
Spider was only updating the new bounding box area after drawing cards
from the deck - leaving behind a sliver of the old deck.

This was a regression, as the game previously used the old bounding
box, introduced by GH-11153.
2022-01-02 22:26:52 +01:00