From 1de5666a4ff0ba5a8b9d2f92303b4b76396e240a Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 20 Apr 2020 14:39:05 +0200 Subject: [PATCH] Remove warnings --- .../Surface_mesh_topology/draw_facewidth.h | 4 +- .../Surface_mesh_topology/edgewidth_lcc.cpp | 2 +- .../edgewidth_surface_mesh.cpp | 2 +- .../shortest_noncontractible_cycle_2.cpp | 2 +- .../unsew_edgewidth_repeatedly.cpp | 2 +- .../include/CGAL/Face_graph_wrapper.h | 2 +- .../Iterators_for_face_graph_wrapper.h | 1 + .../internal/Shortest_noncontractible_cycle.h | 9 ++--- .../shortest_noncontractible_cycle_tests.cpp | 38 +++++++++---------- 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h index 45afe808793..0718669521f 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h @@ -20,7 +20,7 @@ struct Facewidth_draw_functor : public CGAL::DefaultDrawingFunctorLCC { return CGAL::Color(0, 255, 0); } template - bool colored_edge(const LCC& alcc, typename LCC::Dart_const_handle dh) const + bool colored_edge(const LCC& /*alcc*/, typename LCC::Dart_const_handle /*dh*/) const { return false; } template @@ -53,7 +53,7 @@ void draw_facewidth(const LCC& lcc, int nbv=0, nbf=0; typename LCC::size_type vertex_mark = lcc.get_new_mark(); typename LCC::size_type face_mark = lcc.get_new_mark(); - for (int i=0; i; double cycle_length(const LCC_3& lcc, const Path_on_surface& cycle) { // Compute the length of the given cycle. double res=0; - for (int i=0; i; double cycle_length(const Mesh& mesh, const Path_on_surface& cycle) { // Compute the length of the given cycle. double res=0; - for (int i=0; i(cycle[0], is_root_copy); double cycle_length=0; - for (int i=0; i count_marked_cells(size_type amark, const std::vector& acells) const diff --git a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Iterators_for_face_graph_wrapper.h b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Iterators_for_face_graph_wrapper.h index ead6702b2f1..8d73b9609f0 100644 --- a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Iterators_for_face_graph_wrapper.h +++ b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Iterators_for_face_graph_wrapper.h @@ -58,6 +58,7 @@ namespace internal { { CGAL_assertion(&mmap==&(other.mmap)); m_it=other.m_it; + return *this; } operator Dart_handle() const diff --git a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Shortest_noncontractible_cycle.h b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Shortest_noncontractible_cycle.h index ab3c0827eaf..c886d51caab 100644 --- a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Shortest_noncontractible_cycle.h +++ b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Shortest_noncontractible_cycle.h @@ -237,7 +237,7 @@ protected: const WeightFunctor& wf) { if (std::is_same::value) - { compute_BFS_tree(root, spanning_tree, distance_from_root, trace_index, wf); } + { compute_BFS_tree(root, spanning_tree, distance_from_root, trace_index); } else { compute_Dijkstra_tree(root, spanning_tree, distance_from_root, trace_index, wf); } } @@ -295,7 +295,7 @@ protected: if (!get_local_map().is_marked(v, vertex_visited)) { int v_index=++vertex_index; - CGAL_assertion(v_index==distance_from_root.size()); + CGAL_assertion(v_index==static_cast(distance_from_root.size())); distance_from_root.push_back(distance_from_root[u_index]+w); spanning_tree.push_back(it); trace_index.push_back(u_index-1); @@ -324,11 +324,10 @@ protected: } /// Create a spanning tree using BFS - template + template void compute_BFS_tree(Dart_handle root, Dart_container& spanning_tree, std::vector& distance_from_root, - std::vector& trace_index, - const WeightFunctor& wf) + std::vector& trace_index) { // Preparation std::queue q; diff --git a/Surface_mesh_topology/test/Surface_mesh_topology/shortest_noncontractible_cycle_tests.cpp b/Surface_mesh_topology/test/Surface_mesh_topology/shortest_noncontractible_cycle_tests.cpp index bb95b0363ac..8cce2d38ec2 100644 --- a/Surface_mesh_topology/test/Surface_mesh_topology/shortest_noncontractible_cycle_tests.cpp +++ b/Surface_mesh_topology/test/Surface_mesh_topology/shortest_noncontractible_cycle_tests.cpp @@ -96,7 +96,7 @@ bool find_cycle_in_unweighted_cmap_and_polyhedron() { LCC_for_CMap_2::Dart_handle root1 = lcc.darts().begin(); Point R = lcc.point_of_vertex_attribute(lcc.vertex_attribute(root1)); CGAL::Surface_mesh_topology::Path_on_surface cycle1 = cst1.compute_shortest_non_contractible_cycle_with_base_point(root1); - for (int i = 0; i < cycle1.length(); ++i) { + for (std::size_t i = 0; i < cycle1.length(); ++i) { auto e = cycle1[i]; if (e == NULL) { std::cerr << "Fail find_cycle_in_unweighted_cmap_and_polyhedron: NULL dart handle found in cycle1\n"; @@ -118,7 +118,7 @@ bool find_cycle_in_unweighted_cmap_and_polyhedron() { return false; } CGAL::Surface_mesh_topology::Path_on_surface cycle2 = cst2.compute_shortest_non_contractible_cycle_with_base_point(*root2); - for (int i = 0; i < cycle2.length(); ++i) { + for (std::size_t i = 0; i < cycle2.length(); ++i) { auto e = cycle2[i]; if (e == NULL) { std::cerr << "Fail find_cycle_in_unweighted_cmap_and_polyhedron: NULL dart handle found in cycle\n"; @@ -140,7 +140,7 @@ bool edge_width_in_unweighted_polyhedron() { } CGAL::Surface_mesh_topology::Curves_on_surface_topology cst(p); CGAL::Surface_mesh_topology::Path_on_surface cycle = cst.compute_edge_width(); - for (int i = 0; i < cycle.length(); ++i) { + for (std::size_t i = 0; i < cycle.length(); ++i) { auto e = cycle[i]; if (e == NULL) { std::cerr << "Fail edge_width_in_unweighted_polyhedron: NULL dart handle found in cycle\n"; @@ -189,7 +189,7 @@ bool find_cycle_in_nonorientable_gmap() { // Make a non-oriented case here gm.mark_cell<1>(gm.alpha<0>(faces[2]), chosen_cycle); // 5-1 unsigned int cycle_length = 0; - for (int i = 0; i < cycle.length(); ++i) { + for (std::size_t i = 0; i < cycle.length(); ++i) { cycle_length += wf(cycle[i]); auto dh = cycle[i]; if (!gm.is_marked(dh, chosen_cycle)) { @@ -251,7 +251,7 @@ bool edge_width_in_weighted_cmap_gmap_mesh() { double cycle_length1, cycle_length2, cycle_length3; std::vector v1, v2, v3; - for (int i=0; i cycle = cst.compute_edge_width(); length = cycle.length(); LCC_for_GMap_2::size_type belong_to_cycle = lcc_gm.get_new_mark(); - for (int i = 0; i < cycle.length(); ++i) { + for (std::size_t i = 0; i < cycle.length(); ++i) { auto e = cycle[i]; if (e == NULL) { std::cerr << "Fail unsew_edge_width_repeatedly_in_unweighted_gmap: NULL dart handle found in cycle\n"; @@ -377,7 +377,7 @@ bool unsew_edge_width_repeatedly_in_unweighted_gmap() { cycle_lengths.push_back(length); lcc_gm.free_mark(belong_to_cycle); } while (length != 0); - for (int i = 1; i < cycle_lengths.size(); ++i) + for (std::size_t i = 1; i < cycle_lengths.size(); ++i) if (cycle_lengths[i] > cycle_lengths[i-1]) { std::cerr << "Fail unsew_edge_width_repeatedly_in_unweighted_gmap: Edge width length decreases instead of increases\n"; return false;