summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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
-rw-r--r--src/blitter/factory.hpp5
-rw-r--r--src/pathfinder/npf/npf.cpp7
5 files changed, 14 insertions, 9 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);
}
diff --git a/src/blitter/factory.hpp b/src/blitter/factory.hpp
index c76126fb5..94f3f9998 100644
--- a/src/blitter/factory.hpp
+++ b/src/blitter/factory.hpp
@@ -61,13 +61,14 @@ protected:
name(name), description(description)
{
if (usable) {
+ Blitters &blitters = GetBlitters();
+ assert(blitters.find(this->name) == blitters.end());
/*
* Only add when the blitter is usable. Do not bail out or
* do more special things since the blitters are always
* instantiated upon start anyhow and freed upon shutdown.
*/
- std::pair<Blitters::iterator, bool> P = GetBlitters().insert(Blitters::value_type(this->name, this));
- assert(P.second);
+ blitters.insert(Blitters::value_type(this->name, this));
} else {
DEBUG(driver, 1, "Not registering blitter %s as it is not usable", name);
}
diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp
index 5a5ff927e..315b43b0e 100644
--- a/src/pathfinder/npf/npf.cpp
+++ b/src/pathfinder/npf/npf.cpp
@@ -1000,9 +1000,6 @@ static void NPFFollowTrack(AyStar *aystar, OpenListNode *current)
*/
static NPFFoundTargetData NPFRouteInternal(AyStarNode *start1, bool ignore_start_tile1, AyStarNode *start2, bool ignore_start_tile2, NPFFindStationOrTileData *target, AyStar_EndNodeCheck target_proc, AyStar_CalculateH heuristic_proc, AyStarUserData *user, uint reverse_penalty, bool ignore_reserved = false, int max_penalty = 0)
{
- int r;
- NPFFoundTargetData result;
-
/* Initialize procs */
_npf_aystar.max_path_cost = max_penalty;
_npf_aystar.CalculateH = heuristic_proc;
@@ -1032,6 +1029,7 @@ static NPFFoundTargetData NPFRouteInternal(AyStarNode *start1, bool ignore_start
}
/* Initialize result */
+ NPFFoundTargetData result;
result.best_bird_dist = UINT_MAX;
result.best_path_dist = UINT_MAX;
result.best_trackdir = INVALID_TRACKDIR;
@@ -1046,7 +1044,8 @@ static NPFFoundTargetData NPFRouteInternal(AyStarNode *start1, bool ignore_start
_npf_aystar.user_data = user;
/* GO! */
- r = _npf_aystar.Main();
+ int r = _npf_aystar.Main();
+ (void)r; // assert only
assert(r != AYSTAR_STILL_BUSY);
if (result.best_bird_dist != 0) {