aboutsummaryrefslogtreecommitdiff
path: root/src/compat.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/compat.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compat.cpp b/src/compat.cpp
index b661b28..04ac819 100644
--- a/src/compat.cpp
+++ b/src/compat.cpp
@@ -9,7 +9,7 @@ UserValueCount luaG_getalluservalues(lua_State* const L_, StackIndex const idx_)
9{ 9{
10 STACK_CHECK_START_REL(L_, 0); 10 STACK_CHECK_START_REL(L_, 0);
11 StackIndex const _idx{ luaG_absindex(L_, idx_) }; 11 StackIndex const _idx{ luaG_absindex(L_, idx_) };
12 UserValueCount _nuv{ 0 }; 12 UserValueIndex _nuv{ 0 };
13 do { 13 do {
14 // we don't know how many uservalues we are going to extract, there might be a lot... 14 // we don't know how many uservalues we are going to extract, there might be a lot...
15 STACK_GROW(L_, 1); 15 STACK_GROW(L_, 1);
@@ -18,7 +18,7 @@ UserValueCount luaG_getalluservalues(lua_State* const L_, StackIndex const idx_)
18 lua_pop(L_, 1); // L_: ... [uv]* 18 lua_pop(L_, 1); // L_: ... [uv]*
19 --_nuv; 19 --_nuv;
20 STACK_CHECK(L_, _nuv); 20 STACK_CHECK(L_, _nuv);
21 return _nuv; 21 return UserValueCount{ _nuv.value() };
22} 22}
23 23
24// ################################################################################################# 24// #################################################################################################
@@ -92,7 +92,7 @@ void* lua_newuserdatauv(lua_State* const L_, size_t const sz_, [[maybe_unused]]
92// ################################################################################################# 92// #################################################################################################
93 93
94// push on stack uservalue #n of full userdata at idx 94// push on stack uservalue #n of full userdata at idx
95int lua_getiuservalue(lua_State* const L_, StackIndex const idx_, int const n_) 95int lua_getiuservalue(lua_State* const L_, StackIndex const idx_, UserValueIndex const n_)
96{ 96{
97 STACK_CHECK_START_REL(L_, 0); 97 STACK_CHECK_START_REL(L_, 0);
98 // full userdata can have only 1 uservalue before 5.4 98 // full userdata can have only 1 uservalue before 5.4
@@ -129,7 +129,7 @@ int lua_getiuservalue(lua_State* const L_, StackIndex const idx_, int const n_)
129 129
130// Pops a value from the stack and sets it as the new n-th user value associated to the full userdata at the given index. 130// Pops a value from the stack and sets it as the new n-th user value associated to the full userdata at the given index.
131// Returns 0 if the userdata does not have that value. 131// Returns 0 if the userdata does not have that value.
132int lua_setiuservalue(lua_State* const L_, StackIndex const idx_, int const n_) 132int lua_setiuservalue(lua_State* const L_, StackIndex const idx_, UserValueIndex const n_)
133{ 133{
134 if (n_ > 1 134 if (n_ > 1
135#if LUA_VERSION_NUM == 501 135#if LUA_VERSION_NUM == 501