fix ifdefs around asserts

This commit is contained in:
Seth Alves 2015-06-17 15:03:09 -07:00
parent 44bb220130
commit 68df6b662d
2 changed files with 4 additions and 4 deletions

View file

@ -270,7 +270,7 @@ void MeshMassProperties::computeMassProperties(const VectorOfPoints& points, con
}
// create some variables to hold temporary results
#ifdef DEBUG
#ifndef NDEBUG
uint32_t numPoints = points.size();
#endif
const btVector3 p0(0.0f, 0.0f, 0.0f);
@ -283,7 +283,7 @@ void MeshMassProperties::computeMassProperties(const VectorOfPoints& points, con
uint32_t numTriangles = triangleIndices.size() / 3;
for (uint32_t i = 0; i < numTriangles; ++i) {
uint32_t t = 3 * i;
#ifdef DEBUG
#ifndef NDEBUG
assert(triangleIndices[t] < numPoints);
assert(triangleIndices[t + 1] < numPoints);
assert(triangleIndices[t + 2] < numPoints);

View file

@ -118,13 +118,13 @@ public:
template <typename Function>
void withPush(Function f) {
#ifdef DEBUG
#ifndef NDEBUG
size_t startingDepth = size();
#endif
push();
f();
pop();
#ifdef DEBUG
#ifndef NDEBUG
assert(startingDepth == size());
#endif
}