From 3a0853a27ba936dcf5d77b2afe4d6ea792cbf0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 17 Dec 2013 09:23:00 +0100 Subject: [PATCH] fix warnings --- .../internal/Surface_mesh_segmentation/K_means_clustering.h | 5 +++-- .../Surface_mesh_segmentation/K_means_clustering_test_2.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Surface_mesh_segmentation/include/CGAL/internal/Surface_mesh_segmentation/K_means_clustering.h b/Surface_mesh_segmentation/include/CGAL/internal/Surface_mesh_segmentation/K_means_clustering.h index 725d37a5741..b367e4064cb 100644 --- a/Surface_mesh_segmentation/include/CGAL/internal/Surface_mesh_segmentation/K_means_clustering.h +++ b/Surface_mesh_segmentation/include/CGAL/internal/Surface_mesh_segmentation/K_means_clustering.h @@ -148,8 +148,9 @@ class K_means_point public: double data; /**< Location of the point */ std::size_t center_id; /**< Closest center to the point */ - K_means_point(double data, std::size_t center_id = -1) : data(data), - center_id(center_id) { + K_means_point(double data, + std::size_t center_id = (std::numeric_limits::max)()) + : data(data), center_id(center_id) { } operator double() const { diff --git a/Surface_mesh_segmentation/test/Surface_mesh_segmentation/K_means_clustering_test_2.cpp b/Surface_mesh_segmentation/test/Surface_mesh_segmentation/K_means_clustering_test_2.cpp index 907c05955b4..5a84ebbfb2f 100644 --- a/Surface_mesh_segmentation/test/Surface_mesh_segmentation/K_means_clustering_test_2.cpp +++ b/Surface_mesh_segmentation/test/Surface_mesh_segmentation/K_means_clustering_test_2.cpp @@ -20,7 +20,7 @@ int main(void) // unique point generate std::vector points; for(std::size_t i = 0; i < center_size; ++i) { - points.push_back(i); + points.push_back(static_cast(i)); } // test kmeans, expected result: each point has its own cluster