aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-10-15 18:31:15 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-10-15 18:31:15 +0200
commit7d94b18dcc41ccdcb5c8e9cff658b7c2a84b283f (patch)
tree871e17b3e56a44c6a244ef4f6776c53b8d3e51d3
parentef3b67814a071b09c5959eb293f016a3095328aa (diff)
downloadlanes-7d94b18dcc41ccdcb5c8e9cff658b7c2a84b283f.tar.gz
lanes-7d94b18dcc41ccdcb5c8e9cff658b7c2a84b283f.tar.bz2
lanes-7d94b18dcc41ccdcb5c8e9cff658b7c2a84b283f.zip
Fix incorrect int-bool conversions
-rw-r--r--src/cancel.cpp2
-rw-r--r--src/compat.cpp2
-rw-r--r--src/debug.h2
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
86void* lua_newuserdatauv(lua_State* L_, size_t sz_, [[maybe_unused]] int nuvalue_) 86void* 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
32class StackChecker 32class StackChecker