From bbc05a11d9d985dde6e25751d5e1575a7cc2925e Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 16 Jun 2016 16:35:20 +0200 Subject: [PATCH] Fix -Wconversion warnings All conversions are safe. --- Mesh_3/examples/Mesh_3/random_labeled_image.h | 6 +++--- .../Mesh_3/initialize_triangulation_from_labeled_image.h | 4 ++-- .../search_for_connected_components_in_labeled_image.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Mesh_3/examples/Mesh_3/random_labeled_image.h b/Mesh_3/examples/Mesh_3/random_labeled_image.h index b01a87f1edd..8d03d462d49 100644 --- a/Mesh_3/examples/Mesh_3/random_labeled_image.h +++ b/Mesh_3/examples/Mesh_3/random_labeled_image.h @@ -25,9 +25,9 @@ CGAL::Image_3 random_labeled_image() dim-2 - max_radius_of_spheres); k = rand.uniform_smallint(1 + max_radius_of_spheres, dim-2 - max_radius_of_spheres); - } while ( ( CGAL::square(double(center) - i) + - CGAL::square(double(center) - j) + - CGAL::square(double(center) - k) ) + } while ( ( CGAL::square(double(center) - double(i)) + + CGAL::square(double(center) - double(j)) + + CGAL::square(double(center) - double(k)) ) < CGAL::square(double(radius_of_big_sphere) + 4 * max_radius_of_spheres) ); std::ptrdiff_t radius = max_radius_of_spheres; diff --git a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h index 422d7949d90..db729c8ec6d 100644 --- a/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/initialize_triangulation_from_labeled_image.h @@ -46,7 +46,7 @@ struct Get_point const std::size_t j, const std::size_t k) const { - return Point(i * vx, j * vy, k * vz); + return Point(double(i) * vx, double(j) * vy, double(k) * vz); } }; template @@ -119,7 +119,7 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, for(typename Seeds::const_iterator it = seeds.begin(), end = seeds.end(); it != end; ++it) { - const double radius = (it->second + 1)* max_v; + const double radius = double(it->second + 1)* max_v; CGAL::Random_points_on_sphere_3 points_on_sphere_3(radius); typename Mesh_domain::Construct_intersection construct_intersection = domain.construct_intersection_object(); diff --git a/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h index 0b0bdbad29e..205d0e8af1e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/search_for_connected_components_in_labeled_image.h @@ -189,7 +189,7 @@ search_for_connected_components_in_labeled_image(const CGAL::Image_3& image, const int m_n = (visited[offset_n] ? 1 : 0) + (second_pass[offset_n] ? 2 : 0); if(m_n < pass) { - Indices indices(uint(i_n), uint(j_n), uint(k_n), depth+1); + Indices indices(uint(i_n), uint(j_n), uint(k_n), uint(depth+1)); queue.push(indices); } }