Commit graph

28437 commits

Author SHA1 Message Date
Brian Gianforcaro 40a58f1fd4 Kernel: Remove unused partition name API
I was about to convert this to use KString, but then I realized it
wasn't actually used at all, so lets remove it until the day it is
needed.
2021-10-03 13:36:10 +02:00
Brian Gianforcaro 54a2aaaa6f Kernel: Remove now unused StorageDevice constructor 2021-10-03 13:36:10 +02:00
Brian Gianforcaro 70ad18fbcd Kernel: Remove most String usage from storage_name() API
This change is another minor step towards removing `AK::String` from
the Kernel. Instead of dynamically allocating the storage_name we can
instead allocate it via a KString in the factory for each device, and
then push the device name down into the StorageDevice base class.

We don't have a way of doing `AK::String::formatted(..)` with a KString
at the moment, so cleaning that up will be left for a later day.
2021-10-03 13:36:10 +02:00
Brian Gianforcaro 3a945051fc Kernel: Use operator ""sv in all purpose() implementations
Previously there was a mix of returning plain strings and returning
explicit string views using `operator ""sv`. This change switches them
all to standardized on `operator ""sv` as it avoids a call to strlen.
2021-10-03 13:36:10 +02:00
Brian Gianforcaro 5f1c98e576 Kernel: Use operator ""sv in all class_name() implementations
Previously there was a mix of returning plain strings and returning
explicit string views using `operator ""sv`. This change switches them
all to standardized on `operator ""sv` as it avoids a call to strlen.
2021-10-03 13:36:10 +02:00
Brian Gianforcaro 836c22ea13 Kernel: Remove AK::String usage from Storage/StorageManagement.cpp 2021-10-03 13:36:10 +02:00
Brian Gianforcaro 7f88d5058e Kernel: Remove AK::String usage from Storage/IDEChannel.cpp 2021-10-03 13:36:10 +02:00
Tim Schumacher 4302e7ac26 Tests: Add tests for mbrtowc 2021-10-03 11:13:50 +00:00
Tim Schumacher 67a579aab0 AK: Add a basic formatter for wchar_t 2021-10-03 11:13:50 +00:00
Tim Schumacher 4ef3ed4ba3 LibC: Implement mbrtowc closer to POSIX 2021-10-03 11:13:50 +00:00
Tim Schumacher e7f99edefa Tests: Add a test for mbsinit 2021-10-03 11:13:50 +00:00
Tim Schumacher 212f9308d4 LibC: Specifically clear only stored bytes after successful mbrtowc 2021-10-03 11:13:50 +00:00
Tim Schumacher 06f30943ef LibC: Manually count stored bytes in mbstate_t
This is probably a bit faster than constantly having to look through all
stored bytes. It also helps when we are trying to store actual null
bytes.
2021-10-03 11:13:50 +00:00
Tim Schumacher 3c807402b3 LibC: Remove the mbstate_reset helper
A zero-initialized mbstate_t struct has to be a valid initial state, so
we can just zero-initialize it whenever we need to reset.

Having a helper function for resetting the struct might imply that you
can add additional setup operations afterwards, which is not the case.
2021-10-03 11:13:50 +00:00
Ali Mohammad Pur ab46864674 LibTLS: Split large application data packets into chunks
Each TLS record has a limited max size, we should respect that and split
the packets.
Fixes RecordOverflow errors when a packet larger than 18432 bytes is
sent over.
2021-10-03 14:42:00 +03:30
Tim Schumacher c3b14588ec LibC: Stub out swprintf 2021-10-03 05:28:51 +00:00
Tim Schumacher e82dc7c77a LibC: Stub out wcstold 2021-10-03 05:28:51 +00:00
Tim Schumacher 893d9e8741 LibC: Stub out wcstod 2021-10-03 05:28:51 +00:00
Tim Schumacher e0548692ac LibC: Stub out wcstof 2021-10-03 05:28:51 +00:00
Tim Schumacher 783ddd261d LibC: Stub out wcstoull 2021-10-03 05:28:51 +00:00
Tim Schumacher a65f52d8de LibC: Stub out wcstoul 2021-10-03 05:28:51 +00:00
Tim Schumacher 05b283f552 LibC: Implement wmemmove 2021-10-03 05:28:51 +00:00
Tim Schumacher fa1208edfd LibC: Implement wmemset 2021-10-03 05:28:51 +00:00
Tim Schumacher 485c0ef691 LibC: Implement wmemcpy 2021-10-03 05:28:51 +00:00
Tim Schumacher 0ca1df4dc6 LibC: Implement wmemchr 2021-10-03 05:28:51 +00:00
Tim Schumacher 5ac2e84264 LibC: Implement wcsstr 2021-10-03 05:28:51 +00:00
Tim Schumacher 1b078f87b7 LibC: Implement wcspbrk 2021-10-03 05:28:51 +00:00
Ali Mohammad Pur c80b65b827 LibRegex: Avoid creating a new temporary RegexStringView in Char compare
Instead of making a new string to compare against, simply grab the first
code unit of the input and compare against that.
2021-10-03 01:15:17 +02:00
Luke Wilde 6a7739c645 LibWeb: Convert Node.childNodes to NodeList
This changes the old child_nodes implementation to children_as_vector
so that can still be used in insert_before.
2021-10-03 00:18:52 +02:00
Luke Wilde 2f7fb1fe63 LibWeb: Convert ParentNode.querySelectorAll to NodeList 2021-10-03 00:18:52 +02:00
Luke Wilde 8d6db36cbb LibWeb: Add support for NodeList
This introduces 3 classes: NodeList, StaticNodeList and LiveNodeList.
NodeList is the base of the static and live versions. Static is a
snapshot whereas live acts on the underlying data and thus inhibits
the same issues we have currently with HTMLCollection.

They were split into separate classes to not have them weirdly
mis-mashed together.

The create functions for static and live both return a NNRP to the base
class. This is to prevent having to do awkward casting at creation
and/or return, as the bindings expect to see the base NodeList only.
2021-10-03 00:18:52 +02:00
Luke Wilde bfd089fbd1 LibWeb: Add support for IDL value iterators
This also renames Interface::iterator_types to pair_iterator_types to
reduce confusion between value and pair iterators.
2021-10-03 00:18:52 +02:00
Nico Weber 2c0d329bf6 Kernel: Make aarch64 UART::print_num() print u64s 2021-10-02 21:23:28 +01:00
Nico Weber bc213ad7a2 Kernel: Add a Timer class for aarch64
For now, this can only query microseconds since boot.

Use this to print a timestamp every second. This busy-loops
until a second has passed. This might be a good first use of
interrupts soon.

qemu used to not implement this timer at some point, but
it seems to work fine even in qemu now (qemu v 5.2.0).
2021-10-02 21:23:28 +01:00
Linus Groh 496d2e3c29 LibGL: Remove duplicate GLboolean typedef
Fixes #10268.
2021-10-02 21:10:13 +01:00
Jelle Raaijmakers 06f84d927e Ports: Add Ncdu 2021-10-02 21:07:47 +01:00
Jelle Raaijmakers 718b205a9e Base: Correct value for default white terminal color 2021-10-02 21:07:47 +01:00
Jelle Raaijmakers 49ccda5d97 LibVT: Implement G0..G3 and VT100 translation table 2021-10-02 21:07:47 +01:00
Jelle Raaijmakers aaa1382bd6 LibVT: Implement support for Cursor Keys Mode (DECCKM) 2021-10-02 21:07:47 +01:00
Jelle Raaijmakers e33e0e6a27 LibVT: Add stubs for DECPNM, DECPAM
Still not implemented, but provides easier to grasp FIXMEs.
2021-10-02 21:07:47 +01:00
Jelle Raaijmakers 91ad7754fe Ports: Compile ncurses with --enable-term-driver
In commit ba97548686 `--with-termlib` was added to produce a
`libtinfo.a` file that nano then required. However, this causes ncurses
to build with _only_ screen-pointer ext funcs: e.g.
`reset_prog_mode_sp` exists, but `reset_prog_mode` does not.

By switching to `--enable-term-driver`, all functions are properly
exported again and the nano port compiles and runs just fine. :^)
2021-10-02 21:07:47 +01:00
Jelle Raaijmakers 8487ff551c Ports: Switch ncurses to SHA256 auth type 2021-10-02 21:07:47 +01:00
Gal Horowitz cfc5df27f0 FontEditor: Close preview window when the main window is closed 2021-10-02 20:55:14 +02:00
Gal Horowitz aa180c821d LibGFX: Draw the ends of lines with non-standard thickness
Lines are drawn using squares the size of the thickness, so if the
length of the line was not a multiple of the thickness, the end of the
line was not drawn correctly.
2021-10-02 20:54:47 +02:00
Gal Horowitz cd7473d1a3 PixelPaint: Correctly offset stroke position for even thicknesses 2021-10-02 20:54:32 +02:00
Gal Horowitz be4485fe85 PixelPaint: LayerListWidget::set_selected_layer now handles nullptr 2021-10-02 20:54:12 +02:00
Andreas Kling 87290e300e AK: Simplify Utf16View::operator==(Utf16View) 2021-10-02 18:32:56 +02:00
Andreas Kling f0b3a06746 LibJS: Use Vector<u16, 1> for UTF-16 in a few more places 2021-10-02 18:32:56 +02:00
Brian Gianforcaro dc99b702be Meta: Include source sha in sonarcloud analysis metadata
Having the version included in each analysis allows you to do more
filtering in the UI where results are viewed.
2021-10-02 18:16:15 +02:00
Brian Gianforcaro 92844a6af6 Kernel: Access Processor static methods statically
SonarCloud flagged this "Code Smell", where we are accessing these
static methods as if they are instance methods. While it is technically
possible, it is very confusing to read when you realize they are static
functions.
2021-10-02 18:16:15 +02:00