diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-11-10 15:43:23 +0000 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2022-11-11 17:50:53 +0330 |
commit | c33eae24f928bb4042aa027675cd98f5a6d6149a (patch) | |
tree | 81636f91983f61f027009237e2a3ea93abaf38ac /Userland/Libraries | |
parent | 24c0a6e9a431ada9d7fd290cde4d7f999c4a696a (diff) | |
download | serenity-c33eae24f928bb4042aa027675cd98f5a6d6149a.zip |
AK+Everywhere: Replace DistinctNumeric bool parameters with named ones
This means that rather than this:
```
AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, true, true, false, false,
false, true, FunctionAddress);
```
We now have this:
```
AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, FunctionAddress, Arithmetic,
Comparison, Increment);
```
Which is a lot more readable. :^)
Co-authored-by: Ali Mohammad Pur <mpfard@serenityos.org>
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibJS/Bytecode/IdentifierTable.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Bytecode/StringTable.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h | 14 | ||||
-rw-r--r-- | Userland/Libraries/LibWasm/Types.h | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/IdentifierTable.h b/Userland/Libraries/LibJS/Bytecode/IdentifierTable.h index 42ec055476..ca9dfe4987 100644 --- a/Userland/Libraries/LibJS/Bytecode/IdentifierTable.h +++ b/Userland/Libraries/LibJS/Bytecode/IdentifierTable.h @@ -12,7 +12,7 @@ namespace JS::Bytecode { -AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(size_t, false, true, false, false, false, false, IdentifierTableIndex); +AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(size_t, IdentifierTableIndex, Comparison); class IdentifierTable { AK_MAKE_NONMOVABLE(IdentifierTable); diff --git a/Userland/Libraries/LibJS/Bytecode/StringTable.h b/Userland/Libraries/LibJS/Bytecode/StringTable.h index 67760a36be..2f86e6f9c0 100644 --- a/Userland/Libraries/LibJS/Bytecode/StringTable.h +++ b/Userland/Libraries/LibJS/Bytecode/StringTable.h @@ -12,7 +12,7 @@ namespace JS::Bytecode { -AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(size_t, false, true, false, false, false, false, StringTableIndex); +AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(size_t, StringTableIndex, Comparison); class StringTable { AK_MAKE_NONMOVABLE(StringTable); diff --git a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h index 395136b8c6..6bc11c524c 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h +++ b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.h @@ -29,13 +29,13 @@ struct LinkError { Vector<OtherErrors> other_errors; }; -AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, true, true, false, false, false, true, FunctionAddress); -AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, true, true, false, false, false, true, ExternAddress); -AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, true, true, false, false, false, true, TableAddress); -AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, true, true, false, false, false, true, GlobalAddress); -AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, true, true, false, false, false, true, ElementAddress); -AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, true, true, false, false, false, true, DataAddress); -AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, true, true, false, false, false, true, MemoryAddress); +AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, FunctionAddress, Arithmetic, Comparison, Increment); +AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, ExternAddress, Arithmetic, Comparison, Increment); +AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, TableAddress, Arithmetic, Comparison, Increment); +AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, GlobalAddress, Arithmetic, Comparison, Increment); +AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, ElementAddress, Arithmetic, Comparison, Increment); +AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, DataAddress, Arithmetic, Comparison, Increment); +AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, MemoryAddress, Arithmetic, Comparison, Increment); // FIXME: These should probably be made generic/virtual if/when we decide to do something more // fancy than just a dumb interpreter. diff --git a/Userland/Libraries/LibWasm/Types.h b/Userland/Libraries/LibWasm/Types.h index 3725cb0425..0b021740bb 100644 --- a/Userland/Libraries/LibWasm/Types.h +++ b/Userland/Libraries/LibWasm/Types.h @@ -57,7 +57,7 @@ AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, LocalIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, GlobalIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, LabelIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, DataIndex); -AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, true, true, false, true, false, true, InstructionPointer); +AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(u64, InstructionPointer, Arithmetic, Comparison, Flags, Increment); ParseError with_eof_check(InputStream const& stream, ParseError error_if_not_eof); |