diff --git a/AK/DistinctNumeric.h b/AK/DistinctNumeric.h index 825639b37cc..2c41ce47113 100644 --- a/AK/DistinctNumeric.h +++ b/AK/DistinctNumeric.h @@ -286,7 +286,7 @@ struct Formatter> : #define AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(T, Incr, Cmp, Bool, Flags, Shift, Arith, NAME) \ using NAME = DistinctNumeric; -#define TYPEDEF_DISTINCT_ORDERED_ID(T, NAME) AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(T, false, true, true, false, false, false, NAME) +#define AK_TYPEDEF_DISTINCT_ORDERED_ID(T, NAME) AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(T, false, true, true, false, false, false, NAME) // TODO: Further type aliases? template diff --git a/Kernel/Bus/PCI/Controller/HostController.h b/Kernel/Bus/PCI/Controller/HostController.h index 9089fde3e9e..512e08e4463 100644 --- a/Kernel/Bus/PCI/Controller/HostController.h +++ b/Kernel/Bus/PCI/Controller/HostController.h @@ -13,9 +13,9 @@ namespace Kernel::PCI { -TYPEDEF_DISTINCT_ORDERED_ID(u8, BusNumber); -TYPEDEF_DISTINCT_ORDERED_ID(u8, DeviceNumber); -TYPEDEF_DISTINCT_ORDERED_ID(u8, FunctionNumber); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, BusNumber); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, DeviceNumber); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, FunctionNumber); class HostController { public: diff --git a/Kernel/Bus/PCI/Definitions.h b/Kernel/Bus/PCI/Definitions.h index 96b72b6de85..039edc6584e 100644 --- a/Kernel/Bus/PCI/Definitions.h +++ b/Kernel/Bus/PCI/Definitions.h @@ -97,7 +97,8 @@ enum class SubclassID { } -TYPEDEF_DISTINCT_ORDERED_ID(u8, CapabilityID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, CapabilityID); + namespace Capabilities { enum ID { Null = 0x0, @@ -218,14 +219,14 @@ private: const u8 m_ptr; }; -TYPEDEF_DISTINCT_ORDERED_ID(u8, ClassCode); -TYPEDEF_DISTINCT_ORDERED_ID(u8, SubclassCode); -TYPEDEF_DISTINCT_ORDERED_ID(u8, ProgrammingInterface); -TYPEDEF_DISTINCT_ORDERED_ID(u8, RevisionID); -TYPEDEF_DISTINCT_ORDERED_ID(u16, SubsystemID); -TYPEDEF_DISTINCT_ORDERED_ID(u16, SubsystemVendorID); -TYPEDEF_DISTINCT_ORDERED_ID(u8, InterruptLine); -TYPEDEF_DISTINCT_ORDERED_ID(u8, InterruptPin); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, ClassCode); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, SubclassCode); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, ProgrammingInterface); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, RevisionID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u16, SubsystemID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u16, SubsystemVendorID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, InterruptLine); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, InterruptPin); class Access; class DeviceIdentifier { diff --git a/Kernel/FileSystem/BlockBasedFileSystem.h b/Kernel/FileSystem/BlockBasedFileSystem.h index 5a11fbc8cb4..47a25ec8f2f 100644 --- a/Kernel/FileSystem/BlockBasedFileSystem.h +++ b/Kernel/FileSystem/BlockBasedFileSystem.h @@ -13,7 +13,7 @@ namespace Kernel { class BlockBasedFileSystem : public FileBackedFileSystem { public: - TYPEDEF_DISTINCT_ORDERED_ID(u64, BlockIndex); + AK_TYPEDEF_DISTINCT_ORDERED_ID(u64, BlockIndex); virtual ~BlockBasedFileSystem() override; virtual ErrorOr initialize() override; diff --git a/Kernel/FileSystem/DeviceFileTypes.h b/Kernel/FileSystem/DeviceFileTypes.h index 14e13e2a756..5b2a1545579 100644 --- a/Kernel/FileSystem/DeviceFileTypes.h +++ b/Kernel/FileSystem/DeviceFileTypes.h @@ -10,7 +10,7 @@ namespace Kernel { -TYPEDEF_DISTINCT_ORDERED_ID(unsigned, MajorNumber); -TYPEDEF_DISTINCT_ORDERED_ID(unsigned, MinorNumber); +AK_TYPEDEF_DISTINCT_ORDERED_ID(unsigned, MajorNumber); +AK_TYPEDEF_DISTINCT_ORDERED_ID(unsigned, MinorNumber); } diff --git a/Kernel/FileSystem/Ext2FileSystem.h b/Kernel/FileSystem/Ext2FileSystem.h index d407d21b12d..c9ca4569a98 100644 --- a/Kernel/FileSystem/Ext2FileSystem.h +++ b/Kernel/FileSystem/Ext2FileSystem.h @@ -105,7 +105,7 @@ public: FeaturesReadOnly get_features_readonly() const; private: - TYPEDEF_DISTINCT_ORDERED_ID(unsigned, GroupIndex); + AK_TYPEDEF_DISTINCT_ORDERED_ID(unsigned, GroupIndex); explicit Ext2FS(OpenFileDescription&); diff --git a/Kernel/FileSystem/InodeIdentifier.h b/Kernel/FileSystem/InodeIdentifier.h index 2e00f1c8cca..f99a93e3b27 100644 --- a/Kernel/FileSystem/InodeIdentifier.h +++ b/Kernel/FileSystem/InodeIdentifier.h @@ -15,8 +15,8 @@ namespace Kernel { class FileSystem; struct InodeMetadata; -TYPEDEF_DISTINCT_ORDERED_ID(u32, FileSystemID); -TYPEDEF_DISTINCT_ORDERED_ID(u64, InodeIndex); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, FileSystemID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u64, InodeIndex); class InodeIdentifier { public: diff --git a/Kernel/Forward.h b/Kernel/Forward.h index 2362940352d..a82e12963ca 100644 --- a/Kernel/Forward.h +++ b/Kernel/Forward.h @@ -92,12 +92,12 @@ class SpinlockLocker; struct InodeMetadata; struct TrapFrame; -TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessID); -TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ThreadID); -TYPEDEF_DISTINCT_ORDERED_ID(pid_t, SessionID); -TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessGroupID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ThreadID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, SessionID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessGroupID); -TYPEDEF_DISTINCT_ORDERED_ID(uid_t, UserID); -TYPEDEF_DISTINCT_ORDERED_ID(gid_t, GroupID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(uid_t, UserID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(gid_t, GroupID); } diff --git a/Kernel/Graphics/Bochs/DisplayConnector.h b/Kernel/Graphics/Bochs/DisplayConnector.h index a8d4277e0d9..6f734847637 100644 --- a/Kernel/Graphics/Bochs/DisplayConnector.h +++ b/Kernel/Graphics/Bochs/DisplayConnector.h @@ -22,7 +22,7 @@ class BochsDisplayConnector friend class DeviceManagement; public: - TYPEDEF_DISTINCT_ORDERED_ID(u16, IndexID); + AK_TYPEDEF_DISTINCT_ORDERED_ID(u16, IndexID); static NonnullRefPtr must_create(PhysicalAddress framebuffer_address, size_t framebuffer_resource_size, bool virtual_box_hardware); diff --git a/Kernel/Graphics/VirtIOGPU/Protocol.h b/Kernel/Graphics/VirtIOGPU/Protocol.h index 374fab657c3..16538da1f0e 100644 --- a/Kernel/Graphics/VirtIOGPU/Protocol.h +++ b/Kernel/Graphics/VirtIOGPU/Protocol.h @@ -11,9 +11,9 @@ #define VIRTIO_GPU_MAX_SCANOUTS 16 namespace Kernel::Graphics::VirtIOGPU { -TYPEDEF_DISTINCT_ORDERED_ID(u32, ContextID); -TYPEDEF_DISTINCT_ORDERED_ID(u32, ResourceID); -TYPEDEF_DISTINCT_ORDERED_ID(u32, ScanoutID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ContextID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ResourceID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ScanoutID); }; #define VREND_MAX_CTX 64 diff --git a/Kernel/TimerQueue.h b/Kernel/TimerQueue.h index a9e59bd774f..9b982e46694 100644 --- a/Kernel/TimerQueue.h +++ b/Kernel/TimerQueue.h @@ -16,7 +16,7 @@ namespace Kernel { -TYPEDEF_DISTINCT_ORDERED_ID(u64, TimerId); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u64, TimerId); class Timer : public RefCounted { friend class TimerQueue; diff --git a/Userland/Demos/VirGLDemo/VirGLProtocol.h b/Userland/Demos/VirGLDemo/VirGLProtocol.h index 21d9da96bc1..15d4afa5831 100644 --- a/Userland/Demos/VirGLDemo/VirGLProtocol.h +++ b/Userland/Demos/VirGLDemo/VirGLProtocol.h @@ -8,8 +8,8 @@ #include -TYPEDEF_DISTINCT_ORDERED_ID(u32, ObjectHandle); -TYPEDEF_DISTINCT_ORDERED_ID(u32, ResourceID); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ObjectHandle); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ResourceID); #define VIRGL_BIND_DEPTH_STENCIL (1 << 0) #define VIRGL_BIND_RENDER_TARGET (1 << 1) diff --git a/Userland/Libraries/LibThreading/Thread.h b/Userland/Libraries/LibThreading/Thread.h index dec19c248aa..d1e1aa9b7ae 100644 --- a/Userland/Libraries/LibThreading/Thread.h +++ b/Userland/Libraries/LibThreading/Thread.h @@ -16,7 +16,7 @@ namespace Threading { -TYPEDEF_DISTINCT_ORDERED_ID(intptr_t, ThreadError); +AK_TYPEDEF_DISTINCT_ORDERED_ID(intptr_t, ThreadError); class Thread final : public Core::Object { C_OBJECT(Thread); diff --git a/Userland/Libraries/LibWasm/Opcode.h b/Userland/Libraries/LibWasm/Opcode.h index 9976314a883..0dda2b7f441 100644 --- a/Userland/Libraries/LibWasm/Opcode.h +++ b/Userland/Libraries/LibWasm/Opcode.h @@ -10,7 +10,7 @@ namespace Wasm { -TYPEDEF_DISTINCT_ORDERED_ID(u32, OpCode); +AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, OpCode); namespace Instructions { diff --git a/Userland/Libraries/LibWasm/Types.h b/Userland/Libraries/LibWasm/Types.h index 844cfe996b0..3725cb0425d 100644 --- a/Userland/Libraries/LibWasm/Types.h +++ b/Userland/Libraries/LibWasm/Types.h @@ -48,15 +48,15 @@ String parse_error_to_string(ParseError); template using ParseResult = Result; -TYPEDEF_DISTINCT_ORDERED_ID(size_t, TypeIndex); -TYPEDEF_DISTINCT_ORDERED_ID(size_t, FunctionIndex); -TYPEDEF_DISTINCT_ORDERED_ID(size_t, TableIndex); -TYPEDEF_DISTINCT_ORDERED_ID(size_t, ElementIndex); -TYPEDEF_DISTINCT_ORDERED_ID(size_t, MemoryIndex); -TYPEDEF_DISTINCT_ORDERED_ID(size_t, LocalIndex); -TYPEDEF_DISTINCT_ORDERED_ID(size_t, GlobalIndex); -TYPEDEF_DISTINCT_ORDERED_ID(size_t, LabelIndex); -TYPEDEF_DISTINCT_ORDERED_ID(size_t, DataIndex); +AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, TypeIndex); +AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, FunctionIndex); +AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, TableIndex); +AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, ElementIndex); +AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, MemoryIndex); +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); ParseError with_eof_check(InputStream const& stream, ParseError error_if_not_eof);