Everywhere: Prefix 'TYPEDEF_DISTINCT_ORDERED_ID' with 'AK_'

This commit is contained in:
Linus Groh 2022-07-22 19:43:50 +01:00
parent 5a106b6401
commit 8150d71821
Notes: sideshowbarker 2024-07-17 22:01:16 +09:00
15 changed files with 44 additions and 43 deletions

View file

@ -286,7 +286,7 @@ struct Formatter<DistinctNumeric<T, X, Incr, Cmp, Bool, Flags, Shift, Arith>> :
#define AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(T, Incr, Cmp, Bool, Flags, Shift, Arith, NAME) \ #define AK_TYPEDEF_DISTINCT_NUMERIC_GENERAL(T, Incr, Cmp, Bool, Flags, Shift, Arith, NAME) \
using NAME = DistinctNumeric<T, struct __##NAME##_tag, Incr, Cmp, Bool, Flags, Shift, Arith>; using NAME = DistinctNumeric<T, struct __##NAME##_tag, Incr, Cmp, Bool, Flags, Shift, Arith>;
#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? // TODO: Further type aliases?
template<typename T, typename X, auto... Args> template<typename T, typename X, auto... Args>

View file

@ -13,9 +13,9 @@
namespace Kernel::PCI { namespace Kernel::PCI {
TYPEDEF_DISTINCT_ORDERED_ID(u8, BusNumber); AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, BusNumber);
TYPEDEF_DISTINCT_ORDERED_ID(u8, DeviceNumber); AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, DeviceNumber);
TYPEDEF_DISTINCT_ORDERED_ID(u8, FunctionNumber); AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, FunctionNumber);
class HostController { class HostController {
public: public:

View file

@ -97,7 +97,8 @@ enum class SubclassID {
} }
TYPEDEF_DISTINCT_ORDERED_ID(u8, CapabilityID); AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, CapabilityID);
namespace Capabilities { namespace Capabilities {
enum ID { enum ID {
Null = 0x0, Null = 0x0,
@ -218,14 +219,14 @@ private:
const u8 m_ptr; const u8 m_ptr;
}; };
TYPEDEF_DISTINCT_ORDERED_ID(u8, ClassCode); AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, ClassCode);
TYPEDEF_DISTINCT_ORDERED_ID(u8, SubclassCode); AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, SubclassCode);
TYPEDEF_DISTINCT_ORDERED_ID(u8, ProgrammingInterface); AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, ProgrammingInterface);
TYPEDEF_DISTINCT_ORDERED_ID(u8, RevisionID); AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, RevisionID);
TYPEDEF_DISTINCT_ORDERED_ID(u16, SubsystemID); AK_TYPEDEF_DISTINCT_ORDERED_ID(u16, SubsystemID);
TYPEDEF_DISTINCT_ORDERED_ID(u16, SubsystemVendorID); AK_TYPEDEF_DISTINCT_ORDERED_ID(u16, SubsystemVendorID);
TYPEDEF_DISTINCT_ORDERED_ID(u8, InterruptLine); AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, InterruptLine);
TYPEDEF_DISTINCT_ORDERED_ID(u8, InterruptPin); AK_TYPEDEF_DISTINCT_ORDERED_ID(u8, InterruptPin);
class Access; class Access;
class DeviceIdentifier { class DeviceIdentifier {

View file

@ -13,7 +13,7 @@ namespace Kernel {
class BlockBasedFileSystem : public FileBackedFileSystem { class BlockBasedFileSystem : public FileBackedFileSystem {
public: public:
TYPEDEF_DISTINCT_ORDERED_ID(u64, BlockIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(u64, BlockIndex);
virtual ~BlockBasedFileSystem() override; virtual ~BlockBasedFileSystem() override;
virtual ErrorOr<void> initialize() override; virtual ErrorOr<void> initialize() override;

View file

@ -10,7 +10,7 @@
namespace Kernel { namespace Kernel {
TYPEDEF_DISTINCT_ORDERED_ID(unsigned, MajorNumber); AK_TYPEDEF_DISTINCT_ORDERED_ID(unsigned, MajorNumber);
TYPEDEF_DISTINCT_ORDERED_ID(unsigned, MinorNumber); AK_TYPEDEF_DISTINCT_ORDERED_ID(unsigned, MinorNumber);
} }

View file

@ -105,7 +105,7 @@ public:
FeaturesReadOnly get_features_readonly() const; FeaturesReadOnly get_features_readonly() const;
private: private:
TYPEDEF_DISTINCT_ORDERED_ID(unsigned, GroupIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(unsigned, GroupIndex);
explicit Ext2FS(OpenFileDescription&); explicit Ext2FS(OpenFileDescription&);

View file

@ -15,8 +15,8 @@ namespace Kernel {
class FileSystem; class FileSystem;
struct InodeMetadata; struct InodeMetadata;
TYPEDEF_DISTINCT_ORDERED_ID(u32, FileSystemID); AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, FileSystemID);
TYPEDEF_DISTINCT_ORDERED_ID(u64, InodeIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(u64, InodeIndex);
class InodeIdentifier { class InodeIdentifier {
public: public:

View file

@ -92,12 +92,12 @@ class SpinlockLocker;
struct InodeMetadata; struct InodeMetadata;
struct TrapFrame; struct TrapFrame;
TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessID); AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessID);
TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ThreadID); AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ThreadID);
TYPEDEF_DISTINCT_ORDERED_ID(pid_t, SessionID); AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, SessionID);
TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessGroupID); AK_TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessGroupID);
TYPEDEF_DISTINCT_ORDERED_ID(uid_t, UserID); AK_TYPEDEF_DISTINCT_ORDERED_ID(uid_t, UserID);
TYPEDEF_DISTINCT_ORDERED_ID(gid_t, GroupID); AK_TYPEDEF_DISTINCT_ORDERED_ID(gid_t, GroupID);
} }

View file

@ -22,7 +22,7 @@ class BochsDisplayConnector
friend class DeviceManagement; friend class DeviceManagement;
public: public:
TYPEDEF_DISTINCT_ORDERED_ID(u16, IndexID); AK_TYPEDEF_DISTINCT_ORDERED_ID(u16, IndexID);
static NonnullRefPtr<BochsDisplayConnector> must_create(PhysicalAddress framebuffer_address, size_t framebuffer_resource_size, bool virtual_box_hardware); static NonnullRefPtr<BochsDisplayConnector> must_create(PhysicalAddress framebuffer_address, size_t framebuffer_resource_size, bool virtual_box_hardware);

View file

@ -11,9 +11,9 @@
#define VIRTIO_GPU_MAX_SCANOUTS 16 #define VIRTIO_GPU_MAX_SCANOUTS 16
namespace Kernel::Graphics::VirtIOGPU { namespace Kernel::Graphics::VirtIOGPU {
TYPEDEF_DISTINCT_ORDERED_ID(u32, ContextID); AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ContextID);
TYPEDEF_DISTINCT_ORDERED_ID(u32, ResourceID); AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ResourceID);
TYPEDEF_DISTINCT_ORDERED_ID(u32, ScanoutID); AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ScanoutID);
}; };
#define VREND_MAX_CTX 64 #define VREND_MAX_CTX 64

View file

@ -16,7 +16,7 @@
namespace Kernel { namespace Kernel {
TYPEDEF_DISTINCT_ORDERED_ID(u64, TimerId); AK_TYPEDEF_DISTINCT_ORDERED_ID(u64, TimerId);
class Timer : public RefCounted<Timer> { class Timer : public RefCounted<Timer> {
friend class TimerQueue; friend class TimerQueue;

View file

@ -8,8 +8,8 @@
#include <AK/DistinctNumeric.h> #include <AK/DistinctNumeric.h>
TYPEDEF_DISTINCT_ORDERED_ID(u32, ObjectHandle); AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ObjectHandle);
TYPEDEF_DISTINCT_ORDERED_ID(u32, ResourceID); AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ResourceID);
#define VIRGL_BIND_DEPTH_STENCIL (1 << 0) #define VIRGL_BIND_DEPTH_STENCIL (1 << 0)
#define VIRGL_BIND_RENDER_TARGET (1 << 1) #define VIRGL_BIND_RENDER_TARGET (1 << 1)

View file

@ -16,7 +16,7 @@
namespace Threading { namespace Threading {
TYPEDEF_DISTINCT_ORDERED_ID(intptr_t, ThreadError); AK_TYPEDEF_DISTINCT_ORDERED_ID(intptr_t, ThreadError);
class Thread final : public Core::Object { class Thread final : public Core::Object {
C_OBJECT(Thread); C_OBJECT(Thread);

View file

@ -10,7 +10,7 @@
namespace Wasm { namespace Wasm {
TYPEDEF_DISTINCT_ORDERED_ID(u32, OpCode); AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, OpCode);
namespace Instructions { namespace Instructions {

View file

@ -48,15 +48,15 @@ String parse_error_to_string(ParseError);
template<typename T> template<typename T>
using ParseResult = Result<T, ParseError>; using ParseResult = Result<T, ParseError>;
TYPEDEF_DISTINCT_ORDERED_ID(size_t, TypeIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, TypeIndex);
TYPEDEF_DISTINCT_ORDERED_ID(size_t, FunctionIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, FunctionIndex);
TYPEDEF_DISTINCT_ORDERED_ID(size_t, TableIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, TableIndex);
TYPEDEF_DISTINCT_ORDERED_ID(size_t, ElementIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, ElementIndex);
TYPEDEF_DISTINCT_ORDERED_ID(size_t, MemoryIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, MemoryIndex);
TYPEDEF_DISTINCT_ORDERED_ID(size_t, LocalIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, LocalIndex);
TYPEDEF_DISTINCT_ORDERED_ID(size_t, GlobalIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, GlobalIndex);
TYPEDEF_DISTINCT_ORDERED_ID(size_t, LabelIndex); AK_TYPEDEF_DISTINCT_ORDERED_ID(size_t, LabelIndex);
TYPEDEF_DISTINCT_ORDERED_ID(size_t, DataIndex); 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, true, true, false, true, false, true, InstructionPointer);
ParseError with_eof_check(InputStream const& stream, ParseError error_if_not_eof); ParseError with_eof_check(InputStream const& stream, ParseError error_if_not_eof);