Changeset - r25102:a957c7093816
[Not reviewed]
master
0 8 0
Charles Pigott - 3 years ago 2021-04-01 22:57:49
charlespigott@googlemail.com
Fix #8919: Release builds with asserts enabled (#8925)
8 files changed with 17 insertions and 17 deletions:
0 comments (0 inline, 0 general)
src/3rdparty/squirrel/squirrel/sqstate.cpp
Show inline comments
 
@@ -252,7 +252,7 @@ SQInteger SQSharedState::CollectGarbage(
 
	SQVM *vms = _thread(_root_vm);
 

	
 
	vms->Mark(&tchain);
 
#ifndef NDEBUG
 
#ifdef WITH_ASSERT
 
	SQInteger x = _table(_thread(_root_vm)->_roottable)->CountUsed();
 
#endif
 
	_refs_table.Mark(&tchain);
 
@@ -291,7 +291,7 @@ SQInteger SQSharedState::CollectGarbage(
 
		t = t->_next;
 
	}
 
	_gc_chain = tchain;
 
#ifndef NDEBUG
 
#ifdef WITH_ASSERT
 
	SQInteger z = _table(_thread(_root_vm)->_roottable)->CountUsed();
 
	assert(z == x);
 
#endif
src/3rdparty/squirrel/squirrel/sqvm.cpp
Show inline comments
 
@@ -1460,7 +1460,7 @@ bool SQVM::DeleteSlot(const SQObjectPtr 
 
			}
 
		}
 
		res = t;
 
				}
 
	}
 
		break;
 
	default:
 
		Raise_Error("attempt to delete a slot from a %s",GetTypeName(self));
 
@@ -1471,7 +1471,7 @@ bool SQVM::DeleteSlot(const SQObjectPtr 
 

	
 
bool SQVM::Call(SQObjectPtr &closure,SQInteger nparams,SQInteger stackbase,SQObjectPtr &outres,SQBool raiseerror,SQBool can_suspend)
 
{
 
#ifndef NDEBUG
 
#ifdef WITH_ASSERT
 
	SQInteger prevstackbase = _stackbase;
 
#endif
 
	switch(type(closure)) {
 
@@ -1482,13 +1482,13 @@ bool SQVM::Call(SQObjectPtr &closure,SQI
 
		bool ret = Execute(closure, _top - nparams, nparams, stackbase,outres,raiseerror);
 
		this->_can_suspend = backup_suspend;
 
		return ret;
 
					 }
 
	}
 
		break;
 
	case OT_NATIVECLOSURE:{
 
	case OT_NATIVECLOSURE: {
 
		bool suspend;
 
		return CallNative(_nativeclosure(closure), nparams, stackbase, outres,suspend);
 

	
 
						  }
 
	}
 
		break;
 
	case OT_CLASS: {
 
		SQObjectPtr constr;
 
@@ -1499,12 +1499,12 @@ bool SQVM::Call(SQObjectPtr &closure,SQI
 
			return Call(constr,nparams,stackbase,temp,raiseerror,false);
 
		}
 
		return true;
 
				   }
 
	}
 
		break;
 
	default:
 
		return false;
 
	}
 
#ifndef NDEBUG
 
#ifdef WITH_ASSERT
 
	if(!_suspended) {
 
		assert(_stackbase == prevstackbase);
 
	}
src/spritecache.cpp
Show inline comments
 
@@ -229,7 +229,7 @@ static void ResizeSpriteOut(SpriteLoader
 

	
 
	SpriteLoader::CommonPixel *dst = sprite[zoom].data;
 
	const SpriteLoader::CommonPixel *src = sprite[zoom - 1].data;
 
#ifndef NDEBUG
 
#ifdef WITH_ASSERT
 
	const SpriteLoader::CommonPixel *src_end = src + sprite[zoom - 1].height * sprite[zoom - 1].width;
 
#endif
 

	
src/tgp.cpp
Show inline comments
 
@@ -658,7 +658,7 @@ static void HeightMapCurves(uint level)
 
			for (uint t = 0; t < lengthof(curve_maps); t++) {
 
				if (!HasBit(corner_bits, t)) continue;
 

	
 
#ifndef NDEBUG
 
#ifdef WITH_ASSERT
 
				bool found = false;
 
#endif
 
				const control_point_t *cm = curve_maps[t].list;
 
@@ -668,7 +668,7 @@ static void HeightMapCurves(uint level)
 

	
 
					if (*h >= p1.x && *h < p2.x) {
 
						ht[t] = p1.y + (*h - p1.x) * (p2.y - p1.y) / (p2.x - p1.x);
 
#ifndef NDEBUG
 
#ifdef WITH_ASSERT
 
						found = true;
 
#endif
 
						break;
src/town_cmd.cpp
Show inline comments
 
@@ -107,7 +107,7 @@ Town::~Town()
 
	DeleteWindowById(WC_TOWN_VIEW, this->index);
 

	
 
	/* Check no industry is related to us. */
 
#ifndef NDEBUG
 
#ifdef WITH_ASSERT
 
	for (const Industry *i : Industry::Iterate()) assert(i->town != this);
 

	
 
	/* ... and no object is related to us. */
src/townname.cpp
Show inline comments
 
@@ -600,7 +600,7 @@ static char *MakeCzechTownName(char *buf
 
		return strecpy(buf, _name_czech_real[SeedModChance(4, lengthof(_name_czech_real), seed)], last);
 
	}
 

	
 
#ifndef NDEBUG
 
#ifdef WITH_ASSERT
 
	const char *orig = buf;
 
#endif
 

	
src/vehicle.cpp
Show inline comments
 
@@ -953,7 +953,7 @@ void CallVehicleTicks()
 
	PerformanceAccumulator::Reset(PFE_GL_AIRCRAFT);
 

	
 
	for (Vehicle *v : Vehicle::Iterate()) {
 
#ifndef NDEBUG
 
#ifdef WITH_ASSERT
 
		size_t vehicle_index = v->index;
 
#endif
 

	
src/widget.cpp
Show inline comments
 
@@ -1156,7 +1156,7 @@ void NWidgetHorizontal::SetupSmallestSiz
 
		this->smallest_y = std::max(this->smallest_y, child_wid->smallest_y + child_wid->padding_top + child_wid->padding_bottom);
 
	}
 
	/* 1b. Make the container higher if needed to accommodate all children nicely. */
 
#ifndef NDEBUG
 
#ifdef WITH_ASSERT
 
	uint max_smallest = this->smallest_y + 3 * max_vert_fill; // Upper limit to computing smallest height.
 
#endif
 
	uint cur_height = this->smallest_y;
 
@@ -1323,7 +1323,7 @@ void NWidgetVertical::SetupSmallestSize(
 
		this->smallest_x = std::max(this->smallest_x, child_wid->smallest_x + child_wid->padding_left + child_wid->padding_right);
 
	}
 
	/* 1b. Make the container wider if needed to accommodate all children nicely. */
 
#ifndef NDEBUG
 
#ifdef WITH_ASSERT
 
	uint max_smallest = this->smallest_x + 3 * max_hor_fill; // Upper limit to computing smallest height.
 
#endif
 
	uint cur_width = this->smallest_x;
0 comments (0 inline, 0 general)