summaryrefslogtreecommitdiffhomepage
path: root/src/kernel/NeKit
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/NeKit')
-rw-r--r--src/kernel/NeKit/Atom.h10
-rw-r--r--src/kernel/NeKit/Config.h6
-rw-r--r--src/kernel/NeKit/CxxAbi.h1
-rw-r--r--src/kernel/NeKit/ErrorOr.h1
-rw-r--r--src/kernel/NeKit/Function.h1
-rw-r--r--src/kernel/NeKit/InitializerList.h1
-rw-r--r--src/kernel/NeKit/KString.h1
-rw-r--r--src/kernel/NeKit/KernelPanic.h1
-rw-r--r--src/kernel/NeKit/Macros.h4
-rw-r--r--src/kernel/NeKit/Stream.h1
-rw-r--r--src/kernel/NeKit/TOML.h1
-rw-r--r--src/kernel/NeKit/Utils.h6
-rw-r--r--src/kernel/NeKit/Vettable.h8
13 files changed, 19 insertions, 23 deletions
diff --git a/src/kernel/NeKit/Atom.h b/src/kernel/NeKit/Atom.h
index 26be562b..c23508f6 100644
--- a/src/kernel/NeKit/Atom.h
+++ b/src/kernel/NeKit/Atom.h
@@ -3,7 +3,6 @@
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel
-
#ifndef NEKIT_ATOM_H
#define NEKIT_ATOM_H
@@ -26,11 +25,12 @@ class Atom final {
using Ref = TypeAtomic&;
using ConstRef = const TypeAtomic&;
- const TypeAtomic& operator[](const SizeT& bit) { return (fArrayOfAtoms & (1 << bit)); }
-
- void operator|(const SizeT& bit) { fArrayOfAtoms |= (1 << bit); }
+ const TypeAtomic& operator[](const TypeAtomic& bit) {
+ return (fArrayOfAtoms & (TypeAtomic{} << bit));
+ }
+ void operator|(const TypeAtomic& bit) { fArrayOfAtoms |= (TypeAtomic{1} << bit); }
- Atom& operator|=(const SizeT& bit) {
+ Atom& operator|=(const TypeAtomic& bit) {
this->operator|(bit);
return *this;
}
diff --git a/src/kernel/NeKit/Config.h b/src/kernel/NeKit/Config.h
index f84c939a..02189b47 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/CxxAbi.h b/src/kernel/NeKit/CxxAbi.h
index 17bce25f..ea24a722 100644
--- a/src/kernel/NeKit/CxxAbi.h
+++ b/src/kernel/NeKit/CxxAbi.h
@@ -3,7 +3,6 @@
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel
-
#ifndef NEKIT_CXXABI_H
#define NEKIT_CXXABI_H
diff --git a/src/kernel/NeKit/ErrorOr.h b/src/kernel/NeKit/ErrorOr.h
index 53a00f34..252b8e5f 100644
--- a/src/kernel/NeKit/ErrorOr.h
+++ b/src/kernel/NeKit/ErrorOr.h
@@ -3,7 +3,6 @@
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel
-
#ifndef NEKIT_ERROROR_H
#define NEKIT_ERROROR_H
diff --git a/src/kernel/NeKit/Function.h b/src/kernel/NeKit/Function.h
index 86242db1..e6d75261 100644
--- a/src/kernel/NeKit/Function.h
+++ b/src/kernel/NeKit/Function.h
@@ -3,7 +3,6 @@
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel
-
#ifndef NEKIT_FUNCTION_H
#define NEKIT_FUNCTION_H
diff --git a/src/kernel/NeKit/InitializerList.h b/src/kernel/NeKit/InitializerList.h
index 7a8be647..7cc3d3b7 100644
--- a/src/kernel/NeKit/InitializerList.h
+++ b/src/kernel/NeKit/InitializerList.h
@@ -3,7 +3,6 @@
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel
-
#ifndef __NE_KIT_INIT_LIST_H__
#define __NE_KIT_INIT_LIST_H__
diff --git a/src/kernel/NeKit/KString.h b/src/kernel/NeKit/KString.h
index 2150a9f3..a5746791 100644
--- a/src/kernel/NeKit/KString.h
+++ b/src/kernel/NeKit/KString.h
@@ -3,7 +3,6 @@
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel
-
#ifndef NEKIT_KSTRING_H
#define NEKIT_KSTRING_H
diff --git a/src/kernel/NeKit/KernelPanic.h b/src/kernel/NeKit/KernelPanic.h
index 53214a0c..0aaf45cf 100644
--- a/src/kernel/NeKit/KernelPanic.h
+++ b/src/kernel/NeKit/KernelPanic.h
@@ -3,7 +3,6 @@
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel
-
#ifndef NEKIT_KERNELPANIC_H
#define NEKIT_KERNELPANIC_H
diff --git a/src/kernel/NeKit/Macros.h b/src/kernel/NeKit/Macros.h
index 361afbda..4fb3a736 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/Stream.h b/src/kernel/NeKit/Stream.h
index 929b8acd..8184346d 100644
--- a/src/kernel/NeKit/Stream.h
+++ b/src/kernel/NeKit/Stream.h
@@ -3,7 +3,6 @@
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel
-
#ifndef NEKIT_STREAM_H
#define NEKIT_STREAM_H
diff --git a/src/kernel/NeKit/TOML.h b/src/kernel/NeKit/TOML.h
index adc43d39..8bbae7ef 100644
--- a/src/kernel/NeKit/TOML.h
+++ b/src/kernel/NeKit/TOML.h
@@ -3,7 +3,6 @@
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel
-
#ifndef NEKIT_TOML_H
#define NEKIT_TOML_H
diff --git a/src/kernel/NeKit/Utils.h b/src/kernel/NeKit/Utils.h
index 3f387c33..0ac5acc5 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 a33a3ab3..4cb1682d 100644
--- a/src/kernel/NeKit/Vettable.h
+++ b/src/kernel/NeKit/Vettable.h
@@ -16,10 +16,14 @@
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__