瀏覽代碼

Rename macro

Kajetan Johannes Hammerle 1 年之前
父節點
當前提交
8dfbb9394b
共有 3 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      thread/Thread.cpp
  2. 1 1
      thread/Thread.hpp
  3. 2 2
      utils/AlignedData.hpp

+ 1 - 1
thread/Thread.cpp

@@ -3,7 +3,7 @@
 #include <threads.h>
 
 check_return Core::Error Core::Thread::start(Function f, void* p) {
-    ASSERT_ALIGNED_DATA(thread, thrd_t);
+    CORE_ASSERT_ALIGNED_DATA(thread, thrd_t);
     return thrd_create(thread.as<thrd_t>(), f, p) != thrd_success
                ? Error::THREAD_ERROR
                : Error::NONE;

+ 1 - 1
thread/Thread.hpp

@@ -6,7 +6,7 @@
 #include "utils/Error.hpp"
 
 namespace Core {
-    class Thread {
+    class Thread final {
         AlignedData<8, 8> thread{};
 
     public:

+ 2 - 2
utils/AlignedData.hpp

@@ -3,7 +3,7 @@
 
 #define alignmentof(type) __alignof__(type)
 
-#define ASSERT_ALIGNED_DATA(var, type)                                         \
+#define CORE_ASSERT_ALIGNED_DATA(var, type)                                    \
     static_assert(sizeof(var) == sizeof(type), "aligned data size missmatch"); \
     static_assert(var.getSize() >= var.getAlignment(), "size >= alignment");   \
     static_assert(alignmentof(var) == alignmentof(type),                       \
@@ -11,7 +11,7 @@
 
 namespace Core {
     template<int SIZE, int ALIGNMENT>
-    class alignas(ALIGNMENT) AlignedData {
+    class alignas(ALIGNMENT) AlignedData final {
         static_assert(SIZE > 0, "size must be positive");
         char buffer[static_cast<unsigned int>(SIZE)] = {};