diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-07 11:46:25 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-07 11:46:25 +0200 |
commit | ee32d4281a5e59ce81d7f38f86a49fa8ff64d2c3 (patch) | |
tree | 68c0d74ac40c6ee098abf606e3d660a862acf04f /src/keeper.cpp | |
parent | 35d7a6bb691d7e0564cda324b3d724caf4901545 (diff) | |
download | lanes-ee32d4281a5e59ce81d7f38f86a49fa8ff64d2c3.tar.gz lanes-ee32d4281a5e59ce81d7f38f86a49fa8ff64d2c3.tar.bz2 lanes-ee32d4281a5e59ce81d7f38f86a49fa8ff64d2c3.zip |
Boyscouting some luaG_ functions
Diffstat (limited to 'src/keeper.cpp')
-rw-r--r-- | src/keeper.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/keeper.cpp b/src/keeper.cpp index 87f5505..22bd67e 100644 --- a/src/keeper.cpp +++ b/src/keeper.cpp | |||
@@ -69,7 +69,7 @@ class KeyUD | |||
69 | int limit{ -1 }; | 69 | int limit{ -1 }; |
70 | 70 | ||
71 | // a fifo full userdata has one uservalue, the table that holds the actual fifo contents | 71 | // a fifo full userdata has one uservalue, the table that holds the actual fifo contents |
72 | [[nodiscard]] static void* operator new([[maybe_unused]] size_t size_, KeeperState L_) noexcept { return lua_newuserdatauv<KeyUD>(L_, 1); } | 72 | [[nodiscard]] static void* operator new([[maybe_unused]] size_t size_, KeeperState L_) noexcept { return luaG_newuserdatauv<KeyUD>(L_, 1); } |
73 | // always embedded somewhere else or "in-place constructed" as a full userdata | 73 | // always embedded somewhere else or "in-place constructed" as a full userdata |
74 | // can't actually delete the operator because the compiler generates stack unwinding code that could call it in case of exception | 74 | // can't actually delete the operator because the compiler generates stack unwinding code that could call it in case of exception |
75 | static void operator delete([[maybe_unused]] void* p_, [[maybe_unused]] KeeperState L_) { LUA_ASSERT(L_, !"should never be called"); } | 75 | static void operator delete([[maybe_unused]] void* p_, [[maybe_unused]] KeeperState L_) { LUA_ASSERT(L_, !"should never be called"); } |
@@ -117,7 +117,7 @@ KeyUD* KeyUD::Create(KeeperState const K_) | |||
117 | 117 | ||
118 | KeyUD* KeyUD::GetPtr(KeeperState const K_, int idx_) | 118 | KeyUD* KeyUD::GetPtr(KeeperState const K_, int idx_) |
119 | { | 119 | { |
120 | return lua_tofulluserdata<KeyUD>(K_, idx_); | 120 | return luaG_tofulluserdata<KeyUD>(K_, idx_); |
121 | } | 121 | } |
122 | 122 | ||
123 | // ################################################################################################# | 123 | // ################################################################################################# |
@@ -824,7 +824,7 @@ void Keepers::initialize(Universe& U_, lua_State* L_, int const nbKeepers_, int | |||
824 | keeper_.K = _K; | 824 | keeper_.K = _K; |
825 | 825 | ||
826 | // Give a name to the state | 826 | // Give a name to the state |
827 | std::ignore = luaG_pushstringview(_K, "Keeper #%d", i_ + 1); // L_: settings _K: "Keeper #n" | 827 | std::ignore = luaG_pushstring(_K, "Keeper #%d", i_ + 1); // L_: settings _K: "Keeper #n" |
828 | if constexpr (HAVE_DECODA_SUPPORT()) { | 828 | if constexpr (HAVE_DECODA_SUPPORT()) { |
829 | lua_pushvalue(_K, -1); // _K: "Keeper #n" Keeper #n" | 829 | lua_pushvalue(_K, -1); // _K: "Keeper #n" Keeper #n" |
830 | lua_setglobal(_K, "decoda_name"); // L_: settings _K: "Keeper #n" | 830 | lua_setglobal(_K, "decoda_name"); // L_: settings _K: "Keeper #n" |