From 05e09656559844c352cb21c8c96e4fc077c5299e Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Wed, 19 Aug 2015 15:22:17 +0200 Subject: [PATCH] Fix warnings of possible loss of data converting std::size_t to unsigned int --- .../include/CGAL/bilateral_smooth_point_set.h | 2 +- .../include/CGAL/edge_aware_upsample_point_set.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h index 2197d1ba0c3..5abb1b2ff95 100644 --- a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h @@ -451,7 +451,7 @@ bilateral_smooth_point_set( pwns.push_back(Pwn(p, n)); } - unsigned int nb_points = pwns.size(); + std::size_t nb_points = pwns.size(); #ifdef CGAL_PSP3_VERBOSE std::cout << "Initialization and compute max spacing: " << std::endl; diff --git a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h index 3321f0d3155..83d3f70f7fe 100644 --- a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h +++ b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h @@ -153,7 +153,7 @@ update_new_point( typedef typename Kernel::FT FT; typedef typename rich_grid_internal::Rich_point Rich_point; - CGAL_assertion_code( unsigned int size = rich_point_set.size() ); + CGAL_assertion_code( unsigned int size = static_cast(rich_point_set.size()) ); CGAL_point_set_processing_precondition(father_index >= 0 && father_index < size); CGAL_point_set_processing_precondition(mother_index >= 0 && @@ -431,7 +431,7 @@ edge_aware_upsample_point_set( std::cout << "current radius: " << current_radius << std::endl; #endif - unsigned int current_size = rich_point_set.size(); + std::size_t current_size = rich_point_set.size(); std::vector is_pass_threshold(current_size, false); if (iter_time == 0) @@ -533,7 +533,7 @@ edge_aware_upsample_point_set( Rich_point& base = rich_point_set[mother_index]; Vector diff_v_base = base.pt - v.pt; new_v.pt = v.pt + (diff_v_base * FT(0.5)); - new_v.index = rich_point_set.size(); + new_v.index = static_cast(rich_point_set.size()); unsigned int new_point_index = new_v.index; rich_point_set.push_back(new_v); @@ -570,7 +570,7 @@ edge_aware_upsample_point_set( } } - for (unsigned int i = number_of_input; i < rich_point_set.size(); ++i) + for (std::size_t i = number_of_input; i < rich_point_set.size(); ++i) { Rich_point& v = rich_point_set[i]; Point point = v.pt;