diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-15 18:31:15 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-15 18:31:15 +0200 |
commit | 7d94b18dcc41ccdcb5c8e9cff658b7c2a84b283f (patch) | |
tree | 871e17b3e56a44c6a244ef4f6776c53b8d3e51d3 | |
parent | ef3b67814a071b09c5959eb293f016a3095328aa (diff) | |
download | lanes-7d94b18dcc41ccdcb5c8e9cff658b7c2a84b283f.tar.gz lanes-7d94b18dcc41ccdcb5c8e9cff658b7c2a84b283f.tar.bz2 lanes-7d94b18dcc41ccdcb5c8e9cff658b7c2a84b283f.zip |
Fix incorrect int-bool conversions
-rw-r--r-- | src/cancel.cpp | 2 | ||||
-rw-r--r-- | src/compat.cpp | 2 | ||||
-rw-r--r-- | src/debug.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/cancel.cpp b/src/cancel.cpp index 2cd3c53..b14dca6 100644 --- a/src/cancel.cpp +++ b/src/cancel.cpp | |||
@@ -172,7 +172,7 @@ LUAG_FUNC(thread_cancel) | |||
172 | if (!lua_isboolean(L_, 2)) { | 172 | if (!lua_isboolean(L_, 2)) { |
173 | raise_luaL_error(L_, "wake_lindas argument is not a boolean"); | 173 | raise_luaL_error(L_, "wake_lindas argument is not a boolean"); |
174 | } | 174 | } |
175 | _wake_lane = lua_toboolean(L_, 2); | 175 | _wake_lane = lua_toboolean(L_, 2) ? true : false; |
176 | lua_remove(L_, 2); // argument is processed, remove it | 176 | lua_remove(L_, 2); // argument is processed, remove it |
177 | } | 177 | } |
178 | STACK_CHECK_START_REL(L_, 0); | 178 | STACK_CHECK_START_REL(L_, 0); |
diff --git a/src/compat.cpp b/src/compat.cpp index 8d0bc19..6bdeecc 100644 --- a/src/compat.cpp +++ b/src/compat.cpp | |||
@@ -83,7 +83,7 @@ void luaL_requiref(lua_State* L_, const char* modname_, lua_CFunction openf_, in | |||
83 | // ################################################################################################# | 83 | // ################################################################################################# |
84 | // ################################################################################################# | 84 | // ################################################################################################# |
85 | 85 | ||
86 | void* lua_newuserdatauv(lua_State* L_, size_t sz_, [[maybe_unused]] int nuvalue_) | 86 | void* lua_newuserdatauv(lua_State* const L_, size_t const sz_, [[maybe_unused]] int const nuvalue_) |
87 | { | 87 | { |
88 | LUA_ASSERT(L_, nuvalue_ <= 1); | 88 | LUA_ASSERT(L_, nuvalue_ <= 1); |
89 | return lua_newuserdata(L_, sz_); | 89 | return lua_newuserdata(L_, sz_); |
diff --git a/src/debug.h b/src/debug.h index b9a82f1..9b7137b 100644 --- a/src/debug.h +++ b/src/debug.h | |||
@@ -26,7 +26,7 @@ inline void LUA_ASSERT_IMPL(lua_State* const L_, bool const cond_, std::string_v | |||
26 | } | 26 | } |
27 | } | 27 | } |
28 | 28 | ||
29 | #define LUA_ASSERT(L_, cond_) LUA_ASSERT_IMPL(L_, cond_, #cond_) | 29 | #define LUA_ASSERT(L_, cond_) LUA_ASSERT_IMPL(L_, (cond_) ? true : false, #cond_) |
30 | #define LUA_ASSERT_CODE(code_) code_ | 30 | #define LUA_ASSERT_CODE(code_) code_ |
31 | 31 | ||
32 | class StackChecker | 32 | class StackChecker |