Fixed incorrect use of _NDEBUG instead of NDEBUG
Some debugging code was compiled even in release mode because of this
This commit is contained in:
parent
a0328772b9
commit
1d3b259c0a
4 changed files with 16 additions and 16 deletions
|
@ -63,12 +63,12 @@ public:
|
||||||
{ std::string value; this->get("", key, value); return value; }
|
{ std::string value; this->get("", key, value); return value; }
|
||||||
void set(const std::string §ion, const std::string &key, const std::string &value)
|
void set(const std::string §ion, const std::string &key, const std::string &value)
|
||||||
{
|
{
|
||||||
#ifndef _NDEBUG
|
#ifndef NDEBUG
|
||||||
std::string key_trimmed = key;
|
std::string key_trimmed = key;
|
||||||
boost::trim_all(key_trimmed);
|
boost::trim_all(key_trimmed);
|
||||||
assert(key_trimmed == key);
|
assert(key_trimmed == key);
|
||||||
assert(! key_trimmed.empty());
|
assert(! key_trimmed.empty());
|
||||||
#endif // _NDEBUG
|
#endif // NDEBUG
|
||||||
std::string &old = m_storage[section][key];
|
std::string &old = m_storage[section][key];
|
||||||
if (old != value) {
|
if (old != value) {
|
||||||
old = value;
|
old = value;
|
||||||
|
|
|
@ -166,7 +166,7 @@ static bool clip_narrow_corner(
|
||||||
assert(orient1 > 0 == blocked);
|
assert(orient1 > 0 == blocked);
|
||||||
assert(orient2 > 0 == blocked);
|
assert(orient2 > 0 == blocked);
|
||||||
}
|
}
|
||||||
#endif // _NDEBUG
|
#endif // NDEBUG
|
||||||
if (polygon.size() < 3 || (forward == Far && backward == Far)) {
|
if (polygon.size() < 3 || (forward == Far && backward == Far)) {
|
||||||
polygon.clear();
|
polygon.clear();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
#include <boost/container/small_vector.hpp>
|
#include <boost/container/small_vector.hpp>
|
||||||
|
|
||||||
#ifndef _NDEBUG
|
#ifndef NDEBUG
|
||||||
#define EXPENSIVE_DEBUG_CHECKS
|
#define EXPENSIVE_DEBUG_CHECKS
|
||||||
#endif // _NDEBUG
|
#endif // NDEBUG
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ static inline Vec3i root_neighbors(const TriangleMesh &mesh, int triangle_id)
|
||||||
return neighbors;
|
return neighbors;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _NDEBUG
|
#ifndef NDEBUG
|
||||||
bool TriangleSelector::verify_triangle_midpoints(const Triangle &tr) const
|
bool TriangleSelector::verify_triangle_midpoints(const Triangle &tr) const
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 3; ++ i) {
|
for (int i = 0; i < 3; ++ i) {
|
||||||
|
@ -57,7 +57,7 @@ bool TriangleSelector::verify_triangle_neighbors(const Triangle &tr, const Vec3i
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif // _NDEBUG
|
#endif // NDEBUG
|
||||||
|
|
||||||
// sides_to_split==-1 : just restore previous split
|
// sides_to_split==-1 : just restore previous split
|
||||||
void TriangleSelector::Triangle::set_division(int sides_to_split, int special_side_idx)
|
void TriangleSelector::Triangle::set_division(int sides_to_split, int special_side_idx)
|
||||||
|
@ -308,12 +308,12 @@ int TriangleSelector::triangle_midpoint_or_allocate(int itriangle, int vertexi,
|
||||||
}
|
}
|
||||||
assert(m_vertices[midpoint].ref_cnt == 0);
|
assert(m_vertices[midpoint].ref_cnt == 0);
|
||||||
} else {
|
} else {
|
||||||
#ifndef _NDEBUG
|
#ifndef NDEBUG
|
||||||
Vec3f c1 = 0.5f * (m_vertices[vertexi].v + m_vertices[vertexj].v);
|
Vec3f c1 = 0.5f * (m_vertices[vertexi].v + m_vertices[vertexj].v);
|
||||||
Vec3f c2 = m_vertices[midpoint].v;
|
Vec3f c2 = m_vertices[midpoint].v;
|
||||||
float d = (c2 - c1).norm();
|
float d = (c2 - c1).norm();
|
||||||
assert(std::abs(d) < EPSILON);
|
assert(std::abs(d) < EPSILON);
|
||||||
#endif // _NDEBUG
|
#endif // NDEBUG
|
||||||
assert(m_vertices[midpoint].ref_cnt > 0);
|
assert(m_vertices[midpoint].ref_cnt > 0);
|
||||||
}
|
}
|
||||||
return midpoint;
|
return midpoint;
|
||||||
|
@ -816,13 +816,13 @@ void TriangleSelector::perform_split(int facet_idx, const Vec3i &neighbors, Enfo
|
||||||
assert(tr.is_split());
|
assert(tr.is_split());
|
||||||
|
|
||||||
// indices of triangle vertices
|
// indices of triangle vertices
|
||||||
#ifdef _NDEBUG
|
#ifdef NDEBUG
|
||||||
boost::container::small_vector<int, 6> verts_idxs;
|
boost::container::small_vector<int, 6> verts_idxs;
|
||||||
#else // _NDEBUG
|
#else // NDEBUG
|
||||||
// For easier debugging.
|
// For easier debugging.
|
||||||
std::vector<int> verts_idxs;
|
std::vector<int> verts_idxs;
|
||||||
verts_idxs.reserve(6);
|
verts_idxs.reserve(6);
|
||||||
#endif // _NDEBUG
|
#endif // NDEBUG
|
||||||
for (int j=0, idx = tr.special_side(); j<3; ++j, idx = next_idx_modulo(idx, 3))
|
for (int j=0, idx = tr.special_side(); j<3; ++j, idx = next_idx_modulo(idx, 3))
|
||||||
verts_idxs.push_back(tr.verts_idxs[idx]);
|
verts_idxs.push_back(tr.verts_idxs[idx]);
|
||||||
|
|
||||||
|
@ -861,13 +861,13 @@ void TriangleSelector::perform_split(int facet_idx, const Vec3i &neighbors, Enfo
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _NDEBUG
|
#ifndef NDEBUG
|
||||||
assert(this->verify_triangle_neighbors(tr, neighbors));
|
assert(this->verify_triangle_neighbors(tr, neighbors));
|
||||||
for (int i = 0; i <= tr.number_of_split_sides(); ++i) {
|
for (int i = 0; i <= tr.number_of_split_sides(); ++i) {
|
||||||
Vec3i n = this->child_neighbors(tr, neighbors, i);
|
Vec3i n = this->child_neighbors(tr, neighbors, i);
|
||||||
assert(this->verify_triangle_neighbors(m_triangles[tr.children[i]], n));
|
assert(this->verify_triangle_neighbors(m_triangles[tr.children[i]], n));
|
||||||
}
|
}
|
||||||
#endif // _NDEBUG
|
#endif // NDEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TriangleSelector::has_facets(EnforcerBlockerType state) const
|
bool TriangleSelector::has_facets(EnforcerBlockerType state) const
|
||||||
|
|
|
@ -204,10 +204,10 @@ private:
|
||||||
int triangle_midpoint(int itriangle, int vertexi, int vertexj) const;
|
int triangle_midpoint(int itriangle, int vertexi, int vertexj) const;
|
||||||
int triangle_midpoint_or_allocate(int itriangle, int vertexi, int vertexj);
|
int triangle_midpoint_or_allocate(int itriangle, int vertexi, int vertexj);
|
||||||
|
|
||||||
#ifndef _NDEBUG
|
#ifndef NDEBUG
|
||||||
bool verify_triangle_neighbors(const Triangle& tr, const Vec3i& neighbors) const;
|
bool verify_triangle_neighbors(const Triangle& tr, const Vec3i& neighbors) const;
|
||||||
bool verify_triangle_midpoints(const Triangle& tr) const;
|
bool verify_triangle_midpoints(const Triangle& tr) const;
|
||||||
#endif // _NDEBUG
|
#endif // NDEBUG
|
||||||
|
|
||||||
void get_facets_strict_recursive(
|
void get_facets_strict_recursive(
|
||||||
const Triangle &tr,
|
const Triangle &tr,
|
||||||
|
|
Loading…
Add table
Reference in a new issue