From 676a7494ac851794fd1057f1f36723ebb145144b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 25 Jul 2023 16:49:50 +0200 Subject: [PATCH 1/3] fix maybe unused warning and the use of cpp23 --- Triangulation_3/test/Triangulation_3/cdt_3_from_off.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Triangulation_3/test/Triangulation_3/cdt_3_from_off.cpp b/Triangulation_3/test/Triangulation_3/cdt_3_from_off.cpp index 4308ab1eebc..39f23d514fe 100644 --- a/Triangulation_3/test/Triangulation_3/cdt_3_from_off.cpp +++ b/Triangulation_3/test/Triangulation_3/cdt_3_from_off.cpp @@ -92,7 +92,8 @@ int main(int argc, char* argv[]) try { go(mesh, output_filename); } catch(CGAL::Error_exception& e) { - if(e.message().contains(std::string("### error with cavity ###"))) { + if(e.message().find(std::string("### error with cavity ###")) != std::string::npos) + { std::cerr << "BAD MESH! " << mesh.number_of_faces() << " faces\n"; std::ofstream bad("bad.off"); bad.precision(17); @@ -206,7 +207,7 @@ int go(Mesh mesh, std::string output_filename) { std::cerr << "Polygon is not coplanar\n"; } try { - auto id = cdt.insert_constrained_polygon(polygon, true); + [[maybe_unused]] auto id = cdt.insert_constrained_polygon(polygon, true); assert(id == poly_id); ++poly_id; } catch(int error) { From 184b00a030c82b15908a93a098ecc477a318768e Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 25 Jul 2023 17:50:36 +0200 Subject: [PATCH 2/3] in Release mode with msvc, c, i and j were not initialized --- .../include/CGAL/Constrained_Delaunay_triangulation_3.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Triangulation_3/include/CGAL/Constrained_Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Constrained_Delaunay_triangulation_3.h index d1b264e49ee..af19a1ee7ea 100644 --- a/Triangulation_3/include/CGAL/Constrained_Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Constrained_Delaunay_triangulation_3.h @@ -821,7 +821,9 @@ private: for(const auto& [va, vb]: border_edges_set) { Cell_handle c; int i, j; - CGAL_assume(this->tds().is_edge(va, vb, c, i, j)); + CGAL_assertion_code(bool b =) + this->tds().is_edge(va, vb, c, i, j); + CGAL_assertion(b); border_edges.emplace_back(c, i, j); } #if CGAL_DEBUG_CDT_3 From facd881c190b5219180418f1ca2a7a39eeaa3061 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 25 Jul 2023 18:03:15 +0200 Subject: [PATCH 3/3] replace assertion by assume --- .../include/CGAL/Constrained_Delaunay_triangulation_3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Triangulation_3/include/CGAL/Constrained_Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Constrained_Delaunay_triangulation_3.h index af19a1ee7ea..e29aa27a080 100644 --- a/Triangulation_3/include/CGAL/Constrained_Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Constrained_Delaunay_triangulation_3.h @@ -821,9 +821,9 @@ private: for(const auto& [va, vb]: border_edges_set) { Cell_handle c; int i, j; - CGAL_assertion_code(bool b =) + CGAL_assume_code(bool b =) this->tds().is_edge(va, vb, c, i, j); - CGAL_assertion(b); + CGAL_assume(b); border_edges.emplace_back(c, i, j); } #if CGAL_DEBUG_CDT_3