diff --git a/BGL/include/CGAL/boost/graph/graph_traits_TriMesh_ArrayKernelT.h b/BGL/include/CGAL/boost/graph/graph_traits_TriMesh_ArrayKernelT.h index fad7d6698d6..86b874b2cb5 100644 --- a/BGL/include/CGAL/boost/graph/graph_traits_TriMesh_ArrayKernelT.h +++ b/BGL/include/CGAL/boost/graph/graph_traits_TriMesh_ArrayKernelT.h @@ -572,13 +572,13 @@ typename boost::graph_traits >::face_descripto add_face(InputIterator begin, InputIterator end, OpenMesh::TriMesh_ArrayKernelT& sm) { typedef typename boost::graph_traits >::vertex_descriptor vertex_descriptor; - assert(begin!= end); + CGAL_assertion(begin!= end); vertex_descriptor u = *begin; ++begin; - assert(begin!= end); + CGAL_assertion(begin!= end); vertex_descriptor v = *begin; ++begin; - assert(begin!= end); + CGAL_assertion(begin!= end); vertex_descriptor w = *begin; return sm.add_face(u,v,w); diff --git a/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h b/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h index 75c33c88787..0eceac3d584 100644 --- a/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h +++ b/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h @@ -137,7 +137,7 @@ BigFloatRep::BigFloatRep(double d) : m(0), err(0), exp(0) { stop++; } #ifdef CORE_DEBUG - assert (s >= 0); + CGAL_assertion (s >= 0); #endif if (s) @@ -277,7 +277,7 @@ void BigFloatRep::normal() { long f = chunkFloor(--le); // f is roughly equal to floor(le/CHUNK_BIT) long bits_f = bits(f); // f chunks will have bits_f many bits #ifdef CORE_DEBUG - assert (bits_f >= 0); + CGAL_assertion (bits_f >= 0); #endif m >>= bits_f; // reduce mantissa by bits_f many bits @@ -305,7 +305,7 @@ void BigFloatRep::bigNormal(BigInt& bigErr) { long f = chunkFloor(--le); long bits_f = bits(f); #ifdef CORE_DEBUG - assert(bits_f >= 0); + CGAL_assertion(bits_f >= 0); #endif m >>= bits_f; @@ -684,7 +684,7 @@ void BigFloatRep::sqrt(const BigFloatRep& x, const extLong& a, const BigFloat& A m = chunkShift(z.m, chunkCeil(p)); long r = CHUNK_BIT - 1 - (p + CHUNK_BIT - 1) % CHUNK_BIT; #ifdef CORE_DEBUG - assert(r >= 0); + CGAL_assertion(r >= 0); #endif err = 1 >> r; @@ -727,7 +727,7 @@ void BigFloatRep::sqrt(const BigFloatRep& x, const extLong& a, const BigFloat& A m = chunkShift(z.m, chunkCeil(q)); long r = CHUNK_BIT - 1 - (q + CHUNK_BIT - 1) % CHUNK_BIT; #ifdef CORE_DEBUG - assert(r >= 0); + CGAL_assertion(r >= 0); #endif err = 1 >> r; @@ -961,7 +961,7 @@ BigFloatRep::toDecimal(unsigned int width, bool Scientific) const { decOut.isScientific = false; } #ifdef CORE_DEBUG - assert(decOut.noSignificant >= 0); + CGAL_assertion(decOut.noSignificant >= 0); #endif decOut.rep = decRep; @@ -1025,7 +1025,7 @@ void BigFloatRep :: fromString(const char *str, const extLong & prec ) { else { e = str + strlen(str); #ifdef CORE_DEBUG - assert(*e == '\0'); + CGAL_assertion(*e == '\0'); #endif } @@ -1116,7 +1116,7 @@ std::istream& BigFloatRep :: operator >>(std::istream& i) { size *= 2; } #ifdef CORE_DEBUG - assert((p-str) < size); + CGAL_assertion((p-str) < size); #endif *p++ = c; @@ -1142,7 +1142,7 @@ std::istream& BigFloatRep :: operator >>(std::istream& i) { } #ifdef CORE_DEBUG - assert(p - str < size); + CGAL_assertion(p - str < size); #endif *p = '\0'; @@ -1229,7 +1229,7 @@ BigInt BigFloatRep::toBigInt() const { if (le == -1) le = 0; #ifdef CORE_DEBUG - assert (le >= 0); + CGAL_assertion (le >= 0); #endif BigInt M = m >> static_cast(le); // discard the contaminated bits. @@ -1249,7 +1249,7 @@ long BigFloatRep :: toLong() const { long e2 = bits(exp); long le = clLg(err); #ifdef CORE_DEBUG - assert (le >= 0); + CGAL_assertion (le >= 0); #endif BigInt M = m >> static_cast(le); // discard the contaminated bits. diff --git a/CGAL_Core/include/CGAL/CORE/Expr_impl.h b/CGAL_Core/include/CGAL/CORE/Expr_impl.h index 5cd7a685e62..550a9feb473 100644 --- a/CGAL_Core/include/CGAL/CORE/Expr_impl.h +++ b/CGAL_Core/include/CGAL/CORE/Expr_impl.h @@ -130,7 +130,7 @@ BigInt floor(const Expr& e, Expr &sub) { ++sub, --f; if (sub>=1) --sub, ++f; - assert(sub >=0 && sub<1); // got an assertion error? (Chee 3/24/04) + CGAL_assertion(sub >=0 && sub<1); // got an assertion error? (Chee 3/24/04) return f; } @@ -241,7 +241,7 @@ extLong ExprRep::computeBound() { std::cerr << " ourBd is the winner " << std::endl; } - assert(number_of_winners >= 1); + CGAL_assertion(number_of_winners >= 1); if (number_of_winners == 1) { if (bd == bfmsskBd) { diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h index 4bb17e203c5..46b2cc91e4b 100644 --- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h +++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h @@ -126,7 +126,7 @@ void MemoryPool< T, nObjects >::free(void* t) { if(blocks.empty()){ std::cerr << typeid(T).name() << std::endl; } - assert (! blocks.empty()); + CGAL_assertion (! blocks.empty()); // recycle the object memory, by putting it back into the chain reinterpret_cast(t)->next = head; diff --git a/CGAL_Core/include/CGAL/CORE/Real_impl.h b/CGAL_Core/include/CGAL/CORE/Real_impl.h index 8da773d93b5..dc005162c29 100644 --- a/CGAL_Core/include/CGAL/CORE/Real_impl.h +++ b/CGAL_Core/include/CGAL/CORE/Real_impl.h @@ -65,7 +65,7 @@ BigInt floor(const Real& r, Real &sub) { ++sub, --f; if (sub>=1) --sub, ++f; - assert(sub >=0 && sub<1); + CGAL_assertion(sub >=0 && sub<1); return f; } @@ -145,7 +145,7 @@ void Real::constructFromString(const char *str, const extLong& prec ) else { e = str + std::strlen(str); #ifdef CORE_DEBUG - assert(*e == '\0'); + CGAL_assertion(*e == '\0'); #endif } @@ -246,7 +246,7 @@ std::istream& operator >>(std::istream& i, Real& x) { size *= 2; } #ifdef CORE_DEBUG - assert((p-str) < size); + CGAL_assertion((p-str) < size); #endif *p++ = c; @@ -276,7 +276,7 @@ std::istream& operator >>(std::istream& i, Real& x) { } #ifdef CORE_DEBUG - assert(p - str < size); + CGAL_assertion(p - str < size); #endif *p = '\0'; diff --git a/Kinetic_data_structures/include/CGAL/Polynomial/internal/macros.h b/Kinetic_data_structures/include/CGAL/Polynomial/internal/macros.h index 8cb7c188591..de7d728725f 100644 --- a/Kinetic_data_structures/include/CGAL/Polynomial/internal/macros.h +++ b/Kinetic_data_structures/include/CGAL/Polynomial/internal/macros.h @@ -57,11 +57,11 @@ #include -#define CGAL_Polynomial_assertion(x) assert(x) +#define CGAL_Polynomial_assertion(x) CGAL_assertion(x) // This does not work #define CGAL_Polynomial_assertion_code(x) x -#define CGAL_Polynomial_precondition(x) assert(x) -#define CGAL_Polynomial_postcondition(x) assert(x) +#define CGAL_Polynomial_precondition(x) CGAL_assertion(x) +#define CGAL_Polynomial_postcondition(x) CGAL_assertion(x) #define CGAL_Polynomial_expensive_precondition(x) #define CGAL_Polynomial_expensive_assertion(x) #define CGAL_Polynomial_expensive_postcondition(x) diff --git a/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h b/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h index 0a38ef99efa..ca83aafde9e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h +++ b/Mesh_3/include/CGAL/Mesh_3/polylines_to_protect.h @@ -244,12 +244,12 @@ polylines_to_protect(const CGAL::Image_3& cgal_image, // switch(pixel_values_set.size()) { case 4: { - assert(get<2>(square[0][0]) != get<2>(square[0][1])); - assert(get<2>(square[0][0]) != get<2>(square[1][0])); - assert(get<2>(square[0][0]) != get<2>(square[1][1])); - assert(get<2>(square[1][0]) != get<2>(square[1][1])); - assert(get<2>(square[0][1]) != get<2>(square[1][1])); - assert(get<2>(square[0][1]) != get<2>(square[1][0])); + CGAL_assertion(get<2>(square[0][0]) != get<2>(square[0][1])); + CGAL_assertion(get<2>(square[0][0]) != get<2>(square[1][0])); + CGAL_assertion(get<2>(square[0][0]) != get<2>(square[1][1])); + CGAL_assertion(get<2>(square[1][0]) != get<2>(square[1][1])); + CGAL_assertion(get<2>(square[0][1]) != get<2>(square[1][1])); + CGAL_assertion(get<2>(square[0][1]) != get<2>(square[1][0])); case_4: // case 4 or case 2-2 ++case4; @@ -273,10 +273,10 @@ case_4: } if(get<2>(square[0][1]) == get<2>(square[1][0])) { // diagonal case 1-2-1 - assert(get<2>(square[0][1]) == get<2>(square[1][0])); - assert(get<2>(square[1][1]) != get<2>(square[0][0])); - assert(get<2>(square[0][1]) != get<2>(square[0][0])); - assert(get<2>(square[0][1]) != get<2>(square[1][1])); + CGAL_assertion(get<2>(square[0][1]) == get<2>(square[1][0])); + CGAL_assertion(get<2>(square[1][1]) != get<2>(square[0][0])); + CGAL_assertion(get<2>(square[0][1]) != get<2>(square[0][0])); + CGAL_assertion(get<2>(square[0][1]) != get<2>(square[1][1])); ++case121; vertex_descriptor left = g_manip.split(p00, p01, out00, out01); vertex_descriptor right = g_manip.split(p10, p11, out10, out11); @@ -323,10 +323,10 @@ case_4: std::swap(square[0][0], square[1][0]); std::swap(out00, out10); std::swap(square[0][1], square[1][1]); std::swap(out01, out11); } - assert(get<2>(square[0][0]) == get<2>(square[0][1])); - assert(get<2>(square[0][0]) != get<2>(square[1][0])); - assert(get<2>(square[0][0]) != get<2>(square[1][1])); - assert(get<2>(square[1][0]) != get<2>(square[1][1])); + CGAL_assertion(get<2>(square[0][0]) == get<2>(square[0][1])); + CGAL_assertion(get<2>(square[0][0]) != get<2>(square[1][0])); + CGAL_assertion(get<2>(square[0][0]) != get<2>(square[1][1])); + CGAL_assertion(get<2>(square[1][0]) != get<2>(square[1][1])); ++case211; Point_3 midleft = midpoint(p00, p01); Point_3 midright = midpoint(p10, p11); @@ -375,34 +375,34 @@ case_4: if(get<2>(square[0][0])==get<2>(square[1][0])) { // case 2-2, diagonal swap std::swap(square[0][1], square[1][0]); std::swap(out01, out10); - assert(get<2>(square[0][0])==get<2>(square[0][1])); + CGAL_assertion(get<2>(square[0][0])==get<2>(square[0][1])); } if(get<2>(square[1][0])==get<2>(square[1][1])) { // case 2-2, vertical swap std::swap(square[0][1], square[1][1]); std::swap(out01, out11); std::swap(square[0][0], square[1][0]); std::swap(out00, out10); - assert(get<2>(square[0][0])==get<2>(square[0][1])); + CGAL_assertion(get<2>(square[0][0])==get<2>(square[0][1])); } if(get<2>(square[0][1])==get<2>(square[1][1])) { // case 2-2, diagonal swap std::swap(square[0][0], square[1][1]); std::swap(out00, out11); - assert(get<2>(square[0][0])==get<2>(square[0][1])); + CGAL_assertion(get<2>(square[0][0])==get<2>(square[0][1])); } if(get<2>(square[0][0])==get<2>(square[0][1])) { // vertical case 2-2 ++case22; - assert(get<2>(square[1][0])==get<2>(square[1][1])); - assert(get<2>(square[1][0])!=get<2>(square[0][1])); + CGAL_assertion(get<2>(square[1][0])==get<2>(square[1][1])); + CGAL_assertion(get<2>(square[1][0])!=get<2>(square[0][1])); vertex_descriptor top = g_manip.split(p01, p11, out01, out11); vertex_descriptor bottom = g_manip.split(p00, p10, out00, out10); g_manip.try_add_edge(top, bottom); } else { // Else diagonal case case 2-2 // Same as the case with 4 colors - assert(get<2>(square[0][0])==get<2>(square[1][1])); - assert(get<2>(square[1][0])==get<2>(square[0][1])); - assert(get<2>(square[0][0])!=get<2>(square[0][1])); + CGAL_assertion(get<2>(square[0][0])==get<2>(square[1][1])); + CGAL_assertion(get<2>(square[1][0])==get<2>(square[0][1])); + CGAL_assertion(get<2>(square[0][0])!=get<2>(square[0][1])); goto case_4; } } @@ -412,33 +412,33 @@ case_4: if(pixel_values_set.begin()->second == 1) { value_alone = pixel_values_set.begin()->first; } else { - assert(pixel_values_set.begin()->second == 3); - assert(pixel_values_set.rbegin()->second ==1); + CGAL_assertion(pixel_values_set.begin()->second == 3); + CGAL_assertion(pixel_values_set.rbegin()->second ==1); value_alone = pixel_values_set.rbegin()->first; } if(get<2>(square[0][1]) == value_alone) { // central symmetry std::swap(square[0][1], square[1][0]); std::swap(out01, out10); std::swap(square[0][0], square[1][1]); std::swap(out00, out11); - assert(get<2>(square[1][0]) == value_alone); + CGAL_assertion(get<2>(square[1][0]) == value_alone); } if(get<2>(square[1][1]) == value_alone) { // vertical swap std::swap(square[0][0], square[0][1]); std::swap(out00, out01); std::swap(square[1][0], square[1][1]); std::swap(out10, out11); - assert(get<2>(square[1][0]) == value_alone); + CGAL_assertion(get<2>(square[1][0]) == value_alone); } if(get<2>(square[0][0]) == value_alone) { // horizontal swap std::swap(square[0][1], square[1][1]); std::swap(out01, out11); std::swap(square[0][0], square[1][0]); std::swap(out00, out10); - assert(get<2>(square[1][0]) == value_alone); + CGAL_assertion(get<2>(square[1][0]) == value_alone); } ++case31; - assert(get<2>(square[1][0]) == value_alone); - assert(get<2>(square[1][0]) != get<2>(square[0][0])); - assert(get<2>(square[1][1]) == get<2>(square[0][0])); - assert(get<2>(square[0][1]) == get<2>(square[0][0])); + CGAL_assertion(get<2>(square[1][0]) == value_alone); + CGAL_assertion(get<2>(square[1][0]) != get<2>(square[0][0])); + CGAL_assertion(get<2>(square[1][1]) == get<2>(square[0][0])); + CGAL_assertion(get<2>(square[0][1]) == get<2>(square[0][0])); vertex_descriptor bottom = g_manip.split(p00, p10, out00, out10); vertex_descriptor old = bottom; diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h index 9843d98375c..daef9cee9f2 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h @@ -351,7 +351,7 @@ public: { internal::Ply_read_typed_number* reader = dynamic_cast*>(m_readers[i]); - assert (reader != NULL); + CGAL_assertion (reader != NULL); t = reader->buffer(); return; } @@ -389,7 +389,7 @@ public: { internal::Ply_read_typed_number* reader_float = dynamic_cast*>(m_readers[i]); - assert (reader_float != NULL); + CGAL_assertion (reader_float != NULL); t = reader_float->buffer(); } else diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index a6b4aceeee8..2669bea71e8 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -2534,7 +2534,7 @@ private: //------------------------------------------------------- private data std::string off; is >> sm_skip_comments; is >> off; - assert( (off == "OFF") || (off == "COFF") || (off == "NOFF") || (off == "CNOFF")); + CGAL_assertion( (off == "OFF") || (off == "COFF") || (off == "NOFF") || (off == "CNOFF")); is >> n >> f >> e;