summaryrefslogtreecommitdiff
path: root/AK
AgeCommit message (Collapse)Author
2023-03-05AK: Add FlyString::to_deprecated_fly_string()Kenneth Myhra
This adds the conversion function to_deprecated_fly_string() to enable conversion from new FlyString to DeprecatedFlyString.
2023-03-05AK+LibAudio: Remove UFixedBigInt::my_sizeDan Klishch
2023-03-04AK: Implement Knuth's algorithm D for dividing UFixedBigInt'sDan Klishch
2023-03-04AK: Delete unused and untested sqrt, pow and pow_mod from UFixedBigIntDan Klishch
2023-03-04AK+LibCrypto: Delete 64x64 wide multiplication workaroundsDan Klishch
Now UFixedBigInt exposes API to do wide multiplications of this kind efficiently.
2023-03-04AK: Rewrite UFixedBigInt using the framework from BigIntBase.hDan Klishch
2023-03-04AK: Introduce "BigIntBase.h" for common simple operations on big intsDan Klishch
2023-03-04AK: Move compiletime_fail to StdLibExtras.hDan Klishch
This function will be used in the next commit in "BigIntBase.h".
2023-03-04AK: Remove signbit definition to prevent conflict in FixedPointnipos
2023-03-04AK: Add support for Solaris to StackInfonipos
2023-03-04AK: Add Solaris to platform detectionnipos
2023-03-04AK: Add StackInfo implementation for WindowsAndrew Kaster
This prevents a warning when compiling jakt that it's not implemented.
2023-03-04LibCMake: Introduce a CMake lexerSam Atkins
2023-03-04AK: Format Debug.h.inSam Atkins
Indented #cmakedefine01 is supported since CMake 3.10: https://cmake.org/cmake/help/latest/release/3.10.html#commands We're on 3.16, and the minimum required for Serenity itself is 3.25, so this should be fine. And it makes CLion's auto-formatter much happier!
2023-03-03AK+readelf: Issue error when using ARCH(arch) with nonexistent archDan Klishch
This disallows erroneous `#if ARCH(x86_64)` (note lowercase x).
2023-03-03AK: Ensure short String instances are valid UTF-8Timothy Flynn
We are currently only validating long strings.
2023-03-03AK: Protect Utf8View against inclusion in the KernelTimothy Flynn
It will soon be included in the Kernel by way of String.h. Utf8View includes DeprecatedString, which is not allowed in the Kernel.
2023-03-03AK: Invalidate overlong UTF-8 code point encodingsTimothy Flynn
For example, the code point U+002F could be encoded as UTF-8 with the bytes 0x80 0xAF. This trick has historically been used to bypass security checks.
2023-03-03AK: Replace UTF-8 string validation with a constexpr implementationTimothy Flynn
This will allow validating UTF-8 strings at compile time, such as from String::from_utf8_short_string.
2023-03-03AK: Add String::ends_with{,_bytes}()Linus Groh
2023-03-03AK: Add missing const qualifier to HashCompatible HashMap::contains()Linus Groh
2023-03-03AK: Make FixedPoint(FloatingPoint) ctor round instead of truncatingNico Weber
This is needed to have code for creating an in-memory sRGB profile using the (floating-ppoint) numbers from the sRGB spec and having the fixed-point values in the profile match what they are in other software (such as GIMP). It has the side effect of making the FixedPoint ctor no longer constexpr (which seems fine; nothing was currently relying on that). Some of FixedPoint's member functions don't round yet, which requires tweaking a test.
2023-03-01AK: Add new String constructor to URLKenneth Myhra
2023-02-28AK+Everywhere: Make GenericLexer::ignore_until() stop before the valueSam Atkins
`consume_until(foo)` stops before foo, and so does `ignore_until(Predicate)`, so let's make the other `ignore_until()` overloads consistent with that so they're less confusing.
2023-02-28Userland+AK: Stop using getopt() for ArgsParserAli Mohammad Pur
This commit moves the implementation of getopt into AK, and converts its API to understand and use StringView instead of char*. Everything else is caught in the crossfire of making Option::accept_value() take a StringView instead of a char const*. With this, we must now pass a Span<StringView> to ArgsParser::parse(), applications using LibMain are unaffected, but anything not using that or taking its own argc/argv has to construct a Vector<StringView> for this method.
2023-02-28AK: Add two starts_with{bytes,}() APIs to StringAli Mohammad Pur
2023-02-26AK: Fix DeprecatedString::bijective_base_from for large numbersTim Ledbetter
The output of the DeprecatedString::bijective_base_from() is now correct for numbers larger than base^2. This makes column names display correctly in Spreadsheet.
2023-02-25AK: Add FixedPoint::clampkleines Filmröllchen
2023-02-25AK: Use the same consteval condition on _short_string as its factoryTimothy Flynn
This fixes the build with Apple Clang.
2023-02-25AK: Add operator""_{short_,}string to create a String from a literalLinus Groh
We briefly discussed this when adding the new String type but couldn't settle on a name. However, having to use String::from_utf8() on every literal string is a bit unwieldy, so let's have these options available! Naming-wise '_string' is not as short as 'sv' but should be relatively clear; it also matches '_bigint' and '_ubigint' in length. '_short_string' may be longer than the actual string itself, but it's still an improvement over the static function :^) Since our C++ source files are UTF-8 encoded anyway, it should be impossible to create a string literal with invalid UTF-8, so including that in the name is not as important as in the function that can receive arbitrary data.
2023-02-24AK+Kernel: Add includes before removing Kernel/ProcessExposed.hLiav A
Apparently without this file, we won't be able to compile due to missing includes to TimeManagement and KBufferBuilder.
2023-02-24LibGfx: Add scaffolding for a webp decoderNico Weber
At the moment, this processes the RIFF chunk structure and extracts the ICCP chunk, so that `icc` can now print ICC profiles embedded in webp files. (And are image files really more than containers of icc profiles?) It doesn't even decode image dimensions yet. The lossy format is a VP8 video frame. Once we get to that, we might want to move all the image decoders into a new LibImageDecoders that depends on both LibGfx and LibVideo. (Other newer image formats like heic and av1f also use video frames for image data.)
2023-02-22AK: Prepare Utf32View for use within templated LibGfx contextsTimothy Flynn
Forward declare its iterator and add a peek() method analagous to Utf8CodePointIterator::peek().
2023-02-22AK: Add formatters for Utf8View and Utf32ViewTimothy Flynn
Useful for debugging, especially in templated contexts.
2023-02-21AK: Ensure that we fill the whole String when reading from a StreamTim Schumacher
2023-02-21AK: Add `take_first` to HashTable and rename `pop` to `take_last`Hediadyoin1
This naming scheme matches Vector. This also changes `take_last` to move the value it takes, and delete by known pointer, avoiding a full lookup and potential copies.
2023-02-21AK: Update HashTables head and tail when shifting during deletionHediadyoin1
Otherwise we end up with invalid pointers to them, breaking iteration.
2023-02-21AK: Add String::from_stream methodAndrew Kaster
The caller is responsible for determining how long the string is that they want to read.
2023-02-21Revert "AK: Disallow constness laundering in RefPtr and NonnullRefPtr"Andreas Kling
This reverts commit 3c7a0ef1ac279c99bc4ee72085278ea70c210889. This broke Jakt, which will need some adjustments to its code generation before we can commit to being this strict.
2023-02-21AK: Disallow constness laundering in RefPtr and NonnullRefPtrAndreas Kling
Until now, it was possible to assign a RP<T const> or NNRP<T const> to RP<T> or NNRP<T>. This meant that the constness of the T was lost. We had a lot of code that relied on this sloppiness, and by the time you see this commit, I hopefully found and fixed all of it. :^)
2023-02-21AK: Make String const-correct internallyAndreas Kling
2023-02-21AK: Make Deprecated{Fly,}String and StringImpl const-correctAndreas Kling
2023-02-21AK: Stop NonnullPtrVector from making accessed elements constAndreas Kling
2023-02-20AK/StackInfo: Add support for NetBSDnipos
2023-02-19AK: Allow zero-valued signed size types in format stringsAndrew Kaster
2023-02-19AK/StackInfo: Add support for OpenBSD pthreadsnipos
2023-02-19AK: Make FlyString(String) constructor implicitSam Atkins
This stops us needing a lot of ugly `FlyString { ... }` wrappers. THis is the behavior that `DeprecatedFlyString(DeprecatedString)` has so it should be fine.
2023-02-18LibGfx: Rename `JPGLoader` to `JPEGLoader`Lucas CHOLLET
The patch also contains modifications on several classes, functions or files that are related to the `JPGLoader`. Renaming include: - JPGLoader{.h, .cpp} - JPGImageDecoderPlugin - JPGLoadingContext - JPG_DEBUG - decode_jpg - FuzzJPGLoader.cpp - Few string literals or texts
2023-02-18AK: Fix printing of negative FixedPoint valuesNico Weber
Fixes #17514 by comparing to 0 before truncating the fractional part.
2023-02-18AK: Fix 64-bit alignment issue in shared-superstring substringsAndreas Kling
Thanks to Timothy Flynn for the test! Fixes #17141