diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-24 11:30:18 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-24 11:30:18 +0200 |
commit | eba98e4e1adcf3ce11e5934e2dce54f29aef1e0a (patch) | |
tree | d51d51eb2d48208df1cfdf6eb0bd40a928d6243c /src/compat.h | |
parent | 8745a54f88f31cd51dc86c96039ebe0b3e98f5ea (diff) | |
download | lanes-eba98e4e1adcf3ce11e5934e2dce54f29aef1e0a.tar.gz lanes-eba98e4e1adcf3ce11e5934e2dce54f29aef1e0a.tar.bz2 lanes-eba98e4e1adcf3ce11e5934e2dce54f29aef1e0a.zip |
Make Unique even stronger
Diffstat (limited to 'src/compat.h')
-rw-r--r-- | src/compat.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compat.h b/src/compat.h index af014b1..0b6b12b 100644 --- a/src/compat.h +++ b/src/compat.h | |||
@@ -80,7 +80,7 @@ inline int luaL_optint(lua_State* L_, int n_, lua_Integer d_) | |||
80 | 80 | ||
81 | #if LUA_VERSION_NUM < 504 | 81 | #if LUA_VERSION_NUM < 504 |
82 | 82 | ||
83 | void* lua_newuserdatauv(lua_State* L_, size_t sz_, int nuvalue_); | 83 | void* lua_newuserdatauv(lua_State* L_, size_t sz_, UserValueCount nuvalue_); |
84 | int lua_getiuservalue(lua_State* L_, StackIndex idx_, int n_); | 84 | int lua_getiuservalue(lua_State* L_, StackIndex idx_, int n_); |
85 | int lua_setiuservalue(lua_State* L_, StackIndex idx_, int n_); | 85 | int lua_setiuservalue(lua_State* L_, StackIndex idx_, int n_); |
86 | 86 | ||
@@ -138,7 +138,7 @@ inline LuaType luaG_type(lua_State* const L_, StackIndex const idx_) | |||
138 | // use this in place of lua_absindex to save a function call | 138 | // use this in place of lua_absindex to save a function call |
139 | inline StackIndex luaG_absindex(lua_State* const L_, StackIndex const idx_) | 139 | inline StackIndex luaG_absindex(lua_State* const L_, StackIndex const idx_) |
140 | { | 140 | { |
141 | return StackIndex{ (idx_ >= 0 || idx_ <= kIdxRegistry) ? idx_ : lua_gettop(L_) + idx_ + 1 }; | 141 | return StackIndex{ (idx_ >= 0 || idx_ <= kIdxRegistry) ? idx_ : StackIndex{ lua_gettop(L_) + idx_ + 1 } }; |
142 | } | 142 | } |
143 | 143 | ||
144 | // ################################################################################################# | 144 | // ################################################################################################# |
@@ -295,7 +295,7 @@ static inline void luaG_newlib(lua_State* const L_, luaL_Reg const (&funcs_)[N]) | |||
295 | // ################################################################################################# | 295 | // ################################################################################################# |
296 | 296 | ||
297 | template <typename T> | 297 | template <typename T> |
298 | [[nodiscard]] T* luaG_newuserdatauv(lua_State* L_, int nuvalue_) | 298 | [[nodiscard]] T* luaG_newuserdatauv(lua_State* L_, UserValueCount nuvalue_) |
299 | { | 299 | { |
300 | return static_cast<T*>(lua_newuserdatauv(L_, sizeof(T), nuvalue_)); | 300 | return static_cast<T*>(lua_newuserdatauv(L_, sizeof(T), nuvalue_)); |
301 | } | 301 | } |