From c724f2ff9ad5681bad386401770da4b907488462 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 1 Mar 2013 11:27:39 +0100 Subject: [PATCH] CGAL_USE --- .../Polyhedron_demo_poisson_plugin_impl.cpp | 3 +-- .../test/STL_Extension/test_Uncertain.cpp | 16 +++++++++------- .../CGAL/Poisson_reconstruction_function.h | 6 +++--- .../CGAL/Reconstruction_triangulation_3.h | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_poisson_plugin_impl.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_poisson_plugin_impl.cpp index 06468f5f197..7251c7166dd 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_poisson_plugin_impl.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_poisson_plugin_impl.cpp @@ -58,8 +58,7 @@ Polyhedron* poisson_reconstruct(const Point_set& points, // Checks requirements //*************************************** - int nb_points = points.size(); - if (nb_points == 0) + if (points.size() == 0) { std::cerr << "Error: empty point set" << std::endl; return NULL; diff --git a/STL_Extension/test/STL_Extension/test_Uncertain.cpp b/STL_Extension/test/STL_Extension/test_Uncertain.cpp index eb08ac75861..cce02b72da7 100644 --- a/STL_Extension/test/STL_Extension/test_Uncertain.cpp +++ b/STL_Extension/test/STL_Extension/test_Uncertain.cpp @@ -11,9 +11,7 @@ // So I cast to bool manually (needed when the automatic conversion is switched off). #define bool_assert(X) assert(bool(X)) -// "unused variable" warning killer -template -void use(T) {} + // generic test, for both enums and bool template < typename T > @@ -36,6 +34,7 @@ void test() const U v = t0; U w = U (T(), T()); U v2 = u; + CGAL_USE(v2); w = (w = t0); // Various functions @@ -53,6 +52,7 @@ void test() #endif U indet = U::indeterminate(); + CGAL_USE(indet); t = CGAL::inf(u); t = CGAL::sup(u); @@ -80,7 +80,7 @@ void test() CGAL::make_certain(u); #ifndef CGAL_NO_UNCERTAIN_CONVERSION_OPERATOR T t = u; - use(t); + CGAL_USE(t); #endif } catch (CGAL::Uncertain_conversion_exception) { ok = true; } @@ -88,6 +88,8 @@ void test() U u2 = CGAL::make_uncertain(u); U u3 = CGAL::make_uncertain(T()); + CGAL_USE(u2); + CGAL_USE(u3); // Operators bool_assert( v == v ); @@ -97,8 +99,8 @@ void test() bool_assert( ! (v != t0) ); bool_assert( ! (t0 != v) ); - use(t); - use(t2); + CGAL_USE(t); + CGAL_USE(t2); } @@ -292,7 +294,7 @@ void test_bool() // Test exceptions bool ok = false; - try { bool b = indet; use(b); } + try { bool b = indet; CGAL_USE(b); } catch (CGAL::Uncertain_conversion_exception) { ok = true; } bool_assert(ok); // The following must throw. diff --git a/Surface_reconstruction_points_3/include/CGAL/Poisson_reconstruction_function.h b/Surface_reconstruction_points_3/include/CGAL/Poisson_reconstruction_function.h index 93684d81ec3..6748a329a38 100644 --- a/Surface_reconstruction_points_3/include/CGAL/Poisson_reconstruction_function.h +++ b/Surface_reconstruction_points_3/include/CGAL/Poisson_reconstruction_function.h @@ -730,7 +730,7 @@ private: // get #variables constrain_one_vertex_on_convex_hull(); m_tr->index_unconstrained_vertices(); - unsigned int nb_variables = m_tr->number_of_vertices()-1; + unsigned int nb_variables = static_cast(m_tr->number_of_vertices()-1); CGAL_TRACE(" Number of variables: %ld\n", (long)(nb_variables)); @@ -1074,8 +1074,8 @@ private: // sum up areas FT area = 0.0; const Point& a = voronoi_points[0]; - unsigned int nb_triangles = voronoi_points.size() - 1; - for(unsigned int i=1;i(n); while(m > 500){ m /= 2;