diff options
Diffstat (limited to 'src/kernel/NeKit')
| -rw-r--r-- | src/kernel/NeKit/Atom.h | 22 | ||||
| -rw-r--r-- | src/kernel/NeKit/Config.h | 6 | ||||
| -rw-r--r-- | src/kernel/NeKit/Macros.h | 4 | ||||
| -rw-r--r-- | src/kernel/NeKit/New.h | 6 | ||||
| -rw-r--r-- | src/kernel/NeKit/Utils.h | 6 | ||||
| -rw-r--r-- | src/kernel/NeKit/Vettable.h | 8 |
6 files changed, 24 insertions, 28 deletions
diff --git a/src/kernel/NeKit/Atom.h b/src/kernel/NeKit/Atom.h index c23508f6..53ab661e 100644 --- a/src/kernel/NeKit/Atom.h +++ b/src/kernel/NeKit/Atom.h @@ -10,7 +10,7 @@ namespace Kernel { -template <class TypeAtomic> +template <class AtomicType> class Atom final { public: explicit Atom() = default; @@ -21,29 +21,29 @@ class Atom final { Atom(const Atom&) = delete; public: - using Type = TypeAtomic; - using Ref = TypeAtomic&; - using ConstRef = const TypeAtomic&; + using Type = AtomicType; + using Ref = AtomicType&; + using ConstRef = const AtomicType&; - const TypeAtomic& operator[](const TypeAtomic& bit) { - return (fArrayOfAtoms & (TypeAtomic{} << bit)); + const AtomicType& operator[](const AtomicType& bit) { + return (fArrayOfAtoms & (AtomicType{} << bit)); } - void operator|(const TypeAtomic& bit) { fArrayOfAtoms |= (TypeAtomic{1} << bit); } + void operator|(const AtomicType& bit) { fArrayOfAtoms |= (AtomicType{1} << bit); } - Atom& operator|=(const TypeAtomic& bit) { + Atom& operator|=(const AtomicType& bit) { this->operator|(bit); return *this; } - friend bool operator==(Atom<TypeAtomic>& atomic, const TypeAtomic& idx) { + friend bool operator==(Atom<AtomicType>& atomic, const AtomicType& idx) { return atomic[idx] == idx; } - friend bool operator!=(Atom<TypeAtomic>& atomic, const TypeAtomic& idx) { + friend bool operator!=(Atom<AtomicType>& atomic, const AtomicType& idx) { return atomic[idx] != idx; } private: - TypeAtomic fArrayOfAtoms; + AtomicType fArrayOfAtoms; }; } // namespace Kernel diff --git a/src/kernel/NeKit/Config.h b/src/kernel/NeKit/Config.h index caf17ebd..a855bf2a 100644 --- a/src/kernel/NeKit/Config.h +++ b/src/kernel/NeKit/Config.h @@ -17,7 +17,7 @@ #define NE_ICODEC \ final: \ - public \ + public \ ::Kernel::ICodec /// @brief The **NeKernel** namespace. @@ -113,12 +113,12 @@ inline Args&& move(Args&& arg) { template <class Type> concept IsSerializable = requires() { - {Type::kValue}; + { Type::kValue }; }; template <class Type> concept IsNotSerializable = requires() { - {!Type::kValue}; + { !Type::kValue }; }; /// @brief Encoding interface, used as a proxy to convert T to Char* diff --git a/src/kernel/NeKit/Macros.h b/src/kernel/NeKit/Macros.h index 4fb3a736..361afbda 100644 --- a/src/kernel/NeKit/Macros.h +++ b/src/kernel/NeKit/Macros.h @@ -16,7 +16,7 @@ #endif #ifndef kib_cast -#define kib_cast(X) (Kernel::UInt64)((X) *1024) +#define kib_cast(X) (Kernel::UInt64)((X) * 1024) #endif #ifndef MIB @@ -117,7 +117,7 @@ #define NE_UNUSED(X) ((Kernel::Void) X) #ifndef RGB -#define RGB(R, G, B) ((Kernel::UInt32)((0xFF << 24) | ((R) << 16) | ((G) << 8) | (B))) +#define RGB(R, G, B) ((Kernel::UInt32) ((0xFF << 24) | ((R) << 16) | ((G) << 8) | (B))) #endif // !RGB #ifdef __NE_AMD64__ diff --git a/src/kernel/NeKit/New.h b/src/kernel/NeKit/New.h index 648f4a20..9b601534 100644 --- a/src/kernel/NeKit/New.h +++ b/src/kernel/NeKit/New.h @@ -14,8 +14,8 @@ typedef __SIZE_TYPE__ size_t; void* operator new(size_t); void* operator new[](size_t); -void operator delete(void*); -void operator delete(void*, unsigned long); -void operator delete[](void*); +void operator delete(void*) noexcept; +void operator delete(void*, unsigned long) noexcept; +void operator delete[](void*) noexcept; #endif diff --git a/src/kernel/NeKit/Utils.h b/src/kernel/NeKit/Utils.h index 0ac5acc5..3f387c33 100644 --- a/src/kernel/NeKit/Utils.h +++ b/src/kernel/NeKit/Utils.h @@ -55,9 +55,9 @@ inline constexpr SizeT oe_string_len(const CharType* str) { if (!str) return 0; #if __cplusplus == 202302L - if - consteval { return ARRAY_SIZE(str); } - else { + if consteval { + return ARRAY_SIZE(str); + } else { SizeT len{0}; while (str[len] != 0) ++len; return len; diff --git a/src/kernel/NeKit/Vettable.h b/src/kernel/NeKit/Vettable.h index 4cb1682d..a33a3ab3 100644 --- a/src/kernel/NeKit/Vettable.h +++ b/src/kernel/NeKit/Vettable.h @@ -16,14 +16,10 @@ namespace Kernel { template <class Type> -concept IsVettable = requires(Type) { - (Type::kVettable); -}; +concept IsVettable = requires(Type) { (Type::kVettable); }; template <class Type> -concept IsUnVettable = requires(Type) { - (Type::kUnvettable); -}; +concept IsUnVettable = requires(Type) { (Type::kUnvettable); }; } // namespace Kernel #endif // !__NE_KIT_VETTABLE_H__ |
