aboutsummaryrefslogtreecommitdiff
path: root/src/uniquekey.h
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-04-29 09:50:57 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-04-29 09:50:57 +0200
commit07d6074b5deadc7ff6d30d5fb47fb6fa863a14ff (patch)
tree955fb6216739c3d55aeba47a3ea5d8ffc6a7f3e1 /src/uniquekey.h
parent4a2705af8a9a6b55cf848d53f8330447138a19c4 (diff)
downloadlanes-07d6074b5deadc7ff6d30d5fb47fb6fa863a14ff.tar.gz
lanes-07d6074b5deadc7ff6d30d5fb47fb6fa863a14ff.tar.bz2
lanes-07d6074b5deadc7ff6d30d5fb47fb6fa863a14ff.zip
All headers reformatted with updated clang-format settings
Diffstat (limited to 'src/uniquekey.h')
-rw-r--r--src/uniquekey.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/uniquekey.h b/src/uniquekey.h
index 738cb51..984ef50 100644
--- a/src/uniquekey.h
+++ b/src/uniquekey.h
@@ -10,11 +10,9 @@
10class UniqueKey 10class UniqueKey
11{ 11{
12 protected: 12 protected:
13
14 uintptr_t const m_storage{ 0 }; 13 uintptr_t const m_storage{ 0 };
15 14
16 public: 15 public:
17
18 char const* m_debugName{ nullptr }; 16 char const* m_debugName{ nullptr };
19 17
20 // --------------------------------------------------------------------------------------------- 18 // ---------------------------------------------------------------------------------------------
@@ -45,10 +43,10 @@ class UniqueKey
45 43
46// ################################################################################################# 44// #################################################################################################
47 45
48class RegistryUniqueKey : public UniqueKey 46class RegistryUniqueKey
47: public UniqueKey
49{ 48{
50 public: 49 public:
51
52 using UniqueKey::UniqueKey; 50 using UniqueKey::UniqueKey;
53 51
54 // --------------------------------------------------------------------------------------------- 52 // ---------------------------------------------------------------------------------------------
@@ -64,9 +62,9 @@ class RegistryUniqueKey : public UniqueKey
64 void setValue(lua_State* L_, OP operation_) const 62 void setValue(lua_State* L_, OP operation_) const
65 { 63 {
66 // Note we can't check stack consistency because operation is not always a push (could be insert, replace, whatever) 64 // Note we can't check stack consistency because operation is not always a push (could be insert, replace, whatever)
67 pushKey(L_); // ... key 65 pushKey(L_); // ... key
68 operation_(L_); // ... key value 66 operation_(L_); // ... key value
69 lua_rawset(L_, LUA_REGISTRYINDEX); // ... 67 lua_rawset(L_, LUA_REGISTRYINDEX); // ...
70 } 68 }
71 // --------------------------------------------------------------------------------------------- 69 // ---------------------------------------------------------------------------------------------
72 template <typename T> 70 template <typename T>
@@ -86,7 +84,7 @@ class RegistryUniqueKey : public UniqueKey
86 STACK_GROW(L_, 1); 84 STACK_GROW(L_, 1);
87 STACK_CHECK_START_REL(L_, 0); 85 STACK_CHECK_START_REL(L_, 0);
88 pushValue(L_); 86 pushValue(L_);
89 bool const value{ lua_toboolean(L_, -1) ? true : false}; // bool/nil 87 bool const value{ lua_toboolean(L_, -1) ? true : false }; // bool/nil
90 lua_pop(L_, 1); 88 lua_pop(L_, 1);
91 STACK_CHECK(L_, 0); 89 STACK_CHECK(L_, 0);
92 return value; 90 return value;