summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-02-25 21:10:47 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-26 16:59:56 +0100
commite265054c12a4fb596b26789e18f342711cf3ef95 (patch)
tree6539a9026bea3294693a9ae932b3528b3761d695 /Userland/Libraries
parentbe9df404fd180e1b3cab0c1bddce1f589de8e9f0 (diff)
downloadserenity-e265054c12a4fb596b26789e18f342711cf3ef95.zip
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. :^)
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibChess/Chess.h2
-rw-r--r--Userland/Libraries/LibCompress/Deflate.cpp2
-rw-r--r--Userland/Libraries/LibCore/Account.cpp2
-rw-r--r--Userland/Libraries/LibCore/Object.h2
-rw-r--r--Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h2
-rw-r--r--Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h8
-rw-r--r--Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp2
-rw-r--r--Userland/Libraries/LibCrypto/PK/Code/EMSA_PSS.h2
-rw-r--r--Userland/Libraries/LibCrypto/PK/RSA.cpp4
-rw-r--r--Userland/Libraries/LibGUI/AbstractTableView.cpp4
-rw-r--r--Userland/Libraries/LibGUI/InputBox.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Variant.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Variant.h2
-rw-r--r--Userland/Libraries/LibGUI/WindowServerConnection.cpp2
-rw-r--r--Userland/Libraries/LibGfx/PGMLoader.cpp2
-rw-r--r--Userland/Libraries/LibGfx/PortableImageLoaderCommon.h2
-rw-r--r--Userland/Libraries/LibGfx/Streamer.h2
-rw-r--r--Userland/Libraries/LibJS/Runtime/MarkedValueList.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/MarkedValueList.h3
-rw-r--r--Userland/Libraries/LibTLS/ClientHandshake.cpp4
-rw-r--r--Userland/Libraries/LibTLS/Handshake.cpp2
-rw-r--r--Userland/Libraries/LibTLS/Record.cpp4
-rw-r--r--Userland/Libraries/LibTTF/Font.h2
-rw-r--r--Userland/Libraries/LibTTF/Glyf.h2
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h4
25 files changed, 34 insertions, 33 deletions
diff --git a/Userland/Libraries/LibChess/Chess.h b/Userland/Libraries/LibChess/Chess.h
index 798a6cc716..b35cd2d8d7 100644
--- a/Userland/Libraries/LibChess/Chess.h
+++ b/Userland/Libraries/LibChess/Chess.h
@@ -194,7 +194,7 @@ private:
HashMap<Board, int> m_previous_states;
Vector<Move> m_moves;
- friend struct AK::Traits<Board>;
+ friend struct Traits<Board>;
};
template<typename Callback>
diff --git a/Userland/Libraries/LibCompress/Deflate.cpp b/Userland/Libraries/LibCompress/Deflate.cpp
index f1749868bc..54f7911ec3 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 2b2e5d28c0..efe0120033 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 9270d347d0..d5dcefd01f 100644
--- a/Userland/Libraries/LibCore/Object.h
+++ b/Userland/Libraries/LibCore/Object.h
@@ -117,7 +117,7 @@ public:
void deferred_invoke(Function<void(Object&)>);
- 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 b2ff1dd118..753a27c47c 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 07d2ca4848..becae66749 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<u32, STARTING_WORD_SIZE>&& words)
+ explicit UnsignedBigInteger(Vector<u32, STARTING_WORD_SIZE>&& 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<u32, STARTING_WORD_SIZE>& words() const { return m_words; }
+ const Vector<u32, STARTING_WORD_SIZE>& 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<u32, STARTING_WORD_SIZE> m_words;
+ Vector<u32, STARTING_WORD_SIZE> 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 fd54602ae4..4125916a84 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 95e6e58008..3812e000f9 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 b4b90c187b..2a5b7960b4 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 06597c90b7..c0b8b2a6d3 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 a50fd75aa2..0bde51a998 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 44a52d46d4..211f4b996d 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 90f747f8e5..18dd2605f1 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 2d33b91dd1..aa819cc850 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 5cd2b7bed3..5e58c9f222 100644
--- a/Userland/Libraries/LibGfx/PGMLoader.cpp
+++ b/Userland/Libraries/LibGfx/PGMLoader.cpp
@@ -67,7 +67,7 @@ struct PGMLoadingContext {
RefPtr<Gfx::Bitmap> bitmap;
};
-static void set_adjusted_pixels(PGMLoadingContext& context, const AK::Vector<Gfx::Color>& color_data)
+static void set_adjusted_pixels(PGMLoadingContext& context, const Vector<Gfx::Color>& 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 eaf9ffc632..67afa508c8 100644
--- a/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h
+++ b/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h
@@ -207,7 +207,7 @@ static bool create_bitmap(TContext& context)
}
template<typename TContext>
-static void set_pixels(TContext& context, const AK::Vector<Gfx::Color>& color_data)
+static void set_pixels(TContext& context, const Vector<Gfx::Color>& 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 475726585b..7be0e885cb 100644
--- a/Userland/Libraries/LibGfx/Streamer.h
+++ b/Userland/Libraries/LibGfx/Streamer.h
@@ -44,7 +44,7 @@ public:
template<typename T>
constexpr bool read(T& value)
{
- AK::Array<u8, sizeof(T)> network_buffer {};
+ Array<u8, sizeof(T)> network_buffer {};
auto network_value = new (network_buffer.data()) AK::NetworkOrdered<T> {};
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 f268a21c6b..6e6cf3d639 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<Value, 32>(move(static_cast<Vector<Value, 32>&>(other)))
+ : Vector<Value, 32>(move(static_cast<Vector<Value, 32>&>(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 e311972181..b549b99110 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<Value, 32> {
+class MarkedValueList : public Vector<Value, 32> {
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 6051291880..5ee2c447f4 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<u8>();
+ random_bytes[i--] = get_random<u8>();
}
if (m_context.is_server) {
diff --git a/Userland/Libraries/LibTLS/Handshake.cpp b/Userland/Libraries/LibTLS/Handshake.cpp
index 88395b4e27..f3eccd714e 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 f9822dc377..3b0eefcf71 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 a14bc21412..19e619261a 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<u32, RefPtr<Gfx::Bitmap>> m_cached_glyph_bitmaps;
+ mutable HashMap<u32, RefPtr<Gfx::Bitmap>> m_cached_glyph_bitmaps;
};
}
diff --git a/Userland/Libraries/LibTTF/Glyf.h b/Userland/Libraries/LibTTF/Glyf.h
index 2568001afd..fec48d26c3 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<float> m_data;
+ Vector<float> m_data;
};
class Loca {
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.h
index e0c84271c4..8063b221a7 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;