diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-22 15:36:45 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-22 15:36:45 +0100 |
commit | bfb1277b3496018b7ee12eca2fb900ebbe651b49 (patch) | |
tree | 7909c38e5fc0c25ee0477c0b842e19adf0cd2874 /src/compat.cpp | |
parent | f0170ce8f1a90337637d387b87280f121d0578fe (diff) | |
download | lanes-bfb1277b3496018b7ee12eca2fb900ebbe651b49.tar.gz lanes-bfb1277b3496018b7ee12eca2fb900ebbe651b49.tar.bz2 lanes-bfb1277b3496018b7ee12eca2fb900ebbe651b49.zip |
C++ migration: STACK_GROW is no longer a macro, sanitized and fixed warnings in keeper.cpp
Diffstat (limited to 'src/compat.cpp')
-rw-r--r-- | src/compat.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compat.cpp b/src/compat.cpp index 19159a9..47fe37e 100644 --- a/src/compat.cpp +++ b/src/compat.cpp | |||
@@ -51,8 +51,10 @@ void* lua_newuserdatauv( lua_State* L, size_t sz, int nuvalue) | |||
51 | return lua_newuserdata( L, sz); | 51 | return lua_newuserdata( L, sz); |
52 | } | 52 | } |
53 | 53 | ||
54 | int lua_getiuservalue( lua_State* L, int idx, int n) | 54 | // push on stack uservalue #n of full userdata at idx |
55 | int lua_getiuservalue(lua_State* L, int idx, int n) | ||
55 | { | 56 | { |
57 | // full userdata can have only 1 uservalue before 5.4 | ||
56 | if( n > 1) | 58 | if( n > 1) |
57 | { | 59 | { |
58 | lua_pushnil( L); | 60 | lua_pushnil( L); |
@@ -76,6 +78,7 @@ int lua_getiuservalue( lua_State* L, int idx, int n) | |||
76 | return lua_type( L, -1); | 78 | return lua_type( L, -1); |
77 | } | 79 | } |
78 | 80 | ||
81 | // pop stack top, sets it a uservalue #n of full userdata at idx | ||
79 | int lua_setiuservalue( lua_State* L, int idx, int n) | 82 | int lua_setiuservalue( lua_State* L, int idx, int n) |
80 | { | 83 | { |
81 | if( n > 1 | 84 | if( n > 1 |