From f2973b7ff008d1c80890d26aa845a23a2aeac619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Tayeb?= Date: Fri, 2 Jul 2010 14:51:18 +0000 Subject: [PATCH] Fix warnings on MSVS2010. --- Mesh_3/demo/Mesh_3/Scene_c3t3_item.cpp | 2 +- Mesh_3/include/CGAL/IO/File_medit.h | 4 +++- Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h | 2 +- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 2 +- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 2 +- Mesh_3/test/Mesh_3/test_meshing_utilities.h | 13 ++++++------- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Mesh_3/demo/Mesh_3/Scene_c3t3_item.cpp b/Mesh_3/demo/Mesh_3/Scene_c3t3_item.cpp index d974770483f..d8116ba848a 100644 --- a/Mesh_3/demo/Mesh_3/Scene_c3t3_item.cpp +++ b/Mesh_3/demo/Mesh_3/Scene_c3t3_item.cpp @@ -351,7 +351,7 @@ Scene_c3t3_item::build_histogram() painter.setPen(Qt::blue); painter.drawLine(QPoint(left_margin, drawing_height + top_margin), - QPoint(left_margin + histo_data.size()*cell_width, + QPoint(left_margin + static_cast(histo_data.size())*cell_width, drawing_height + top_margin)); diff --git a/Mesh_3/include/CGAL/IO/File_medit.h b/Mesh_3/include/CGAL/IO/File_medit.h index 2b1c1cdb0a4..4d5e7c36f6f 100644 --- a/Mesh_3/include/CGAL/IO/File_medit.h +++ b/Mesh_3/include/CGAL/IO/File_medit.h @@ -802,7 +802,9 @@ output_to_medit(std::ostream& os, //------------------------------------------------------- // Facets //------------------------------------------------------- - int number_of_triangles = c3t3.number_of_facets(); + unsigned int number_of_triangles = + static_cast(c3t3.number_of_facets()); + if ( print_each_facet_twice ) number_of_triangles += number_of_triangles; diff --git a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h index 552bfff2a96..5dabbd7568a 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h +++ b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h @@ -688,7 +688,7 @@ update_pvertex(PVertex& pv, const FT& sliver_bound) const Cell_vector slivers = helper_.incident_slivers(pv.vertex(), sliver_criterion_, sliver_bound); - pv.set_sliver_nb(slivers.size()); + pv.set_sliver_nb(static_cast(slivers.size())); pv.set_min_value(helper_.min_sliver_value(slivers, sliver_criterion_)); } diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 788fd13714e..486424e5c54 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -82,7 +82,7 @@ lloyd_optimize_mesh_3_impl(C3T3& c3t3, max_iteration_number = 1000; // Launch optimization - return opt(max_iteration_number); + return opt(static_cast(max_iteration_number)); } diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 355515c5d0a..6cc64f4a606 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -83,7 +83,7 @@ odt_optimize_mesh_3_impl(C3T3& c3t3, max_iteration_number = 1000; // Launch optimization - return opt(max_iteration_number); + return opt(static_cast(max_iteration_number)); } } // end namespace CGAL diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index c2f33132806..438e96a57cb 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -52,15 +52,14 @@ struct Tester const unsigned int min_cells_expected = 0, const unsigned int max_cells_expected = (unsigned int)(-1) ) const { - typedef typename C3t3::size_type size_type; typedef typename C3t3::Triangulation::Geom_traits Gt; typedef typename CGAL::Mesh_3::Min_dihedral_angle_criterion Sliver_criterion; typedef typename CGAL::Mesh_3::Slivers_exuder Exuder; // Store mesh properties - size_type v = c3t3.triangulation().number_of_vertices(); - size_type f = c3t3.number_of_facets(); - size_type c = c3t3.number_of_cells(); + unsigned int v = static_cast(c3t3.triangulation().number_of_vertices()); + unsigned int f = static_cast(c3t3.number_of_facets()); + unsigned int c = static_cast(c3t3.number_of_cells()); // Verify verify_c3t3(c3t3, @@ -90,9 +89,9 @@ struct Tester CGAL::parameters::no_exude(), CGAL::parameters::no_perturb()); - v = c3t3.triangulation().number_of_vertices(); - f = c3t3.number_of_facets(); - c = c3t3.number_of_cells(); + v = static_cast(c3t3.triangulation().number_of_vertices()); + f = static_cast(c3t3.number_of_facets()); + c = static_cast(c3t3.number_of_cells()); } assert ( n < 11 ); #endif