summaryrefslogtreecommitdiffstats
path: root/src/Bindings
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-08-02 13:12:34 +0200
committerMattes D <github@xoft.cz>2016-08-04 20:47:53 +0200
commitd1dee3c9092b7c270b297366757c9fc8d03bb0dd (patch)
treeccbb0e62481ce4944107294200c948f835494fe0 /src/Bindings
parentMerge pull request #3293 from LogicParrot/blockArea (diff)
downloadcuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.tar
cuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.tar.gz
cuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.tar.bz2
cuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.tar.lz
cuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.tar.xz
cuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.tar.zst
cuberite-d1dee3c9092b7c270b297366757c9fc8d03bb0dd.zip
Diffstat (limited to '')
-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);
}
}