summaryrefslogtreecommitdiff
path: root/src/3rdparty
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-04-01 09:03:12 +0100
committerGitHub <noreply@github.com>2021-04-01 10:03:12 +0200
commit591ea9862d89787c1013c341be919dcb3a83ba06 (patch)
tree5f137c0e5d671e80461dc0c4920b38af77c99933 /src/3rdparty
parent088964a09100651798c6eb8cfffcaf79f9b5987f (diff)
downloadopenttd-591ea9862d89787c1013c341be919dcb3a83ba06.tar.xz
Codechange: Suppress warnings when asserts are disabled (#8916)
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/squirrel/squirrel/sqcompiler.cpp1
-rw-r--r--src/3rdparty/squirrel/squirrel/sqstate.cpp4
-rw-r--r--src/3rdparty/squirrel/squirrel/sqvm.cpp6
3 files changed, 8 insertions, 3 deletions
diff --git a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp
index 9eb71d457..00e5df04f 100644
--- a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp
@@ -836,6 +836,7 @@ public:
SQInteger val = _fs->PopTarget();
SQInteger key = _fs->PopTarget();
SQInteger attrs = hasattrs ? _fs->PopTarget():-1;
+ (void)attrs; // assert only
assert((hasattrs && attrs == key-1) || !hasattrs);
unsigned char flags = (hasattrs?NEW_SLOT_ATTRIBUTES_FLAG:0)|(isstatic?NEW_SLOT_STATIC_FLAG:0);
SQInteger table = _fs->TopTarget(); //<<BECAUSE OF THIS NO COMMON EMIT FUNC IS POSSIBLE
diff --git a/src/3rdparty/squirrel/squirrel/sqstate.cpp b/src/3rdparty/squirrel/squirrel/sqstate.cpp
index 35878e197..eaad6a3f7 100644
--- a/src/3rdparty/squirrel/squirrel/sqstate.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqstate.cpp
@@ -252,7 +252,9 @@ SQInteger SQSharedState::CollectGarbage(SQVM *vm)
SQVM *vms = _thread(_root_vm);
vms->Mark(&tchain);
+#ifndef NDEBUG
SQInteger x = _table(_thread(_root_vm)->_roottable)->CountUsed();
+#endif
_refs_table.Mark(&tchain);
MarkObject(_registry,&tchain);
MarkObject(_consts,&tchain);
@@ -289,8 +291,10 @@ SQInteger SQSharedState::CollectGarbage(SQVM *vm)
t = t->_next;
}
_gc_chain = tchain;
+#ifndef NDEBUG
SQInteger z = _table(_thread(_root_vm)->_roottable)->CountUsed();
assert(z == x);
+#endif
return n;
}
#endif
diff --git a/src/3rdparty/squirrel/squirrel/sqvm.cpp b/src/3rdparty/squirrel/squirrel/sqvm.cpp
index ee1acbf32..5419c94cf 100644
--- a/src/3rdparty/squirrel/squirrel/sqvm.cpp
+++ b/src/3rdparty/squirrel/squirrel/sqvm.cpp
@@ -1471,8 +1471,8 @@ bool SQVM::DeleteSlot(const SQObjectPtr &self,const SQObjectPtr &key,SQObjectPtr
bool SQVM::Call(SQObjectPtr &closure,SQInteger nparams,SQInteger stackbase,SQObjectPtr &outres,SQBool raiseerror,SQBool can_suspend)
{
-#ifdef _DEBUG
-SQInteger prevstackbase = _stackbase;
+#ifndef NDEBUG
+ SQInteger prevstackbase = _stackbase;
#endif
switch(type(closure)) {
case OT_CLOSURE: {
@@ -1504,7 +1504,7 @@ SQInteger prevstackbase = _stackbase;
default:
return false;
}
-#ifdef _DEBUG
+#ifndef NDEBUG
if(!_suspended) {
assert(_stackbase == prevstackbase);
}