summaryrefslogtreecommitdiffstats
path: root/src/Bindings
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-08-04 21:04:03 +0200
committerGitHub <noreply@github.com>2016-08-04 21:04:03 +0200
commitad9fc1767321fc0bd11aaa85f4e5d81177cca7cc (patch)
treeccbb0e62481ce4944107294200c948f835494fe0 /src/Bindings
parentMerge pull request #3293 from LogicParrot/blockArea (diff)
parentFixed RasPi builds of unit tests. (diff)
downloadcuberite-ad9fc1767321fc0bd11aaa85f4e5d81177cca7cc.tar
cuberite-ad9fc1767321fc0bd11aaa85f4e5d81177cca7cc.tar.gz
cuberite-ad9fc1767321fc0bd11aaa85f4e5d81177cca7cc.tar.bz2
cuberite-ad9fc1767321fc0bd11aaa85f4e5d81177cca7cc.tar.lz
cuberite-ad9fc1767321fc0bd11aaa85f4e5d81177cca7cc.tar.xz
cuberite-ad9fc1767321fc0bd11aaa85f4e5d81177cca7cc.tar.zst
cuberite-ad9fc1767321fc0bd11aaa85f4e5d81177cca7cc.zip
Diffstat (limited to 'src/Bindings')
-rw-r--r--src/Bindings/LuaState.cpp28
-rw-r--r--src/Bindings/LuaState.h3
2 files changed, 15 insertions, 16 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index 5e6c24365..b399f9659 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -1703,42 +1703,42 @@ bool cLuaState::CopyTableFrom(cLuaState & a_SrcLuaState, int a_SrcStackIdx, int
lua_pushnil(a_SrcLuaState); // SRC: <table> <key>
while (lua_next(a_SrcLuaState, -2) != 0) // SRC: <table> <key> <value>
{
- assert(lua_gettop(a_SrcLuaState) == srcTop + 3);
- assert(lua_gettop(m_LuaState) == dstTop + 1);
+ ASSERT(lua_gettop(a_SrcLuaState) == srcTop + 3);
+ ASSERT(lua_gettop(m_LuaState) == dstTop + 1);
// Copy the key:
if (!CopySingleValueFrom(a_SrcLuaState, -2, a_NumAllowedNestingLevels)) // DST: <table> <key>
{
lua_pop(m_LuaState, 1);
lua_pop(a_SrcLuaState, 3);
- assert(lua_gettop(a_SrcLuaState) == srcTop);
- assert(lua_gettop(m_LuaState) == dstTop);
+ ASSERT(lua_gettop(a_SrcLuaState) == srcTop);
+ ASSERT(lua_gettop(m_LuaState) == dstTop);
return false;
}
- assert(lua_gettop(a_SrcLuaState) == srcTop + 3);
- assert(lua_gettop(m_LuaState) == dstTop + 2);
+ ASSERT(lua_gettop(a_SrcLuaState) == srcTop + 3);
+ ASSERT(lua_gettop(m_LuaState) == dstTop + 2);
// Copy the value:
if (!CopySingleValueFrom(a_SrcLuaState, -1, a_NumAllowedNestingLevels - 1)) // DST: <table> <key> <value>
{
lua_pop(m_LuaState, 2); // DST: empty
lua_pop(a_SrcLuaState, 3); // SRC: empty
- assert(lua_gettop(a_SrcLuaState) == srcTop);
- assert(lua_gettop(m_LuaState) == dstTop);
+ ASSERT(lua_gettop(a_SrcLuaState) == srcTop);
+ ASSERT(lua_gettop(m_LuaState) == dstTop);
return false;
}
- assert(lua_gettop(a_SrcLuaState) == srcTop + 3);
- assert(lua_gettop(m_LuaState) == dstTop + 3);
+ ASSERT(lua_gettop(a_SrcLuaState) == srcTop + 3);
+ ASSERT(lua_gettop(m_LuaState) == dstTop + 3);
// Set the value and fix up stacks:
lua_rawset(m_LuaState, -3); // DST: <table>
lua_pop(a_SrcLuaState, 1); // SRC: <table> <key>
- assert(lua_gettop(a_SrcLuaState) == srcTop + 2);
- assert(lua_gettop(m_LuaState) == dstTop + 1);
+ ASSERT(lua_gettop(a_SrcLuaState) == srcTop + 2);
+ ASSERT(lua_gettop(m_LuaState) == dstTop + 1);
}
lua_pop(a_SrcLuaState, 1); // SRC: empty
- assert(lua_gettop(a_SrcLuaState) == srcTop);
- assert(lua_gettop(m_LuaState) == dstTop + 1);
+ ASSERT(lua_gettop(a_SrcLuaState) == srcTop);
+ ASSERT(lua_gettop(m_LuaState) == dstTop + 1);
return true;
}
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h
index 106d8a783..c34feca9d 100644
--- a/src/Bindings/LuaState.h
+++ b/src/Bindings/LuaState.h
@@ -256,8 +256,7 @@ public:
{
if (m_LuaState != nullptr)
{
- auto top = lua_gettop(m_LuaState);
- ASSERT(m_StackLen == top);
+ ASSERT(m_StackLen == lua_gettop(m_LuaState));
lua_pop(m_LuaState, 1);
}
}