From 7bcb5b02eb295055d9b15ef237a10c220ea007a8 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Thu, 5 Jan 2017 07:57:05 +0100 Subject: [PATCH] Fix warnings --- Point_set_3/examples/Point_set_3/point_set_algo.cpp | 2 +- .../examples/Point_set_3/point_set_property.cpp | 11 +++++------ Point_set_3/include/CGAL/IO/read_ply_point_set_3.h | 1 + Point_set_3/include/CGAL/Point_set_3/IO.h | 1 + Point_set_3/test/Point_set_3/point_set_test_join.cpp | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Point_set_3/examples/Point_set_3/point_set_algo.cpp b/Point_set_3/examples/Point_set_3/point_set_algo.cpp index beb9bedfd69..7e55d6f939d 100644 --- a/Point_set_3/examples/Point_set_3/point_set_algo.cpp +++ b/Point_set_3/examples/Point_set_3/point_set_algo.cpp @@ -59,7 +59,7 @@ int main (int, char**) ransac.add_shape_factory(); Efficient_ransac::Parameters parameters; parameters.probability = 0.05; - parameters.min_points = point_set.size() / 3.; + parameters.min_points = std::size_t(point_set.size() / 3); parameters.epsilon = 0.01; parameters.cluster_epsilon = 0.5; parameters.normal_threshold = 0.9; diff --git a/Point_set_3/examples/Point_set_3/point_set_property.cpp b/Point_set_3/examples/Point_set_3/point_set_property.cpp index 53c98e48529..4072c5e3ccf 100644 --- a/Point_set_3/examples/Point_set_3/point_set_property.cpp +++ b/Point_set_3/examples/Point_set_3/point_set_property.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -35,8 +36,6 @@ void print_point_set (const Point_set& point_set) int main (int, char**) { - srand (time (NULL)); - Point_set point_set; Color black = {{ 0, 0, 0 }}; @@ -53,10 +52,10 @@ int main (int, char**) point_set.reserve (10); // For memory optimization for (std::size_t i = 0; i < 10; ++ i) { - Point_set::iterator it = point_set.insert (Point (i, i, i)); - Color c = {{ (unsigned char)(rand() % 256), - (unsigned char)(rand() % 256), - (unsigned char)(rand() % 256) }}; + Point_set::iterator it = point_set.insert (Point (double(i), double(i), double(i))); + Color c = {{ (unsigned char)(CGAL::get_default_random().get_int(0, 255)), + (unsigned char)(CGAL::get_default_random().get_int(0, 255)), + (unsigned char)(CGAL::get_default_random().get_int(0, 255)) }}; color[*it] = c; intensity[*it] = rand() / (double)(RAND_MAX); } diff --git a/Point_set_3/include/CGAL/IO/read_ply_point_set_3.h b/Point_set_3/include/CGAL/IO/read_ply_point_set_3.h index 65aa51daedd..62567935647 100644 --- a/Point_set_3/include/CGAL/IO/read_ply_point_set_3.h +++ b/Point_set_3/include/CGAL/IO/read_ply_point_set_3.h @@ -59,6 +59,7 @@ private: struct Abstract_ply_property_to_point_set_property { + virtual ~Abstract_ply_property_to_point_set_property() { } virtual void assign (Ply_reader& reader, typename Point_set::Index index) = 0; }; diff --git a/Point_set_3/include/CGAL/Point_set_3/IO.h b/Point_set_3/include/CGAL/Point_set_3/IO.h index 82773d25017..10d93758409 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO.h @@ -216,6 +216,7 @@ namespace internal class Abstract_property_printer { public: + virtual ~Abstract_property_printer() { } virtual std::string get_string(const typename CGAL::Point_set_3::Index& index) = 0; }; diff --git a/Point_set_3/test/Point_set_3/point_set_test_join.cpp b/Point_set_3/test/Point_set_3/point_set_test_join.cpp index 79be0da9118..4f305eb55e0 100644 --- a/Point_set_3/test/Point_set_3/point_set_test_join.cpp +++ b/Point_set_3/test/Point_set_3/point_set_test_join.cpp @@ -47,7 +47,7 @@ int main (int, char**) ps1.add_normal_map(); for (std::size_t i = 0; i < 5; ++ i) - ps1.insert (Point (i, i, i), Vector (i, i, i)); + ps1.insert (Point (double(i), double(i), double(i)), Vector (double(i), double(i), double(i))); ps1.remove (ps1.end() - 3);