From e265054c12a4fb596b26789e18f342711cf3ef95 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 25 Feb 2021 21:10:47 +0100 Subject: [PATCH] Everywhere: Remove a bunch of redundant 'AK::' namespace prefixes This is basically just for consistency, it's quite strange to see multiple AK container types next to each other, some with and some without the namespace prefix - we're 'using AK::Foo;' a lot and should leverage that. :^) --- AK/DistinctNumeric.h | 4 ++-- AK/FlyString.cpp | 2 +- AK/JsonParser.cpp | 2 +- AK/MACAddress.h | 4 ++-- AK/String.h | 2 +- AK/StringUtils.cpp | 2 +- AK/StringView.cpp | 2 +- AK/TestSuite.h | 2 +- AK/Tests/TestAllOf.cpp | 10 +++++----- AK/Tests/TestAnyOf.cpp | 14 +++++++------- AK/Tests/TestBadge.cpp | 2 +- AK/Tests/TestFind.cpp | 8 ++++---- AK/Tests/TestSpan.cpp | 2 +- AK/Tests/TestVector.cpp | 6 +++--- Kernel/Interrupts/APIC.h | 4 ++-- Kernel/Process.h | 2 +- Kernel/SpinLock.h | 4 ++-- Kernel/UnveilNode.h | 4 ++-- Meta/Lagom/Fuzzers/FuzzGemini.cpp | 2 +- Meta/Lagom/Fuzzers/FuzzJs.cpp | 2 +- Meta/Lagom/Fuzzers/FuzzMarkdown.cpp | 2 +- Meta/Lagom/Fuzzers/FuzzRegexECMA262.cpp | 2 +- Meta/Lagom/Fuzzers/FuzzRegexPosixExtended.cpp | 2 +- Meta/Lagom/Fuzzers/FuzzShell.cpp | 2 +- Meta/Lagom/Fuzzers/FuzzilliJs.cpp | 2 +- .../DisplaySettings/DisplaySettings.cpp | 4 ++-- Userland/Applications/FileManager/DirectoryView.h | 2 +- .../Applications/KeyboardMapper/KeyPositions.h | 2 +- .../KeyboardMapper/KeyboardMapperWidget.cpp | 4 ++-- Userland/Applications/QuickShow/QSWidget.cpp | 2 +- Userland/Demos/WidgetGallery/main.cpp | 2 +- Userland/DevTools/Inspector/RemoteProcess.h | 6 +++--- Userland/DevTools/UserspaceEmulator/Emulator.cpp | 2 +- .../DevTools/UserspaceEmulator/RangeAllocator.cpp | 2 +- Userland/Libraries/LibChess/Chess.h | 2 +- Userland/Libraries/LibCompress/Deflate.cpp | 2 +- Userland/Libraries/LibCore/Account.cpp | 2 +- Userland/Libraries/LibCore/Object.h | 2 +- .../Libraries/LibCrypto/BigInt/SignedBigInteger.h | 2 +- .../LibCrypto/BigInt/UnsignedBigInteger.h | 8 ++++---- .../LibCrypto/NumberTheory/ModularFunctions.cpp | 2 +- Userland/Libraries/LibCrypto/PK/Code/EMSA_PSS.h | 2 +- Userland/Libraries/LibCrypto/PK/RSA.cpp | 4 ++-- Userland/Libraries/LibGUI/AbstractTableView.cpp | 4 ++-- Userland/Libraries/LibGUI/InputBox.cpp | 2 +- Userland/Libraries/LibGUI/Variant.cpp | 2 +- Userland/Libraries/LibGUI/Variant.h | 2 +- .../Libraries/LibGUI/WindowServerConnection.cpp | 2 +- Userland/Libraries/LibGfx/PGMLoader.cpp | 2 +- .../Libraries/LibGfx/PortableImageLoaderCommon.h | 2 +- Userland/Libraries/LibGfx/Streamer.h | 2 +- .../Libraries/LibJS/Runtime/MarkedValueList.cpp | 2 +- Userland/Libraries/LibJS/Runtime/MarkedValueList.h | 3 ++- Userland/Libraries/LibTLS/ClientHandshake.cpp | 4 ++-- Userland/Libraries/LibTLS/Handshake.cpp | 2 +- Userland/Libraries/LibTLS/Record.cpp | 4 ++-- Userland/Libraries/LibTTF/Font.h | 2 +- Userland/Libraries/LibTTF/Glyf.h | 2 +- .../Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h | 4 ++-- Userland/Services/DHCPClient/DHCPv4.h | 2 +- Userland/Services/ProtocolServer/HttpProtocol.cpp | 2 +- Userland/Services/ProtocolServer/HttpsProtocol.cpp | 2 +- Userland/Services/SystemServer/Service.h | 2 +- Userland/Shell/Parser.cpp | 2 +- Userland/Tests/LibC/snprintf-correctness.cpp | 2 +- Userland/Tests/LibC/strlcpy-correctness.cpp | 2 +- Userland/Utilities/cut.cpp | 4 ++-- Userland/Utilities/js.cpp | 4 ++-- Userland/Utilities/lspci.cpp | 2 +- Userland/Utilities/test-bindtodevice.cpp | 2 +- Userland/Utilities/test-crypto.cpp | 8 ++++---- Userland/Utilities/tree.cpp | 2 +- Userland/Utilities/uniq.cpp | 2 +- 73 files changed, 111 insertions(+), 110 deletions(-) diff --git a/AK/DistinctNumeric.h b/AK/DistinctNumeric.h index dc679f88e77..27473050eb6 100644 --- a/AK/DistinctNumeric.h +++ b/AK/DistinctNumeric.h @@ -311,9 +311,9 @@ struct Formatter> : // TODO: Further type aliases? template -struct AK::Traits> : public AK::GenericTraits> { +struct Traits> : public GenericTraits> { static constexpr bool is_trivial() { return true; } - static constexpr auto hash(const AK::DistinctNumeric& d) { return AK::Traits::hash(d.value()); } + static constexpr auto hash(const DistinctNumeric& d) { return Traits::hash(d.value()); } }; using AK::DistinctNumeric; diff --git a/AK/FlyString.cpp b/AK/FlyString.cpp index cb1b564fd62..ac634c32926 100644 --- a/AK/FlyString.cpp +++ b/AK/FlyString.cpp @@ -34,7 +34,7 @@ namespace AK { -struct FlyStringImplTraits : public AK::Traits { +struct FlyStringImplTraits : public Traits { static unsigned hash(const StringImpl* s) { return s ? s->hash() : 0; } static bool equals(const StringImpl* a, const StringImpl* b) { diff --git a/AK/JsonParser.cpp b/AK/JsonParser.cpp index e645c4c91f9..d48dd570238 100644 --- a/AK/JsonParser.cpp +++ b/AK/JsonParser.cpp @@ -231,7 +231,7 @@ Optional JsonParser::parse_number() auto number = number_string.to_int(); if (!number.has_value()) return {}; - if (number.value() <= AK::NumericLimits::max()) { + if (number.value() <= NumericLimits::max()) { value = JsonValue((i32)number.value()); } else { value = JsonValue(number.value()); diff --git a/AK/MACAddress.h b/AK/MACAddress.h index 7e46e5aca71..9798ba8fa0a 100644 --- a/AK/MACAddress.h +++ b/AK/MACAddress.h @@ -79,11 +79,11 @@ public: constexpr bool is_zero() const { - return AK::all_of(m_data.begin(), m_data.end(), [](const auto octet) { return octet == 0; }); + return all_of(m_data.begin(), m_data.end(), [](const auto octet) { return octet == 0; }); } private: - AK::Array m_data {}; + Array m_data {}; }; static_assert(sizeof(MACAddress) == 6u); diff --git a/AK/String.h b/AK/String.h index 5ee0276dead..6d7e8f31da8 100644 --- a/AK/String.h +++ b/AK/String.h @@ -305,7 +305,7 @@ struct Traits : public GenericTraits { static unsigned hash(const String& s) { return s.impl() ? s.impl()->hash() : 0; } }; -struct CaseInsensitiveStringTraits : public AK::Traits { +struct CaseInsensitiveStringTraits : public Traits { static unsigned hash(const String& s) { return s.impl() ? s.to_lowercase().impl()->hash() : 0; } static bool equals(const String& a, const String& b) { return a.to_lowercase() == b.to_lowercase(); } }; diff --git a/AK/StringUtils.cpp b/AK/StringUtils.cpp index 90171e308ba..e8f7159f502 100644 --- a/AK/StringUtils.cpp +++ b/AK/StringUtils.cpp @@ -184,7 +184,7 @@ Optional convert_to_uint_from_hex(const StringView& str) T value = 0; const auto count = str_trimmed.length(); - const T upper_bound = AK::NumericLimits::max(); + const T upper_bound = NumericLimits::max(); for (size_t i = 0; i < count; i++) { char digit = str_trimmed[i]; diff --git a/AK/StringView.cpp b/AK/StringView.cpp index c04b7ada3a1..a08d31ff945 100644 --- a/AK/StringView.cpp +++ b/AK/StringView.cpp @@ -282,7 +282,7 @@ Optional StringView::find_first_of(const StringView& view) const { if (const auto location = AK::find_if(begin(), end(), [&](const auto c) { - return AK::any_of(view.begin(), view.end(), + return any_of(view.begin(), view.end(), [&](const auto view_char) { return c == view_char; }); diff --git a/AK/TestSuite.h b/AK/TestSuite.h index 9b7948f8b01..92768962861 100644 --- a/AK/TestSuite.h +++ b/AK/TestSuite.h @@ -90,7 +90,7 @@ private: struct timeval m_started; }; -using TestFunction = AK::Function; +using TestFunction = Function; class TestCase : public RefCounted { public: diff --git a/AK/Tests/TestAllOf.cpp b/AK/Tests/TestAllOf.cpp index 2557261d1a4..d500f94f521 100644 --- a/AK/Tests/TestAllOf.cpp +++ b/AK/Tests/TestAllOf.cpp @@ -31,13 +31,13 @@ TEST_CASE(should_determine_if_predicate_applies_to_all_elements_in_container) { - constexpr AK::Array a {}; + constexpr Array a {}; - static_assert(AK::all_of(a.begin(), a.end(), [](auto elem) { return elem == 0; })); - static_assert(!AK::all_of(a.begin(), a.end(), [](auto elem) { return elem == 1; })); + static_assert(all_of(a.begin(), a.end(), [](auto elem) { return elem == 0; })); + static_assert(!all_of(a.begin(), a.end(), [](auto elem) { return elem == 1; })); - EXPECT(AK::all_of(a.begin(), a.end(), [](auto elem) { return elem == 0; })); - EXPECT(!AK::all_of(a.begin(), a.end(), [](auto elem) { return elem == 1; })); + EXPECT(all_of(a.begin(), a.end(), [](auto elem) { return elem == 0; })); + EXPECT(!all_of(a.begin(), a.end(), [](auto elem) { return elem == 1; })); } TEST_MAIN(AllOf) diff --git a/AK/Tests/TestAnyOf.cpp b/AK/Tests/TestAnyOf.cpp index 94e28572adb..1a5e72686f6 100644 --- a/AK/Tests/TestAnyOf.cpp +++ b/AK/Tests/TestAnyOf.cpp @@ -31,15 +31,15 @@ TEST_CASE(should_determine_if_predicate_applies_to_any_element_in_container) { - constexpr AK::Array a { 1 }; + constexpr Array a { 1 }; - static_assert(AK::any_of(a.begin(), a.end(), [](auto elem) { return elem == 0; })); - static_assert(AK::any_of(a.begin(), a.end(), [](auto elem) { return elem == 1; })); - static_assert(!AK::any_of(a.begin(), a.end(), [](auto elem) { return elem == 2; })); + static_assert(any_of(a.begin(), a.end(), [](auto elem) { return elem == 0; })); + static_assert(any_of(a.begin(), a.end(), [](auto elem) { return elem == 1; })); + static_assert(!any_of(a.begin(), a.end(), [](auto elem) { return elem == 2; })); - EXPECT(AK::any_of(a.begin(), a.end(), [](auto elem) { return elem == 0; })); - EXPECT(AK::any_of(a.begin(), a.end(), [](auto elem) { return elem == 1; })); - EXPECT(!AK::any_of(a.begin(), a.end(), [](auto elem) { return elem == 2; })); + EXPECT(any_of(a.begin(), a.end(), [](auto elem) { return elem == 0; })); + EXPECT(any_of(a.begin(), a.end(), [](auto elem) { return elem == 1; })); + EXPECT(!any_of(a.begin(), a.end(), [](auto elem) { return elem == 2; })); } TEST_MAIN(AllOf) diff --git a/AK/Tests/TestBadge.cpp b/AK/Tests/TestBadge.cpp index e3cb769339d..dea46a91b82 100644 --- a/AK/Tests/TestBadge.cpp +++ b/AK/Tests/TestBadge.cpp @@ -30,7 +30,7 @@ TEST_CASE(should_provide_underlying_type) { - static_assert(AK::IsSame::Type>::value); + static_assert(IsSame::Type>::value); } TEST_MAIN(Badge) diff --git a/AK/Tests/TestFind.cpp b/AK/Tests/TestFind.cpp index 190068911d5..3ca7acc96a3 100644 --- a/AK/Tests/TestFind.cpp +++ b/AK/Tests/TestFind.cpp @@ -32,7 +32,7 @@ TEST_CASE(should_return_end_if_not_in_container) { - constexpr AK::Array a {}; + constexpr Array a {}; static_assert(a.end() == AK::find(a.begin(), a.end(), 1)); @@ -41,7 +41,7 @@ TEST_CASE(should_return_end_if_not_in_container) TEST_CASE(should_return_iterator_to_first_matching_value_in_container) { - static constexpr AK::Array a { 1, 2, 3, 4, 0, 6, 7, 8, 0, 0 }; + static constexpr Array a { 1, 2, 3, 4, 0, 6, 7, 8, 0, 0 }; constexpr auto expected = a.begin() + 4; @@ -52,7 +52,7 @@ TEST_CASE(should_return_iterator_to_first_matching_value_in_container) TEST_CASE(should_return_iterator_to_first_predicate_matching_value_in_container) { - static constexpr AK::Array a { 1, 2, 3, 4, 0, 6, 7, 8, 0, 0 }; + static constexpr Array a { 1, 2, 3, 4, 0, 6, 7, 8, 0, 0 }; constexpr auto expected = a.begin() + 4; @@ -66,7 +66,7 @@ TEST_CASE(should_return_iterator_to_first_predicate_matching_value_in_container) TEST_CASE(should_return_index_to_first_predicate_matching_value_in_container) { - static constexpr AK::Array a { 1, 2, 3, 4, 0, 6, 7, 8, 0, 0 }; + static constexpr Array a { 1, 2, 3, 4, 0, 6, 7, 8, 0, 0 }; static_assert(4 == AK::find_index(a.begin(), a.end(), 0)); diff --git a/AK/Tests/TestSpan.cpp b/AK/Tests/TestSpan.cpp index 798418d0f9c..9a4a6d76b12 100644 --- a/AK/Tests/TestSpan.cpp +++ b/AK/Tests/TestSpan.cpp @@ -49,7 +49,7 @@ TEST_CASE(span_works_with_constant_types) static constexpr u8 buffer[4] { 1, 2, 3, 4 }; constexpr ReadonlyBytes bytes { buffer, 4 }; - static_assert(AK::IsConst::Type>::value); + static_assert(IsConst::Type>::value); static_assert(bytes[2] == 3); } diff --git a/AK/Tests/TestVector.cpp b/AK/Tests/TestVector.cpp index a581815bec0..399e8b43cf0 100644 --- a/AK/Tests/TestVector.cpp +++ b/AK/Tests/TestVector.cpp @@ -396,7 +396,7 @@ TEST_CASE(should_compare_vectors_of_different_sizes) TEST_CASE(should_find_value) { - AK::Vector v { 1, 2, 3, 4, 0, 6, 7, 8, 0, 0 }; + Vector v { 1, 2, 3, 4, 0, 6, 7, 8, 0, 0 }; const auto expected = v.begin() + 4; @@ -405,7 +405,7 @@ TEST_CASE(should_find_value) TEST_CASE(should_find_predicate) { - AK::Vector v { 1, 2, 3, 4, 0, 6, 7, 8, 0, 0 }; + Vector v { 1, 2, 3, 4, 0, 6, 7, 8, 0, 0 }; const auto expected = v.begin() + 4; @@ -414,7 +414,7 @@ TEST_CASE(should_find_predicate) TEST_CASE(should_find_index) { - AK::Vector v { 1, 2, 3, 4, 0, 6, 7, 8, 0, 0 }; + Vector v { 1, 2, 3, 4, 0, 6, 7, 8, 0, 0 }; EXPECT_EQ(4u, v.find_first_index(0).value()); EXPECT(!v.find_first_index(42).has_value()); diff --git a/Kernel/Interrupts/APIC.h b/Kernel/Interrupts/APIC.h index 2d64a623e5d..a83810433fd 100644 --- a/Kernel/Interrupts/APIC.h +++ b/Kernel/Interrupts/APIC.h @@ -112,8 +112,8 @@ private: OwnPtr m_apic_base; Vector> m_ap_processor_info; Vector m_ap_idle_threads; - AK::Atomic m_apic_ap_count { 0 }; - AK::Atomic m_apic_ap_continue { 0 }; + Atomic m_apic_ap_count { 0 }; + Atomic m_apic_ap_continue { 0 }; u32 m_processor_cnt { 0 }; u32 m_processor_enabled_cnt { 0 }; APICTimer* m_apic_timer { nullptr }; diff --git a/Kernel/Process.h b/Kernel/Process.h index 9cf2ff3ec96..83bade854a0 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -138,7 +138,7 @@ public: ~Process(); static Vector all_pids(); - static AK::NonnullRefPtrVector all_processes(); + static NonnullRefPtrVector all_processes(); template RefPtr create_kernel_thread(EntryFunction entry, u32 priority, const String& name, u32 affinity = THREAD_AFFINITY_DEFAULT, bool joinable = true) diff --git a/Kernel/SpinLock.h b/Kernel/SpinLock.h index c0b7290c2bb..c5729d9e080 100644 --- a/Kernel/SpinLock.h +++ b/Kernel/SpinLock.h @@ -69,7 +69,7 @@ public: } private: - AK::Atomic m_lock { 0 }; + Atomic m_lock { 0 }; }; class RecursiveSpinLock { @@ -121,7 +121,7 @@ public: } private: - AK::Atomic m_lock { 0 }; + Atomic m_lock { 0 }; u32 m_recursions { 0 }; }; diff --git a/Kernel/UnveilNode.h b/Kernel/UnveilNode.h index 36dcb5b268e..fb25436326a 100644 --- a/Kernel/UnveilNode.h +++ b/Kernel/UnveilNode.h @@ -50,8 +50,8 @@ struct UnveilMetadata { bool unveil_inherited_from_root { false }; // true if permissions are inherited from the tree root (/). }; -struct UnveilNode final : public AK::Trie, UnveilNode> { - using AK::Trie, UnveilNode>::Trie; +struct UnveilNode final : public Trie, UnveilNode> { + using Trie, UnveilNode>::Trie; bool permissions_inherited_from_root() const { return this->metadata_value().unveil_inherited_from_root; } bool was_explicitly_unveiled() const { return this->metadata_value().explicitly_unveiled; } diff --git a/Meta/Lagom/Fuzzers/FuzzGemini.cpp b/Meta/Lagom/Fuzzers/FuzzGemini.cpp index 0d0a4b29e82..826828d376d 100644 --- a/Meta/Lagom/Fuzzers/FuzzGemini.cpp +++ b/Meta/Lagom/Fuzzers/FuzzGemini.cpp @@ -32,7 +32,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - auto gemini = AK::StringView(static_cast(data), size); + auto gemini = StringView(static_cast(data), size); Gemini::Document::parse(gemini, {}); return 0; } diff --git a/Meta/Lagom/Fuzzers/FuzzJs.cpp b/Meta/Lagom/Fuzzers/FuzzJs.cpp index 57c20e4f8c6..9adf655b478 100644 --- a/Meta/Lagom/Fuzzers/FuzzJs.cpp +++ b/Meta/Lagom/Fuzzers/FuzzJs.cpp @@ -34,7 +34,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - auto js = AK::StringView(static_cast(data), size); + auto js = StringView(static_cast(data), size); auto lexer = JS::Lexer(js); auto parser = JS::Parser(lexer); auto program = parser.parse_program(); diff --git a/Meta/Lagom/Fuzzers/FuzzMarkdown.cpp b/Meta/Lagom/Fuzzers/FuzzMarkdown.cpp index bfeaeb564e4..ea32e617755 100644 --- a/Meta/Lagom/Fuzzers/FuzzMarkdown.cpp +++ b/Meta/Lagom/Fuzzers/FuzzMarkdown.cpp @@ -32,7 +32,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - auto markdown = AK::StringView(static_cast(data), size); + auto markdown = StringView(static_cast(data), size); Markdown::Document::parse(markdown); return 0; } diff --git a/Meta/Lagom/Fuzzers/FuzzRegexECMA262.cpp b/Meta/Lagom/Fuzzers/FuzzRegexECMA262.cpp index fdf7586cf4e..18a96e44ac7 100644 --- a/Meta/Lagom/Fuzzers/FuzzRegexECMA262.cpp +++ b/Meta/Lagom/Fuzzers/FuzzRegexECMA262.cpp @@ -31,7 +31,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - auto pattern = AK::StringView(static_cast(data), size); + auto pattern = StringView(static_cast(data), size); [[maybe_unused]] auto re = Regex(pattern); return 0; } diff --git a/Meta/Lagom/Fuzzers/FuzzRegexPosixExtended.cpp b/Meta/Lagom/Fuzzers/FuzzRegexPosixExtended.cpp index e41e2162daf..131f99f33db 100644 --- a/Meta/Lagom/Fuzzers/FuzzRegexPosixExtended.cpp +++ b/Meta/Lagom/Fuzzers/FuzzRegexPosixExtended.cpp @@ -31,7 +31,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - auto pattern = AK::StringView(static_cast(data), size); + auto pattern = StringView(static_cast(data), size); [[maybe_unused]] auto re = Regex(pattern); return 0; } diff --git a/Meta/Lagom/Fuzzers/FuzzShell.cpp b/Meta/Lagom/Fuzzers/FuzzShell.cpp index abb02c2f686..d762a63cf1c 100644 --- a/Meta/Lagom/Fuzzers/FuzzShell.cpp +++ b/Meta/Lagom/Fuzzers/FuzzShell.cpp @@ -31,7 +31,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - auto source = AK::StringView(static_cast(data), size); + auto source = StringView(static_cast(data), size); Shell::Parser parser(source); parser.parse(); return 0; diff --git a/Meta/Lagom/Fuzzers/FuzzilliJs.cpp b/Meta/Lagom/Fuzzers/FuzzilliJs.cpp index a23ac722250..399925b5999 100644 --- a/Meta/Lagom/Fuzzers/FuzzilliJs.cpp +++ b/Meta/Lagom/Fuzzers/FuzzilliJs.cpp @@ -232,7 +232,7 @@ int main(int, char**) int result = 0; - auto js = AK::StringView(static_cast(data_buffer.data()), script_size); + auto js = StringView(static_cast(data_buffer.data()), script_size); auto lexer = JS::Lexer(js); auto parser = JS::Parser(lexer); diff --git a/Userland/Applications/DisplaySettings/DisplaySettings.cpp b/Userland/Applications/DisplaySettings/DisplaySettings.cpp index 8db7086f322..ec7ba21b8fe 100644 --- a/Userland/Applications/DisplaySettings/DisplaySettings.cpp +++ b/Userland/Applications/DisplaySettings/DisplaySettings.cpp @@ -101,7 +101,7 @@ void DisplaySettingsWidget::create_frame() m_wallpaper_combo = *find_descendant_of_type_named("wallpaper_combo"); m_wallpaper_combo->set_only_allow_values_from_model(true); - m_wallpaper_combo->set_model(*GUI::ItemListModel::create(m_wallpapers)); + m_wallpaper_combo->set_model(*GUI::ItemListModel::create(m_wallpapers)); m_wallpaper_combo->on_change = [this](auto& text, const GUI::ModelIndex& index) { String path = text; if (path.starts_with("/") && m_monitor_widget->set_wallpaper(path)) { @@ -139,7 +139,7 @@ void DisplaySettingsWidget::create_frame() m_mode_combo = *find_descendant_of_type_named("mode_combo"); m_mode_combo->set_only_allow_values_from_model(true); - m_mode_combo->set_model(*GUI::ItemListModel::create(m_modes)); + m_mode_combo->set_model(*GUI::ItemListModel::create(m_modes)); m_mode_combo->on_change = [this](auto&, const GUI::ModelIndex& index) { m_monitor_widget->set_wallpaper_mode(m_modes.at(index.row())); m_monitor_widget->update(); diff --git a/Userland/Applications/FileManager/DirectoryView.h b/Userland/Applications/FileManager/DirectoryView.h index b4121e01e4a..eb972167f22 100644 --- a/Userland/Applications/FileManager/DirectoryView.h +++ b/Userland/Applications/FileManager/DirectoryView.h @@ -79,7 +79,7 @@ public: void refresh(); - void launch(const AK::URL&, const LauncherHandler&); + void launch(const URL&, const LauncherHandler&); Function on_path_change; Function on_selection_change; diff --git a/Userland/Applications/KeyboardMapper/KeyPositions.h b/Userland/Applications/KeyboardMapper/KeyPositions.h index 3cd9dbaaf7f..85a148abf90 100644 --- a/Userland/Applications/KeyboardMapper/KeyPositions.h +++ b/Userland/Applications/KeyboardMapper/KeyPositions.h @@ -36,7 +36,7 @@ struct KeyPosition { int height; bool enabled; int map_index; - AK::String name; + String name; }; #define KEY_COUNT 63 diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp index e3ef6cd2594..961ba9df5ae 100644 --- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp +++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp @@ -189,7 +189,7 @@ void KeyboardMapperWidget::save_to_file(const StringView& file_name) auto add_array = [&](String name, u32* values) { JsonArray items; for (int i = 0; i < 90; i++) { - AK::StringBuilder sb; + StringBuilder sb; if (values[i]) sb.append_code_point(values[i]); @@ -282,7 +282,7 @@ void KeyboardMapperWidget::set_current_map(const String current_map) if (index == 0) continue; - AK::StringBuilder sb; + StringBuilder sb; sb.append_code_point(map[index]); m_keys.at(k)->set_text(sb.to_string()); diff --git a/Userland/Applications/QuickShow/QSWidget.cpp b/Userland/Applications/QuickShow/QSWidget.cpp index 94dbe858ead..fc515a87f57 100644 --- a/Userland/Applications/QuickShow/QSWidget.cpp +++ b/Userland/Applications/QuickShow/QSWidget.cpp @@ -78,7 +78,7 @@ void QSWidget::navigate(Directions direction) StringBuilder sb; sb.append("/"); sb.join("/", parts); - AK::String current_dir = sb.to_string(); + auto current_dir = sb.to_string(); if (m_files_in_same_dir.is_empty()) { Core::DirIterator iterator(current_dir, Core::DirIterator::Flags::SkipDots); diff --git a/Userland/Demos/WidgetGallery/main.cpp b/Userland/Demos/WidgetGallery/main.cpp index ab4782cdf17..e0c129a21da 100644 --- a/Userland/Demos/WidgetGallery/main.cpp +++ b/Userland/Demos/WidgetGallery/main.cpp @@ -257,7 +257,7 @@ int main(int argc, char** argv) auto& combobox1 = combo_container.add(); combobox1.set_only_allow_values_from_model(true); - combobox1.set_model(*ListViewModel::create(model_items)); + combobox1.set_model(*ListViewModel::create(model_items)); auto& combobox2 = combo_container.add(); combobox2.set_enabled(false); diff --git a/Userland/DevTools/Inspector/RemoteProcess.h b/Userland/DevTools/Inspector/RemoteProcess.h index 427b7183b5f..a655993552c 100644 --- a/Userland/DevTools/Inspector/RemoteProcess.h +++ b/Userland/DevTools/Inspector/RemoteProcess.h @@ -54,10 +54,10 @@ public: Function on_update; private: - void handle_get_all_objects_response(const AK::JsonObject&); - void handle_identify_response(const AK::JsonObject&); + void handle_get_all_objects_response(const JsonObject&); + void handle_identify_response(const JsonObject&); - void send_request(const AK::JsonObject&); + void send_request(const JsonObject&); pid_t m_pid { -1 }; String m_process_name; diff --git a/Userland/DevTools/UserspaceEmulator/Emulator.cpp b/Userland/DevTools/UserspaceEmulator/Emulator.cpp index 732c18f27a1..3cf622c70d3 100644 --- a/Userland/DevTools/UserspaceEmulator/Emulator.cpp +++ b/Userland/DevTools/UserspaceEmulator/Emulator.cpp @@ -87,7 +87,7 @@ Emulator::Emulator(const String& executable_path, const Vector& argument static constexpr FlatPtr userspace_range_ceiling = 0xbe000000; #ifdef UE_ASLR static constexpr FlatPtr page_mask = 0xfffff000u; - size_t random_offset = (AK::get_random() % 32 * MiB) & page_mask; + size_t random_offset = (get_random() % 32 * MiB) & page_mask; FlatPtr base = userspace_range_base + random_offset; #else FlatPtr base = userspace_range_base; diff --git a/Userland/DevTools/UserspaceEmulator/RangeAllocator.cpp b/Userland/DevTools/UserspaceEmulator/RangeAllocator.cpp index 78135d923be..8d6bdef488a 100644 --- a/Userland/DevTools/UserspaceEmulator/RangeAllocator.cpp +++ b/Userland/DevTools/UserspaceEmulator/RangeAllocator.cpp @@ -81,7 +81,7 @@ Optional RangeAllocator::allocate_randomized(size_t size, size_t alignmen // FIXME: I'm sure there's a smarter way to do this. static constexpr size_t maximum_randomization_attempts = 1000; for (size_t i = 0; i < maximum_randomization_attempts; ++i) { - VirtualAddress random_address { AK::get_random() }; + VirtualAddress random_address { get_random() }; random_address.mask(PAGE_MASK); if (!m_total_range.contains(random_address, size)) diff --git a/Userland/Libraries/LibChess/Chess.h b/Userland/Libraries/LibChess/Chess.h index 798a6cc7161..b35cd2d8d78 100644 --- a/Userland/Libraries/LibChess/Chess.h +++ b/Userland/Libraries/LibChess/Chess.h @@ -194,7 +194,7 @@ private: HashMap m_previous_states; Vector m_moves; - friend struct AK::Traits; + friend struct Traits; }; template diff --git a/Userland/Libraries/LibCompress/Deflate.cpp b/Userland/Libraries/LibCompress/Deflate.cpp index f1749868bc9..54f7911ec38 100644 --- a/Userland/Libraries/LibCompress/Deflate.cpp +++ b/Userland/Libraries/LibCompress/Deflate.cpp @@ -114,7 +114,7 @@ u32 CanonicalCode::read_symbol(InputBitStream& stream) const // FIXME: This is very inefficient and could greatly be improved by implementing this // algorithm: https://www.hanshq.net/zip.html#huffdec size_t index; - if (AK::binary_search(m_symbol_codes.span(), code_bits, &index)) + if (binary_search(m_symbol_codes.span(), code_bits, &index)) return m_symbol_values[index]; } } diff --git a/Userland/Libraries/LibCore/Account.cpp b/Userland/Libraries/LibCore/Account.cpp index 2b2e5d28c09..efe01200338 100644 --- a/Userland/Libraries/LibCore/Account.cpp +++ b/Userland/Libraries/LibCore/Account.cpp @@ -41,7 +41,7 @@ namespace Core { static String get_salt() { char random_data[12]; - AK::fill_with_random(random_data, sizeof(random_data)); + fill_with_random(random_data, sizeof(random_data)); StringBuilder builder; builder.append("$5$"); diff --git a/Userland/Libraries/LibCore/Object.h b/Userland/Libraries/LibCore/Object.h index 9270d347d0b..d5dcefd01f1 100644 --- a/Userland/Libraries/LibCore/Object.h +++ b/Userland/Libraries/LibCore/Object.h @@ -117,7 +117,7 @@ public: void deferred_invoke(Function); - void save_to(AK::JsonObject&); + void save_to(JsonObject&); bool set_property(const StringView& name, const JsonValue& value); JsonValue property(const StringView& name) const; diff --git a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h index b2ff1dd118a..753a27c47c1 100644 --- a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h +++ b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h @@ -64,7 +64,7 @@ public: return { UnsignedBigInteger::create_invalid(), false }; } - static SignedBigInteger import_data(const AK::StringView& data) { return import_data((const u8*)data.characters_without_null_termination(), data.length()); } + static SignedBigInteger import_data(const StringView& data) { return import_data((const u8*)data.characters_without_null_termination(), data.length()); } static SignedBigInteger import_data(const u8* ptr, size_t length); size_t export_data(Bytes, bool remove_leading_zeros = false) const; diff --git a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h index 07d2ca48485..becae66749d 100644 --- a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h +++ b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h @@ -42,7 +42,7 @@ class UnsignedBigInteger { public: UnsignedBigInteger(u32 x) { m_words.append(x); } - explicit UnsignedBigInteger(AK::Vector&& words) + explicit UnsignedBigInteger(Vector&& words) : m_words(move(words)) { } @@ -53,7 +53,7 @@ public: static UnsignedBigInteger create_invalid(); - static UnsignedBigInteger import_data(const AK::StringView& data) { return import_data((const u8*)data.characters_without_null_termination(), data.length()); } + static UnsignedBigInteger import_data(const StringView& data) { return import_data((const u8*)data.characters_without_null_termination(), data.length()); } static UnsignedBigInteger import_data(const u8* ptr, size_t length) { return UnsignedBigInteger(ptr, length); @@ -64,7 +64,7 @@ public: static UnsignedBigInteger from_base10(const String& str); String to_base10() const; - const AK::Vector& words() const { return m_words; } + const Vector& words() const { return m_words; } void set_to_0(); void set_to(u32 other); @@ -116,7 +116,7 @@ private: static constexpr size_t BITS_IN_WORD = 32; // Little endian // m_word[0] + m_word[1] * 256 + m_word[2] * 65536 + ... - AK::Vector m_words; + Vector m_words; // Used to indicate a negative result, or a result of an invalid operation bool m_is_invalid { false }; diff --git a/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp b/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp index fd54602ae43..4125916a845 100644 --- a/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp +++ b/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp @@ -291,7 +291,7 @@ UnsignedBigInteger random_number(const UnsignedBigInteger& min, const UnsignedBi // Also, if we're about to crash anyway, at least produce a nice error: VERIFY(size < 8 * MiB); u8 buf[size]; - AK::fill_with_random(buf, size); + fill_with_random(buf, size); UnsignedBigInteger random { buf, size }; // At this point, `random` is a large number, in the range [0, 256^size). // To get down to the actual range, we could just compute random % range. diff --git a/Userland/Libraries/LibCrypto/PK/Code/EMSA_PSS.h b/Userland/Libraries/LibCrypto/PK/Code/EMSA_PSS.h index 95e6e58008d..3812e000f95 100644 --- a/Userland/Libraries/LibCrypto/PK/Code/EMSA_PSS.h +++ b/Userland/Libraries/LibCrypto/PK/Code/EMSA_PSS.h @@ -57,7 +57,7 @@ public: auto em_length = (em_bits + 7) / 8; u8 salt[SaltLength]; - AK::fill_with_random(salt, SaltLength); + fill_with_random(salt, SaltLength); if (em_length < hash_length + SaltLength + 2) { dbgln("Ooops...encoding error"); diff --git a/Userland/Libraries/LibCrypto/PK/RSA.cpp b/Userland/Libraries/LibCrypto/PK/RSA.cpp index b4b90c187bf..2a5b7960b47 100644 --- a/Userland/Libraries/LibCrypto/PK/RSA.cpp +++ b/Userland/Libraries/LibCrypto/PK/RSA.cpp @@ -358,12 +358,12 @@ void RSA_PKCS1_EME::encrypt(ReadonlyBytes in, Bytes& out) // FIXME: Without this assertion, GCC refuses to compile due to a memcpy overflow(!?) VERIFY(ps_length < 16384); - AK::fill_with_random(ps, ps_length); + fill_with_random(ps, ps_length); // since arc4random can create zeros (shocking!) // we have to go through and un-zero the zeros for (size_t i = 0; i < ps_length; ++i) while (!ps[i]) - AK::fill_with_random(ps + i, 1); + fill_with_random(ps + i, 1); u8 paddings[] { 0x00, 0x02 }; diff --git a/Userland/Libraries/LibGUI/AbstractTableView.cpp b/Userland/Libraries/LibGUI/AbstractTableView.cpp index 06597c90b76..c0b8b2a6d38 100644 --- a/Userland/Libraries/LibGUI/AbstractTableView.cpp +++ b/Userland/Libraries/LibGUI/AbstractTableView.cpp @@ -350,7 +350,7 @@ void AbstractTableView::layout_headers() int x = frame_thickness() + row_header_width - horizontal_scrollbar().value(); int y = frame_thickness(); - int width = AK::max(content_width(), rect().width() - frame_thickness() * 2 - row_header_width - vertical_scrollbar_width); + int width = max(content_width(), rect().width() - frame_thickness() * 2 - row_header_width - vertical_scrollbar_width); column_header().set_relative_rect(x, y, width, column_header().min_size().height()); } @@ -361,7 +361,7 @@ void AbstractTableView::layout_headers() int x = frame_thickness(); int y = frame_thickness() + column_header_height - vertical_scrollbar().value(); - int height = AK::max(content_height(), rect().height() - frame_thickness() * 2 - column_header_height - horizontal_scrollbar_height); + int height = max(content_height(), rect().height() - frame_thickness() * 2 - column_header_height - horizontal_scrollbar_height); row_header().set_relative_rect(x, y, row_header().min_size().width(), height); } diff --git a/Userland/Libraries/LibGUI/InputBox.cpp b/Userland/Libraries/LibGUI/InputBox.cpp index a50fd75aa21..0bde51a998f 100644 --- a/Userland/Libraries/LibGUI/InputBox.cpp +++ b/Userland/Libraries/LibGUI/InputBox.cpp @@ -64,7 +64,7 @@ void InputBox::build() int text_width = widget.font().width(m_prompt); int title_width = widget.font().width(title()) + 24 /* icon, plus a little padding -- not perfect */; - int max_width = AK::max(text_width, title_width); + int max_width = max(text_width, title_width); set_rect(x(), y(), max_width + 140, 62); diff --git a/Userland/Libraries/LibGUI/Variant.cpp b/Userland/Libraries/LibGUI/Variant.cpp index 44a52d46d4f..211f4b996d2 100644 --- a/Userland/Libraries/LibGUI/Variant.cpp +++ b/Userland/Libraries/LibGUI/Variant.cpp @@ -257,7 +257,7 @@ Variant& Variant::operator=(Variant&& other) if (&other == this) return *this; clear(); - move_from(AK::move(other)); + move_from(move(other)); return *this; } diff --git a/Userland/Libraries/LibGUI/Variant.h b/Userland/Libraries/LibGUI/Variant.h index 90f747f8e52..18dd2605f1d 100644 --- a/Userland/Libraries/LibGUI/Variant.h +++ b/Userland/Libraries/LibGUI/Variant.h @@ -51,7 +51,7 @@ public: Variant(const Gfx::IntRect&); Variant(const Gfx::Font&); Variant(const Gfx::TextAlignment); - Variant(const AK::JsonValue&); + Variant(const JsonValue&); Variant(Color); Variant(const Variant&); diff --git a/Userland/Libraries/LibGUI/WindowServerConnection.cpp b/Userland/Libraries/LibGUI/WindowServerConnection.cpp index 2d33b91dd13..aa819cc8506 100644 --- a/Userland/Libraries/LibGUI/WindowServerConnection.cpp +++ b/Userland/Libraries/LibGUI/WindowServerConnection.cpp @@ -178,7 +178,7 @@ void WindowServerConnection::handle(const Messages::WindowClient::KeyDown& messa key_event->m_key = Key_Invalid; key_event->m_modifiers = 0; - AK::Utf8View m_utf8_view(emoji_input_dialog->selected_emoji_text().characters()); + Utf8View m_utf8_view(emoji_input_dialog->selected_emoji_text().characters()); u32 code_point = *m_utf8_view.begin(); key_event->m_code_point = code_point; diff --git a/Userland/Libraries/LibGfx/PGMLoader.cpp b/Userland/Libraries/LibGfx/PGMLoader.cpp index 5cd2b7bed30..5e58c9f222f 100644 --- a/Userland/Libraries/LibGfx/PGMLoader.cpp +++ b/Userland/Libraries/LibGfx/PGMLoader.cpp @@ -67,7 +67,7 @@ struct PGMLoadingContext { RefPtr bitmap; }; -static void set_adjusted_pixels(PGMLoadingContext& context, const AK::Vector& color_data) +static void set_adjusted_pixels(PGMLoadingContext& context, const Vector& color_data) { size_t index = 0; for (size_t y = 0; y < context.height; ++y) { diff --git a/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h b/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h index eaf9ffc632d..67afa508c86 100644 --- a/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h +++ b/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h @@ -207,7 +207,7 @@ static bool create_bitmap(TContext& context) } template -static void set_pixels(TContext& context, const AK::Vector& color_data) +static void set_pixels(TContext& context, const Vector& color_data) { size_t index = 0; for (size_t y = 0; y < context.height; ++y) { diff --git a/Userland/Libraries/LibGfx/Streamer.h b/Userland/Libraries/LibGfx/Streamer.h index 475726585b6..7be0e885cb3 100644 --- a/Userland/Libraries/LibGfx/Streamer.h +++ b/Userland/Libraries/LibGfx/Streamer.h @@ -44,7 +44,7 @@ public: template constexpr bool read(T& value) { - AK::Array network_buffer {}; + Array network_buffer {}; auto network_value = new (network_buffer.data()) AK::NetworkOrdered {}; auto res = read_bytes(network_buffer.data(), sizeof(T)); value = T(*network_value); diff --git a/Userland/Libraries/LibJS/Runtime/MarkedValueList.cpp b/Userland/Libraries/LibJS/Runtime/MarkedValueList.cpp index f268a21c6b0..6e6cf3d639e 100644 --- a/Userland/Libraries/LibJS/Runtime/MarkedValueList.cpp +++ b/Userland/Libraries/LibJS/Runtime/MarkedValueList.cpp @@ -36,7 +36,7 @@ MarkedValueList::MarkedValueList(Heap& heap) } MarkedValueList::MarkedValueList(MarkedValueList&& other) - : AK::Vector(move(static_cast&>(other))) + : Vector(move(static_cast&>(other))) , m_heap(other.m_heap) { m_heap.did_create_marked_value_list({}, *this); diff --git a/Userland/Libraries/LibJS/Runtime/MarkedValueList.h b/Userland/Libraries/LibJS/Runtime/MarkedValueList.h index e311972181e..b549b99110f 100644 --- a/Userland/Libraries/LibJS/Runtime/MarkedValueList.h +++ b/Userland/Libraries/LibJS/Runtime/MarkedValueList.h @@ -33,7 +33,7 @@ namespace JS { -class MarkedValueList : public AK::Vector { +class MarkedValueList : public Vector { AK_MAKE_NONCOPYABLE(MarkedValueList); public: @@ -55,4 +55,5 @@ public: private: Heap& m_heap; }; + } diff --git a/Userland/Libraries/LibTLS/ClientHandshake.cpp b/Userland/Libraries/LibTLS/ClientHandshake.cpp index 60512918809..5ee2c447f44 100644 --- a/Userland/Libraries/LibTLS/ClientHandshake.cpp +++ b/Userland/Libraries/LibTLS/ClientHandshake.cpp @@ -251,12 +251,12 @@ void TLSv12::build_random(PacketBuilder& builder) u8 random_bytes[48]; size_t bytes = 48; - AK::fill_with_random(random_bytes, bytes); + fill_with_random(random_bytes, bytes); // remove zeros from the random bytes for (size_t i = 0; i < bytes; ++i) { if (!random_bytes[i]) - random_bytes[i--] = AK::get_random(); + random_bytes[i--] = get_random(); } if (m_context.is_server) { diff --git a/Userland/Libraries/LibTLS/Handshake.cpp b/Userland/Libraries/LibTLS/Handshake.cpp index 88395b4e27f..f3eccd714e7 100644 --- a/Userland/Libraries/LibTLS/Handshake.cpp +++ b/Userland/Libraries/LibTLS/Handshake.cpp @@ -33,7 +33,7 @@ namespace TLS { ByteBuffer TLSv12::build_hello() { - AK::fill_with_random(&m_context.local_random, 32); + fill_with_random(&m_context.local_random, 32); auto packet_version = (u16)m_context.version; auto version = (u16)m_context.version; diff --git a/Userland/Libraries/LibTLS/Record.cpp b/Userland/Libraries/LibTLS/Record.cpp index f9822dc377f..3b0eefcf714 100644 --- a/Userland/Libraries/LibTLS/Record.cpp +++ b/Userland/Libraries/LibTLS/Record.cpp @@ -127,7 +127,7 @@ void TLSv12::update_packet(ByteBuffer& packet) u8 iv[16]; Bytes iv_bytes { iv, 16 }; Bytes { m_context.crypto.local_aead_iv, 4 }.copy_to(iv_bytes); - AK::fill_with_random(iv_bytes.offset(4), 8); + fill_with_random(iv_bytes.offset(4), 8); memset(iv_bytes.offset(12), 0, 4); // write the random part of the iv out @@ -164,7 +164,7 @@ void TLSv12::update_packet(ByteBuffer& packet) VERIFY(buffer_position == buffer.size()); auto iv = ByteBuffer::create_uninitialized(iv_size); - AK::fill_with_random(iv.data(), iv.size()); + fill_with_random(iv.data(), iv.size()); // write it into the ciphertext portion of the message ct.overwrite(header_size, iv.data(), iv.size()); diff --git a/Userland/Libraries/LibTTF/Font.h b/Userland/Libraries/LibTTF/Font.h index a14bc214122..19e619261af 100644 --- a/Userland/Libraries/LibTTF/Font.h +++ b/Userland/Libraries/LibTTF/Font.h @@ -168,7 +168,7 @@ private: float m_y_scale { 0.0f }; float m_point_width { 0.0f }; float m_point_height { 0.0f }; - mutable AK::HashMap> m_cached_glyph_bitmaps; + mutable HashMap> m_cached_glyph_bitmaps; }; } diff --git a/Userland/Libraries/LibTTF/Glyf.h b/Userland/Libraries/LibTTF/Glyf.h index 2568001afdc..fec48d26c36 100644 --- a/Userland/Libraries/LibTTF/Glyf.h +++ b/Userland/Libraries/LibTTF/Glyf.h @@ -45,7 +45,7 @@ private: void draw_line(Gfx::FloatPoint, Gfx::FloatPoint); Gfx::IntSize m_size; - AK::Vector m_data; + Vector m_data; }; class Loca { diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h index e0c84271c45..8063b221a74 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h @@ -171,8 +171,8 @@ private: StringView m_input; Utf8View m_utf8_view; - AK::Utf8CodepointIterator m_utf8_iterator; - AK::Utf8CodepointIterator m_prev_utf8_iterator; + Utf8CodepointIterator m_utf8_iterator; + Utf8CodepointIterator m_prev_utf8_iterator; HTMLToken m_current_token; diff --git a/Userland/Services/DHCPClient/DHCPv4.h b/Userland/Services/DHCPClient/DHCPv4.h index 23ffb446a6d..530ac7e7584 100644 --- a/Userland/Services/DHCPClient/DHCPv4.h +++ b/Userland/Services/DHCPClient/DHCPv4.h @@ -127,7 +127,7 @@ enum class DHCPMessageType : u8 { }; template<> -struct AK::Traits : public AK::GenericTraits { +struct AK::Traits : public GenericTraits { static constexpr bool is_trivial() { return true; } static unsigned hash(DHCPOption u) { return int_hash((u8)u); } }; diff --git a/Userland/Services/ProtocolServer/HttpProtocol.cpp b/Userland/Services/ProtocolServer/HttpProtocol.cpp index 57df8be5db6..f4e9658b510 100644 --- a/Userland/Services/ProtocolServer/HttpProtocol.cpp +++ b/Userland/Services/ProtocolServer/HttpProtocol.cpp @@ -46,7 +46,7 @@ HttpProtocol::HttpProtocol() OwnPtr HttpProtocol::start_download(ClientConnection& client, const String& method, const URL& url, const HashMap& headers, ReadonlyBytes body) { - return Detail::start_download(AK::Badge {}, client, method, url, headers, body, get_pipe_for_download()); + return Detail::start_download(Badge {}, client, method, url, headers, body, get_pipe_for_download()); } } diff --git a/Userland/Services/ProtocolServer/HttpsProtocol.cpp b/Userland/Services/ProtocolServer/HttpsProtocol.cpp index 79252daa4fb..8abf1f06981 100644 --- a/Userland/Services/ProtocolServer/HttpsProtocol.cpp +++ b/Userland/Services/ProtocolServer/HttpsProtocol.cpp @@ -46,7 +46,7 @@ HttpsProtocol::HttpsProtocol() OwnPtr HttpsProtocol::start_download(ClientConnection& client, const String& method, const URL& url, const HashMap& headers, ReadonlyBytes body) { - return Detail::start_download(AK::Badge {}, client, method, url, headers, body, get_pipe_for_download()); + return Detail::start_download(Badge {}, client, method, url, headers, body, get_pipe_for_download()); } } diff --git a/Userland/Services/SystemServer/Service.h b/Userland/Services/SystemServer/Service.h index 23014825cf1..f4a4796ad8b 100644 --- a/Userland/Services/SystemServer/Service.h +++ b/Userland/Services/SystemServer/Service.h @@ -44,7 +44,7 @@ public: static Service* find_by_pid(pid_t); // FIXME: Port to Core::Property - void save_to(AK::JsonObject&); + void save_to(JsonObject&); private: Service(const Core::ConfigFile&, const StringView& name); diff --git a/Userland/Shell/Parser.cpp b/Userland/Shell/Parser.cpp index 9b054fee4a8..2cef5bb3c50 100644 --- a/Userland/Shell/Parser.cpp +++ b/Userland/Shell/Parser.cpp @@ -1417,7 +1417,7 @@ RefPtr Parser::parse_history_designator() ++it; is_negative = true; } - if (it != selector.event.text.end() && AK::all_of(it, selector.event.text.end(), is_digit)) { + if (it != selector.event.text.end() && all_of(it, selector.event.text.end(), is_digit)) { if (is_negative) selector.event.kind = AST::HistorySelector::EventKind::IndexFromEnd; else diff --git a/Userland/Tests/LibC/snprintf-correctness.cpp b/Userland/Tests/LibC/snprintf-correctness.cpp index 71ec7028bfd..5f895a62d72 100644 --- a/Userland/Tests/LibC/snprintf-correctness.cpp +++ b/Userland/Tests/LibC/snprintf-correctness.cpp @@ -74,7 +74,7 @@ static bool test_single(const Testcase& testcase) // Setup ByteBuffer actual = ByteBuffer::create_uninitialized(SANDBOX_CANARY_SIZE + testcase.dest_n + SANDBOX_CANARY_SIZE); - AK::fill_with_random(actual.data(), actual.size()); + fill_with_random(actual.data(), actual.size()); ByteBuffer expected = actual.isolated_copy(); VERIFY(actual.offset_pointer(0) != expected.offset_pointer(0)); actual.overwrite(SANDBOX_CANARY_SIZE, testcase.dest, testcase.dest_n); diff --git a/Userland/Tests/LibC/strlcpy-correctness.cpp b/Userland/Tests/LibC/strlcpy-correctness.cpp index adf56ff09d9..5e248ae60df 100644 --- a/Userland/Tests/LibC/strlcpy-correctness.cpp +++ b/Userland/Tests/LibC/strlcpy-correctness.cpp @@ -76,7 +76,7 @@ static bool test_single(const Testcase& testcase) // Setup ByteBuffer actual = ByteBuffer::create_uninitialized(SANDBOX_CANARY_SIZE + testcase.dest_n + SANDBOX_CANARY_SIZE); - AK::fill_with_random(actual.data(), actual.size()); + fill_with_random(actual.data(), actual.size()); ByteBuffer expected = actual.isolated_copy(); VERIFY(actual.offset_pointer(0) != expected.offset_pointer(0)); actual.overwrite(SANDBOX_CANARY_SIZE, testcase.dest, testcase.dest_n); diff --git a/Userland/Utilities/cut.cpp b/Userland/Utilities/cut.cpp index f3eee67e1cb..5b4f8ce05df 100644 --- a/Userland/Utilities/cut.cpp +++ b/Userland/Utilities/cut.cpp @@ -63,8 +63,8 @@ static void add_if_not_exists(Vector& indexes, Index data) for (auto& index : indexes) { if (index.intersects(data)) { if (index.m_type == Index::Type::RangedIndex) { - index.m_from = AK::min(index.m_from, data.m_from); - index.m_to = AK::max(index.m_to, data.m_to); + index.m_from = min(index.m_from, data.m_from); + index.m_to = max(index.m_to, data.m_to); } append_to_vector = false; } diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index b2ee3ae9efb..2601ccf5c4b 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -406,14 +406,14 @@ static void print(JS::Value value) outln(); } -static bool file_has_shebang(AK::ByteBuffer file_contents) +static bool file_has_shebang(ByteBuffer file_contents) { if (file_contents.size() >= 2 && file_contents[0] == '#' && file_contents[1] == '!') return true; return false; } -static StringView strip_shebang(AK::ByteBuffer file_contents) +static StringView strip_shebang(ByteBuffer file_contents) { size_t i = 0; for (i = 2; i < file_contents.size(); ++i) { diff --git a/Userland/Utilities/lspci.cpp b/Userland/Utilities/lspci.cpp index 388e59b55c3..1055935c2e2 100644 --- a/Userland/Utilities/lspci.cpp +++ b/Userland/Utilities/lspci.cpp @@ -64,7 +64,7 @@ int main(int argc, char** argv) const char* format = flag_show_numerical ? format_numerical : format_textual; - AK::RefPtr db; + RefPtr db; if (!flag_show_numerical) { db = PCIDB::Database::open(); if (!db) { diff --git a/Userland/Utilities/test-bindtodevice.cpp b/Userland/Utilities/test-bindtodevice.cpp index 8213e5c0ce8..d96d1e6b29e 100644 --- a/Userland/Utilities/test-bindtodevice.cpp +++ b/Userland/Utilities/test-bindtodevice.cpp @@ -38,7 +38,7 @@ static void test_no_route(int); static void test_valid(int); static void test_send(int); -static void test(AK::Function test_fn) +static void test(Function test_fn) { int fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); diff --git a/Userland/Utilities/test-crypto.cpp b/Userland/Utilities/test-crypto.cpp index 940d1eba0e3..3f8089d6945 100644 --- a/Userland/Utilities/test-crypto.cpp +++ b/Userland/Utilities/test-crypto.cpp @@ -2217,7 +2217,7 @@ static void bigint_test_fibo500() { { I_TEST((BigInteger | Fibonacci500)); - bool pass = (bigint_fibonacci(500).words() == AK::Vector { 315178285, 505575602, 1883328078, 125027121, 3649625763, 347570207, 74535262, 3832543808, 2472133297, 1600064941, 65273441 }); + bool pass = (bigint_fibonacci(500).words() == Vector { 315178285, 505575602, 1883328078, 125027121, 3649625763, 347570207, 74535262, 3832543808, 2472133297, 1600064941, 65273441 }); if (pass) { PASS; @@ -2428,7 +2428,7 @@ static void bigint_import_export() I_TEST((BigInteger | BigEndian Decode / Encode roundtrip)); u8 random_bytes[128]; u8 target_buffer[128]; - AK::fill_with_random(random_bytes, 128); + fill_with_random(random_bytes, 128); auto encoded = Crypto::UnsignedBigInteger::import_data(random_bytes, 128); encoded.export_data({ target_buffer, 128 }); if (memcmp(target_buffer, random_bytes, 128) != 0) @@ -2540,7 +2540,7 @@ static void bigint_test_signed_fibo500() { { I_TEST((Signed BigInteger | Fibonacci500)); - bool pass = (bigint_signed_fibonacci(500).unsigned_value().words() == AK::Vector { 315178285, 505575602, 1883328078, 125027121, 3649625763, 347570207, 74535262, 3832543808, 2472133297, 1600064941, 65273441 }); + bool pass = (bigint_signed_fibonacci(500).unsigned_value().words() == Vector { 315178285, 505575602, 1883328078, 125027121, 3649625763, 347570207, 74535262, 3832543808, 2472133297, 1600064941, 65273441 }); if (pass) { PASS; @@ -2745,7 +2745,7 @@ static void bigint_signed_import_export() u8 random_bytes[129]; u8 target_buffer[129]; random_bytes[0] = 1; - AK::fill_with_random(random_bytes + 1, 128); + fill_with_random(random_bytes + 1, 128); auto encoded = Crypto::SignedBigInteger::import_data(random_bytes, 129); encoded.export_data({ target_buffer, 129 }); if (memcmp(target_buffer, random_bytes, 129) != 0) diff --git a/Userland/Utilities/tree.cpp b/Userland/Utilities/tree.cpp index 7212a56fc22..6fdb2bd9f00 100644 --- a/Userland/Utilities/tree.cpp +++ b/Userland/Utilities/tree.cpp @@ -54,7 +54,7 @@ static void print_directory_tree(const String& root_path, int depth, const Strin out("{}|-- ", root_indent_string); } - String root_dir_name = AK::LexicalPath(root_path).basename(); + String root_dir_name = LexicalPath(root_path).basename(); out("\033[34;1m{}\033[0m\n", root_dir_name); if (depth >= max_depth) { diff --git a/Userland/Utilities/uniq.cpp b/Userland/Utilities/uniq.cpp index 0034c1cb62e..7ace26d21cf 100644 --- a/Userland/Utilities/uniq.cpp +++ b/Userland/Utilities/uniq.cpp @@ -89,7 +89,7 @@ int main(int argc, char** argv) continue; fputs(current->buf, outfile); - AK::swap(current, previous); + swap(current, previous); first_run = false; }