Merge pull request #5152 from sethalves/fix-build

fix debug build
This commit is contained in:
Brad Hefta-Gaub 2015-06-17 16:27:58 -07:00
commit d4f4580a7c
2 changed files with 7 additions and 3 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,9 +283,11 @@ 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;
#ifndef NDEBUG
assert(triangleIndices[t] < numPoints);
assert(triangleIndices[t + 1] < numPoints);
assert(triangleIndices[t + 2] < numPoints);
#endif
// extract raw vertices
tetraPoints[0] = p0;

View file

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