Commit Graph

21396 Commits

Author SHA1 Message Date
R Smith
5a6f0ef1bc AK: Don’t drop lines between \r and \n in StringView::lines() (#7662)
StringView::lines() supports line-separators “\n”, “\r”, and “\r\n”.
The method will drop an entire line if it is surrounded by “\r”
and “\n” separators on the left and right sides respectively.
2021-06-04 12:06:08 +04:30
Linus Groh
1828607606 LibTest: Add --json flag to JS test runner
This will not show the colorful human-readable file results and final
test results summary but instead output a JSON blob containing all test
information, which can then be processed by other programs easily.
2021-06-04 08:32:56 +01:00
DhruvMaroo
6c3d601e87 Profiler: Show the duration of the time interval chosen 2021-06-04 09:30:22 +02:00
Scott Antipa
7dab58ac3b
Documentation: Fix a typo by removing an extra word 2021-06-04 08:22:41 +01:00
John Brehm
2dfd95767a
Ports: Add p7zip 2021-06-04 08:21:33 +01:00
Gunnar Beutner
6093236424 LibCards: Don't draw the first card smaller than the others 2021-06-04 09:20:21 +02:00
brapru
7843287d89 LibLine: Actually cancel the search editor on Ctl-C
When the search editor calls on really_quit_event_loop to cancel the
search, the command loaded in m_buffer would actually execute because
really_quit_event_loop sends a new line character and then afterwards
clears the buffer.

By using end_search prior to exiting the event loop, this patch will
appropriately clear the buffer, not execute any commands, and
preserve the original loaded buffer after returning from a canceled
search.
2021-06-04 11:00:24 +04:30
Matthew Jones
1748591570 Solitaire: Fixes undo feature from incorrect merge conflict resolution 2021-06-04 00:15:25 +02:00
Andreas Kling
bfffdd37f0 LibCpp: Revert change to strace.cpp AST test from bf8fd4c
Since the purpose of this file is just to verify the AST generated,
we can leave it alone.
2021-06-04 00:03:25 +02:00
David Isaksson
fe03630716 LibCards: Draw cards with rounded card corners
closes #7412
2021-06-03 22:58:14 +02:00
Andreas Kling
bf8fd4c193 Everywhere: Remove accidental '\n' from various outln() invocations
Also convert outln(stderr, ...) to warnln(...)
2021-06-03 22:50:21 +02:00
Liav A
43e7181ec8 Meta: Add a guideline about bare metal issues 2021-06-03 20:59:49 +02:00
Gunnar Beutner
7f7897c900 Kernel: Make sure outgoing ICMP packets have the correct checksum
The internet_checksum() function relies on the buffer - or at least the
checksum field - to be all zeroes.
2021-06-03 20:59:30 +02:00
NonStandardModel
c4c577b2bf Meta: Sort debug macros alphabetically 2021-06-03 18:44:45 +01:00
Marcus Nilsson
5a8cc85328 LibGUI/FileIconProvider: Return s_file_icon when stat() fails
Previously when using icon_for_path(), without specifying t_mode, on an
anonymous file it would return an empty Icon causing problems down the
line. Instead return the s_file_icon when stat fails.
2021-06-03 17:43:20 +01:00
Gunnar Beutner
bc174b0fd0 Utilities: Make sure columns for ps are properly aligned
This updates ps so that it calculates the ideal column width instead
of relying on hard-coded values. Previously the STATE column was too
small to fit the state for "FinalizerTask".
2021-06-03 17:53:59 +02:00
NonStandardModel
5bbca2fa8b
KeyboardMapper: Fix crash upon loading an invalid JSON file
This fixes #7699.
It would be nice to also show a GUI alert informing about the failure,
but I will leave that for the future.
2021-06-03 16:19:07 +01:00
Liav A
47c1a31f89 Kernel: Support new lines when doing critical printing
If we are printing strings in the critical path, handling new lines
require us to break abstraction a bit to print new lines.

Fixes #7562.
2021-06-03 16:16:22 +01:00
Liav A
e8d85b0694 Kernel/Graphics: Remove unused overloaded write methods of Console
If we happen to print a string, we could use a StringView instead. For
now, let's remove them entirely.
2021-06-03 16:16:22 +01:00
Luke
01d7c1b722 Kernel: Fix "sv" being inside of "no-fbdev" instead of outside
It was previously "no-fbdevsv" when it should be "no-fbdev"sv.
2021-06-03 17:08:06 +02:00
Idan Horowitz
057cd35a6d CI: Skip saving the toolchain and ccache caches in PR workflows
This speeds up CI by removing some cache thrashing caused by PRs that
change cache-related files (but that were not merged yet).
2021-06-03 16:43:52 +02:00
DexesTTP
e01f1c949f AK: Do not VERIFY on invalid code point bytes in UTF8View
The previous behavior was to always VERIFY that the UTF-8 bytes were
valid when iterating over the code points of an UTF8View. This change
makes it so we instead output the 0xFFFD 'REPLACEMENT CHARACTER'
code point when encountering invalid bytes, and keep iterating the
view after skipping one byte.

Leaving the decision to the consumer would break symmetry with the
UTF32View API, which would in turn require heavy refactoring and/or
code duplication in generic code such as the one found in
Gfx::Painter and the Shell.

To make it easier for the consumers to detect the original bytes, we
provide a new method on the iterator that returns a Span over the
data that has been decoded. This method is immediately used in the
TextNode::compute_text_for_rendering method, which previously did
this in a ad-hoc waay.

This also add tests for the new behavior in TestUtf8.cpp, as well
as reinforcements to the existing tests to check if the underlying
bytes match up with their expected values.
2021-06-03 18:28:27 +04:30
Gunnar Beutner
32ee195d62 LibJS: Avoid allocations in the Exception constructor 2021-06-03 14:47:15 +01:00
Gunnar Beutner
8b449214af LibJS: Optimize insertion order in the Exception constructor
By inserting the stack frames in the correct order we can improve the
runtime for the test-js test suite by about 20%.
2021-06-03 14:47:15 +01:00
Max Wipfli
bc8d16ad28 Everywhere: Replace ctype.h to avoid narrowing conversions
This replaces ctype.h with CharacterType.h everywhere I could find
issues with narrowing conversions. While using it will probably make
sense almost everywhere in the future, the most critical places should
have been addressed.
2021-06-03 13:31:46 +02:00
Max Wipfli
1c9d87c455 Tests: Add tests for most functions in AK/CharacterType.h 2021-06-03 13:31:46 +02:00
Max Wipfli
f4a4c36fa0 AK: Add CharacterTypes.h
This patch introduces CharacterTypes.h, which aims to be a replacement
for most usages of ctype.h. In contrast to that implementation, this
header makes use of exclusively constexpr functions and support the full
Unicode code point set without any narrowing-conversion issues.
2021-06-03 13:31:46 +02:00
Brian Gianforcaro
d0dbb014a0 WindowServer: Switch Window to IntrusiveList from InlineLinkedList
Another small step towards unifying IntrusiveList / InlineLinkedList.
2021-06-03 13:27:40 +02:00
Brian Gianforcaro
7e691f96e1 Kernel: Switch ProcessGroup to IntrusiveList from InlineLinkedList 2021-06-03 13:27:40 +02:00
Brian Gianforcaro
ce74fce0df Tests: Add test coverage for AK::IntrusiveList reverse iterator support 2021-06-03 13:27:40 +02:00
Brian Gianforcaro
ef4fdcf76f AK: Add reverse iterator support to AK::IntrusiveList
In order for IntrusiveList to be capable of replacing InlineLinkedList,
it needs to support reverse iteration. InlineLinkedList currently
supports manual reverse iteration by calling list->last() followed by
node->prev().
2021-06-03 13:27:40 +02:00
Brian Gianforcaro
e37f39d980 LibC: Switch ChunkedBlock to IntrusiveList from InlineLinkedList 2021-06-03 13:27:40 +02:00
Gunnar Beutner
48da8a568d
AK: Remove unused JsonValue <=> IPv4Address conversion code
This removes code that isn't used anywhere.
2021-06-03 11:56:32 +01:00
Brian Gianforcaro
06df26da67 LibGUI: Hide TextEditor dbgln spew under TEXTEDITOR_DEBUG 2021-06-03 11:21:38 +01:00
Brian Gianforcaro
c2d556be3d TextEditor: Remove unused header includes 2021-06-03 11:21:38 +01:00
Matthew B. Jones
ecaae2d10f
Solitaire: Add keys for drawing and moving cards to foundation stacks
Also shifts logic of starting game length timer into function
`start_timer_if_necessary`, so it can be called from original
mouse event handler and new `auto_move_eligible_cards_to_stacks`
2021-06-03 08:43:28 +01:00
Matthew B. Jones
e7cfa9bf8e
LibGUI: Properly wrap multiple lines in IconView search highlighting 2021-06-03 08:32:31 +01:00
Timothy Flynn
a870eac0eb LibSQL: Report a syntax error for unsupported LIMIT clause syntax
Rather than aborting when a LIMIT clause of the form 'LIMIT expr, expr'
is encountered, fail the parser with a syntax error. This will be nicer
for the user and fixes the following fuzzer bug:
https://crbug.com/oss-fuzz/34837
2021-06-03 08:30:13 +02:00
Matthew Jones
0ff09d4f74 WindowServer: Add sanity checks to create_window IPC 2021-06-03 08:27:57 +02:00
Matthew Jones
ef92493aba LibGUI: ComboBox now goes upwards when running out of room to render 2021-06-03 08:24:18 +02:00
Matthew Jones
36a1162eb8 LibGUI: ComboBox now correctly sizes height in relation to taskbar 2021-06-03 08:23:45 +02:00
Matthew Jones
6c520fab87 LibGUI: Desktop.h should get actual value from TaskbarWindow.h 2021-06-03 08:23:45 +02:00
Matthew Jones
b0682a73ee WindowServer: Position popup menu with offset of 1 pixel 2021-06-03 08:21:01 +02:00
Gunnar Beutner
a4f320c76b AK: Allow inlining more string functions 2021-06-03 08:06:51 +02:00
Gunnar Beutner
ed0068d04d AK: Allow inlining ref-count functionality
Previously we'd incur the costs for a function call via the PLT even
for the most trivial ref-count actions like increasing/decreasing the
reference count.

By moving the code to the header file we allow the compiler to inline
this code into the caller's function.
2021-06-03 08:06:51 +02:00
Matthew B. Jones
ab4f4ddc3c
Solitaire: Add undo functionality 2021-06-03 01:16:49 +01:00
Gunnar Beutner
9444272ba0 Profiler: Remove m_deepest_stack_depth
This isn't used anymore so let's remove it entirely.
2021-06-03 01:16:32 +01:00
Gunnar Beutner
a607f13fc7 Profiler: Use sequential serial numbers for profiling events
Previously Profiler was using timestamps to distinguish processes.
However it is possible that separate processes with the same PID exist
at the exact same timestamp (e.g. for execve). This changes Profiler
to use unique serial numbers for each event instead.
2021-06-03 01:16:32 +01:00
Matthew Jones
af72b5ec82 LibGUI: Show pressed state for Space and Return key events
Also allows the user to press Esc while the button is being pressed
to cancel the button action.
2021-06-03 00:33:26 +01:00
Hediadyoin1
6fe7d4d7b8 Toolchain: Use gcc's ar
the vanilla versions might not handle all things, that gcc can do;
For example is lto not really supported by the vanilla versions
source:
https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ
2021-06-03 00:24:06 +01:00