From ea15e10289b109ffe8fe7dcad9b7568e50f6cc85 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Mon, 1 Sep 2025 13:21:53 +0200 Subject: [PATCH] removing unused variables or adding CGAL_USE --- Lab/demo/Lab/triangulate_primitive.h | 5 ----- Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h | 6 +----- Partition_2/include/CGAL/partition_is_valid_2.h | 1 + .../internal/Dehn_hyperbolic_octagon_translation_word.h | 3 --- Point_set_processing_3/include/CGAL/IO/write_las_points.h | 8 +++++++- .../include/CGAL/Polyline_simplification_2/simplify.h | 3 +-- SMDS_3/include/CGAL/IO/File_maya.h | 7 +++---- .../Surface_mesh_simplification/internal/Edge_collapse.h | 2 ++ .../Segment_Delaunay_graph_degeneracy_testers.h | 2 ++ 9 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Lab/demo/Lab/triangulate_primitive.h b/Lab/demo/Lab/triangulate_primitive.h index 54fceb64eb3..8093ed4e3bc 100644 --- a/Lab/demo/Lab/triangulate_primitive.h +++ b/Lab/demo/Lab/triangulate_primitive.h @@ -145,14 +145,9 @@ private: Vertex_handle previous, first, last_inserted; // Iterate the points of the facet and decide if they must be inserted in the CDT - typename Kernel::FT x(0), y(0), z(0); - for(std::size_t i = 0;i& idPoint = idPoints[i]; - x += idPoint.first.x(); - y += idPoint.first.y(); - z += idPoint.first.z(); Vertex_handle vh; // Always insert the first point, then only insert if the distance with the previous is reasonable. diff --git a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h index 2c0539b9be0..8d452ee8036 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h +++ b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h @@ -1285,8 +1285,6 @@ perturb_vertex( PVertex pv CGAL_assertion(pv.is_perturbable()); - int num_new_vertices_to_treat = 0; - Cell_vector slivers; slivers.reserve(8); if (!helper_.try_lock_and_get_incident_slivers( @@ -1349,8 +1347,7 @@ perturb_vertex( PVertex pv pv.increment_try_nb(); // update modified vertices - num_new_vertices_to_treat += - update_priority_queue(modified_vertices, sliver_bound, visitor, bad_vertices); + update_priority_queue(modified_vertices, sliver_bound, visitor, bad_vertices); } else { @@ -1372,7 +1369,6 @@ perturb_vertex( PVertex pv if (pv.is_perturbable()) { enqueue_task(pv, sliver_bound, visitor, bad_vertices); - ++num_new_vertices_to_treat; } } else diff --git a/Partition_2/include/CGAL/partition_is_valid_2.h b/Partition_2/include/CGAL/partition_is_valid_2.h index f6a5f2bbd7f..1c33e9e42b0 100644 --- a/Partition_2/include/CGAL/partition_is_valid_2.h +++ b/Partition_2/include/CGAL/partition_is_valid_2.h @@ -157,6 +157,7 @@ partition_is_valid_2 (InputIterator point_first, InputIterator point_last, int poly_num = 0; for (; poly_first != poly_last; poly_first++, poly_num++) { + CGAL_USE(poly_num); vtx_begin = (*poly_first).vertices_begin(); vtx_end = (*poly_first).vertices_end(); #ifdef CGAL_PARTITION_CHECK_DEBUG diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Dehn_hyperbolic_octagon_translation_word.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Dehn_hyperbolic_octagon_translation_word.h index 709da137caf..bfdf687f2ec 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Dehn_hyperbolic_octagon_translation_word.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Dehn_hyperbolic_octagon_translation_word.h @@ -89,7 +89,6 @@ private: { Word_idx_type start = 0; Word_idx_type mstart = 0; - Word_idx_type end = 1; Word_idx_type max = 1; Word_idx_type len = 1; std::vector tmp, mvec; @@ -98,7 +97,6 @@ private: { if(is_next_relation_index(w[i], w[i-1])) { - end++; len++; tmp.push_back(w[i]); if(len > max) { @@ -112,7 +110,6 @@ private: tmp.clear(); tmp.push_back(w[i]); start = i; - end = i; len = 0; } } diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index f3a96c919fd..56d8d84b2e3 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -103,7 +103,13 @@ namespace LAS { inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::Withheld_flag&) { r.set_withheld_flag(v); } inline void output_value(LASpoint& r, const float& v, const LAS_property::Scan_angle&) - { r.set_scan_angle_rank(char(v)); } + { +#if LAS_TOOLS_VERSION < 250517 + r.set_scan_angle_rank(v); +#else + r.set_scan_angle(v); +#endif + } inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::User_data&) { r.set_user_data(v); } inline void output_value(LASpoint& r, const unsigned short& v, const LAS_property::Point_source_ID&) diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h index 9e7fe636d01..b2828d617d0 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h @@ -232,10 +232,9 @@ public: void initialize_costs() { - int n=0; Constraint_iterator cit = pct.constraints_begin(), e = pct.constraints_end(); for(; cit!=e; ++cit){ - n+= initialize_costs(*cit); + initialize_costs(*cit); } } diff --git a/SMDS_3/include/CGAL/IO/File_maya.h b/SMDS_3/include/CGAL/IO/File_maya.h index 682f9540642..bc49db38dd8 100644 --- a/SMDS_3/include/CGAL/IO/File_maya.h +++ b/SMDS_3/include/CGAL/IO/File_maya.h @@ -150,10 +150,10 @@ output_to_maya(std::ostream& os, { facets_sstr << " setAttr -s " << number_of_triangles << " \".fc[0:" << number_of_triangles-1 << "]\" -type \"polyFaces\" \n"; - int c = 0; + for( Facet_iterator fit = c3t3.facets_in_complex_begin(); fit != c3t3.facets_in_complex_end(); - ++fit, ++c) + ++fit) { int indices[3]; //Weighted_point points[3]; @@ -207,10 +207,9 @@ output_to_maya(std::ostream& os, { facets_sstr << " setAttr -s " << 4*c3t3.number_of_cells_in_complex() << " \".fc[0:" << 4*c3t3.number_of_cells_in_complex()-1 << "]\" -type \"polyFaces\" \n"; - int c = 0; for( Cell_iterator cit = c3t3.cells_in_complex_begin(); cit != c3t3.cells_in_complex_end(); - ++cit, ++c) + ++cit) { for (int facet_i = 0 ; facet_i < 4 ; ++facet_i) { diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h index d53b3458d15..91a585dc683 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h @@ -668,6 +668,8 @@ loop() CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " uncomputable cost." ); } } + + CGAL_assertion_code(CGAL_USE(non_collapsable_count)); } template diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h index a0247015aaf..34eca5b4923 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h @@ -209,6 +209,8 @@ class Segment_Delaunay_graph_face_tester_2 ++ec; } while ( ec != ec_start ); + CGAL_USE(n_inf); + if ( deg == n_degen ) { return true; } if ( n_non_degen != 2 ) { return false; }