From 28e90769f74e55ea7c8f75146d5b33e0aa777da8 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Thu, 3 Jun 2021 16:55:08 +0200 Subject: Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had While at it, replace OTTD_ASSERT with WITH_ASSERT, as this is always set if assert() is valid. No matter if NDEBUG is set or not. --- src/3rdparty/squirrel/squirrel/sqcompiler.cpp | 3 +-- src/3rdparty/squirrel/squirrel/sqvm.cpp | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src/3rdparty') diff --git a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp index 00e5df04f..a80e08639 100644 --- a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp +++ b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp @@ -835,8 +835,7 @@ public: nkeys++; SQInteger val = _fs->PopTarget(); SQInteger key = _fs->PopTarget(); - SQInteger attrs = hasattrs ? _fs->PopTarget():-1; - (void)attrs; // assert only + [[maybe_unused]] SQInteger attrs = hasattrs ? _fs->PopTarget():-1; 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(); //<_can_suspend); @@ -1504,11 +1502,9 @@ bool SQVM::Call(SQObjectPtr &closure,SQInteger nparams,SQInteger stackbase,SQObj default: return false; } -#ifdef WITH_ASSERT if(!_suspended) { assert(_stackbase == prevstackbase); } -#endif return true; } -- cgit v1.2.3-70-g09d2