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 // create some variables to hold temporary results
#ifdef DEBUG #ifndef NDEBUG
uint32_t numPoints = points.size(); uint32_t numPoints = points.size();
#endif #endif
const btVector3 p0(0.0f, 0.0f, 0.0f); 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; uint32_t numTriangles = triangleIndices.size() / 3;
for (uint32_t i = 0; i < numTriangles; ++i) { for (uint32_t i = 0; i < numTriangles; ++i) {
uint32_t t = 3 * i; uint32_t t = 3 * i;
#ifndef NDEBUG
assert(triangleIndices[t] < numPoints); assert(triangleIndices[t] < numPoints);
assert(triangleIndices[t + 1] < numPoints); assert(triangleIndices[t + 1] < numPoints);
assert(triangleIndices[t + 2] < numPoints); assert(triangleIndices[t + 2] < numPoints);
#endif
// extract raw vertices // extract raw vertices
tetraPoints[0] = p0; tetraPoints[0] = p0;

View file

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