diff options
| author | Amlal <amlal@nekernel.org> | 2025-04-25 13:08:33 +0200 |
|---|---|---|
| committer | Amlal <amlal@nekernel.org> | 2025-04-25 13:08:33 +0200 |
| commit | fb790b07aeba8e22e4190cf3e1834d11ecde6c96 (patch) | |
| tree | 4cec7d1b321307b1d5935577631dae116a658a37 /dev/kernel/NewKit/Macros.h | |
| parent | 63a2d92c5dfe976175cda024ec01905d11b43738 (diff) | |
dev: better .clang-format, ran format command.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/NewKit/Macros.h')
| -rw-r--r-- | dev/kernel/NewKit/Macros.h | 70 |
1 files changed, 32 insertions, 38 deletions
diff --git a/dev/kernel/NewKit/Macros.h b/dev/kernel/NewKit/Macros.h index 83dbc7b5..b89f5d67 100644 --- a/dev/kernel/NewKit/Macros.h +++ b/dev/kernel/NewKit/Macros.h @@ -1,6 +1,6 @@ /* ------------------------------------------- - Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. + Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. ------------------------------------------- */ @@ -16,52 +16,51 @@ #endif #ifndef kib_cast -#define kib_cast(X) (Kernel::UInt64)((X)*1024) +#define kib_cast(X) (Kernel::UInt64)((X) * 1024) #endif #ifndef MIB -#define MIB(X) (Kernel::UInt64)((Kernel::UInt64)KIB(X) / 1024) +#define MIB(X) (Kernel::UInt64)((Kernel::UInt64) KIB(X) / 1024) #endif #ifndef mib_cast -#define mib_cast(X) (Kernel::UInt64)((Kernel::UInt64)kib_cast(X) * 1024) +#define mib_cast(X) (Kernel::UInt64)((Kernel::UInt64) kib_cast(X) * 1024) #endif #ifndef GIB -#define GIB(X) (Kernel::UInt64)((Kernel::UInt64)MIB(X) / 1024) +#define GIB(X) (Kernel::UInt64)((Kernel::UInt64) MIB(X) / 1024) #endif #ifndef gib_cast -#define gib_cast(X) (Kernel::UInt64)((Kernel::UInt64)mib_cast(X) * 1024) +#define gib_cast(X) (Kernel::UInt64)((Kernel::UInt64) mib_cast(X) * 1024) #endif #ifndef TIB -#define TIB(X) (Kernel::UInt64)((Kernel::UInt64)GIB(X) / 1024) +#define TIB(X) (Kernel::UInt64)((Kernel::UInt64) GIB(X) / 1024) #endif #ifndef tib_cast -#define tib_cast(X) ((Kernel::UInt64)gib_cast(X) * 1024) +#define tib_cast(X) ((Kernel::UInt64) gib_cast(X) * 1024) #endif #ifndef ARRAY_SIZE -#define ARRAY_SIZE(a) \ - (((sizeof(a) / sizeof(*(a))) / \ - (static_cast<Kernel::Size>(!(sizeof(a) % sizeof(*(a))))))) +#define ARRAY_SIZE(a) \ + (((sizeof(a) / sizeof(*(a))) / (static_cast<Kernel::Size>(!(sizeof(a) % sizeof(*(a))))))) #endif #define DEPRECATED ATTRIBUTE(deprecated) #ifndef ALIGN #define ALIGN(X) __attribute__((aligned(X))) -#endif // #ifndef ALIGN +#endif // #ifndef ALIGN #ifndef ATTRIBUTE #define ATTRIBUTE(...) __attribute__((__VA_ARGS__)) -#endif // #ifndef ATTRIBUTE +#endif // #ifndef ATTRIBUTE #ifndef __NE_VER__ #define __NE_VER__ (2024) -#endif // !__NE_VER__ +#endif // !__NE_VER__ #ifndef EXTERN #define EXTERN extern @@ -72,21 +71,17 @@ #endif #ifndef MAKE_ENUM -#define MAKE_ENUM(NAME) \ - enum NAME \ - { +#define MAKE_ENUM(NAME) enum NAME { #endif #ifndef END_ENUM #define END_ENUM() \ - } \ - ; + } \ + ; #endif #ifndef MAKE_STRING_ENUM -#define MAKE_STRING_ENUM(NAME) \ - namespace NAME \ - { +#define MAKE_STRING_ENUM(NAME) namespace NAME { #endif #ifndef ENUM_STRING @@ -99,18 +94,18 @@ #ifndef RTL_ALLOCA #define RTL_ALLOCA(sz) __builtin_alloca(sz) -#endif // #ifndef RTL_ALLOCA +#endif // #ifndef RTL_ALLOCA #ifndef CANT_REACH #define CANT_REACH() __builtin_unreachable() #endif #define kInvalidAddress 0xFBFBFBFBFBFBFBFB -#define kBadAddress 0x0000000000000000 -#define kMaxAddr 0xFFFFFFFFFFFFFFFF -#define kPathLen 0x100 +#define kBadAddress 0x0000000000000000 +#define kMaxAddr 0xFFFFFFFFFFFFFFFF +#define kPathLen 0x100 -#define PACKED ATTRIBUTE(packed) +#define PACKED ATTRIBUTE(packed) #define NO_EXEC ATTRIBUTE(noexec) #define EXTERN extern @@ -119,36 +114,35 @@ #define CONST const #define STRINGIFY(X) #X -#define NE_UNUSED(X) ((Kernel::Void)X) +#define NE_UNUSED(X) ((Kernel::Void) X) #ifndef RGB #define RGB(R, G, B) ((Kernel::UInt32)((0xFF << 24) | ((R) << 16) | ((G) << 8) | (B))) -#endif // !RGB +#endif // !RGB #ifdef __NE_AMD64__ #define dbg_break_point() asm volatile("int $3") #else -#define dbg_break_point() ((void)0) +#define dbg_break_point() ((void) 0) #endif -#define RTL_ENDIAN(address, value) \ - (((reinterpret_cast<Kernel::Char*>(address)[0]) == (value)) \ - ? (Kernel::Endian::kEndianBig) \ - : (Kernel::Endian::kEndianLittle)) +#define RTL_ENDIAN(address, value) \ + (((reinterpret_cast<Kernel::Char*>(address)[0]) == (value)) ? (Kernel::Endian::kEndianBig) \ + : (Kernel::Endian::kEndianLittle)) #define Yes true -#define No false +#define No false #define YES true -#define NO false +#define NO false -#define TRUE true +#define TRUE true #define FALSE false #define BOOL Kernel::Boolean #ifdef rtl_init_object #undef rtl_init_object -#endif // ifdef rtl_init_object +#endif // ifdef rtl_init_object #define rtl_init_object(OBJ, TYPE, ...) TYPE OBJ = TYPE(__VA_ARGS__) |
