diff options
Diffstat (limited to 'deep_test')
-rw-r--r-- | deep_test/deep_test.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/deep_test/deep_test.cpp b/deep_test/deep_test.cpp index 46f99d9..cbc33ca 100644 --- a/deep_test/deep_test.cpp +++ b/deep_test/deep_test.cpp | |||
@@ -204,44 +204,44 @@ static int clonable_get(lua_State* const L_) | |||
204 | // ################################################################################################# | 204 | // ################################################################################################# |
205 | 205 | ||
206 | [[nodiscard]] | 206 | [[nodiscard]] |
207 | static int clonable_set(lua_State* L) | 207 | static int clonable_set(lua_State* const L_) |
208 | { | 208 | { |
209 | MyClonableUserdata* self = static_cast<MyClonableUserdata*>(lua_touserdata(L, 1)); | 209 | MyClonableUserdata* _self = static_cast<MyClonableUserdata*>(lua_touserdata(L_, 1)); |
210 | lua_Integer i = lua_tointeger(L, 2); | 210 | lua_Integer i = lua_tointeger(L_, 2); |
211 | self->val = i; | 211 | _self->val = i; |
212 | return 0; | 212 | return 0; |
213 | } | 213 | } |
214 | 214 | ||
215 | // ################################################################################################# | 215 | // ################################################################################################# |
216 | 216 | ||
217 | [[nodiscard]] | 217 | [[nodiscard]] |
218 | static int clonable_setuv(lua_State* L) | 218 | static int clonable_setuv(lua_State* const L_) |
219 | { | 219 | { |
220 | MyClonableUserdata* const _self{ static_cast<MyClonableUserdata*>(lua_touserdata(L, 1)) }; | 220 | [[maybe_unused]] MyClonableUserdata* const _self{ static_cast<MyClonableUserdata*>(lua_touserdata(L_, 1)) }; |
221 | UserValueIndex const _uv{ static_cast<UserValueIndex::type>(luaL_optinteger(L, 2, 1)) }; | 221 | UserValueIndex const _uv{ static_cast<UserValueIndex::type>(luaL_optinteger(L_, 2, 1)) }; |
222 | lua_settop(L, 3); | 222 | lua_settop(L_, 3); |
223 | lua_pushboolean(L, lua_setiuservalue(L, StackIndex{ 1 }, _uv) != 0); | 223 | lua_pushboolean(L_, lua_setiuservalue(L_, StackIndex{ 1 }, _uv) != 0); |
224 | return 1; | 224 | return 1; |
225 | } | 225 | } |
226 | 226 | ||
227 | // ################################################################################################# | 227 | // ################################################################################################# |
228 | 228 | ||
229 | [[nodiscard]] | 229 | [[nodiscard]] |
230 | static int clonable_getuv(lua_State* L) | 230 | static int clonable_getuv(lua_State* const L_) |
231 | { | 231 | { |
232 | MyClonableUserdata* const _self{ static_cast<MyClonableUserdata*>(lua_touserdata(L, 1)) }; | 232 | [[maybe_unused]] MyClonableUserdata* const _self{ static_cast<MyClonableUserdata*>(lua_touserdata(L_, 1)) }; |
233 | UserValueIndex const _uv{ static_cast<UserValueIndex::type>(luaL_optinteger(L, 2, 1)) }; | 233 | UserValueIndex const _uv{ static_cast<UserValueIndex::type>(luaL_optinteger(L_, 2, 1)) }; |
234 | lua_getiuservalue(L, StackIndex{ 1 }, _uv); | 234 | lua_getiuservalue(L_, StackIndex{ 1 }, _uv); |
235 | return 1; | 235 | return 1; |
236 | } | 236 | } |
237 | 237 | ||
238 | // ################################################################################################# | 238 | // ################################################################################################# |
239 | 239 | ||
240 | [[nodiscard]] | 240 | [[nodiscard]] |
241 | static int clonable_tostring(lua_State* L) | 241 | static int clonable_tostring(lua_State* const L_) |
242 | { | 242 | { |
243 | MyClonableUserdata* self = static_cast<MyClonableUserdata*>(lua_touserdata(L, 1)); | 243 | MyClonableUserdata* _self = static_cast<MyClonableUserdata*>(lua_touserdata(L_, 1)); |
244 | luaG_pushstring(L, "%p:clonable(%d)", lua_topointer(L, 1), self->val); | 244 | luaG_pushstring(L_, "%p:clonable(%d)", lua_topointer(L_, 1), _self->val); |
245 | return 1; | 245 | return 1; |
246 | } | 246 | } |
247 | 247 | ||
@@ -250,7 +250,7 @@ static int clonable_tostring(lua_State* L) | |||
250 | [[nodiscard]] | 250 | [[nodiscard]] |
251 | static int clonable_gc(lua_State* const L_) | 251 | static int clonable_gc(lua_State* const L_) |
252 | { | 252 | { |
253 | MyClonableUserdata* self = static_cast<MyClonableUserdata*>(lua_touserdata(L_, 1)); | 253 | [[maybe_unused]] MyClonableUserdata* _self = static_cast<MyClonableUserdata*>(lua_touserdata(L_, 1)); |
254 | if (lua_getiuservalue(L_, kIdxTop, UserValueIndex{ 1 }) == LUA_TFUNCTION) { | 254 | if (lua_getiuservalue(L_, kIdxTop, UserValueIndex{ 1 }) == LUA_TFUNCTION) { |
255 | lua_call(L_, 0, 0); | 255 | lua_call(L_, 0, 0); |
256 | } | 256 | } |