From 3fd7a3fb818e2835d2e4387f55bc4f3bc075e8ac Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Mon, 11 Jan 2016 08:38:18 +0100 Subject: [PATCH] Warning fix: use std::size_t instead of int --- .../include/CGAL/structure_point_set.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Point_set_processing_3/include/CGAL/structure_point_set.h b/Point_set_processing_3/include/CGAL/structure_point_set.h index 5fd1b87a491..5af3e195bb8 100644 --- a/Point_set_processing_3/include/CGAL/structure_point_set.h +++ b/Point_set_processing_3/include/CGAL/structure_point_set.h @@ -562,13 +562,13 @@ namespace internal { //creation of a 2D-grid with cell width = grid_length, and image structures CGAL::Bbox_2 box_2d = CGAL::bbox_2 (points_2d.begin(), points_2d.end()); - int Nx = (box_2d.xmax() - box_2d.xmin()) / grid_length + 1; - int Ny = (box_2d.ymax() - box_2d.ymin()) / grid_length + 1; + std::size_t Nx = (box_2d.xmax() - box_2d.xmin()) / grid_length + 1; + std::size_t Ny = (box_2d.ymax() - box_2d.ymin()) / grid_length + 1; std::vector > Mask (Nx, std::vector (Ny, false)); std::vector > Mask_border (Nx, std::vector (Ny, false)); - std::vector > > - point_map (Nx, std::vector > (Ny, std::vector())); + std::vector > > + point_map (Nx, std::vector > (Ny, std::vector())); //storage of the points in the 2D-grid "point_map" for (std::size_t i = 0; i < points_2d.size(); ++ i) @@ -580,16 +580,16 @@ namespace internal { } //hole filing in Mask in 4-connexity - for (int j = 1; j < Ny - 1; ++ j) - for (int i = 1; i < Nx - 1; ++ i) + for (std::size_t j = 1; j < Ny - 1; ++ j) + for (std::size_t i = 1; i < Nx - 1; ++ i) if( !Mask[i][j] && Mask[i-1][j] && Mask[i][j-1] && Mask[i][j+1] && Mask[i+1][j] ) Mask[i][j]=true; //finding mask border in 8-connexity - for (int j = 1; j < Ny - 1; ++ j) - for (int i = 1; i < Nx - 1; ++ i) + for (std::size_t j = 1; j < Ny - 1; ++ j) + for (std::size_t i = 1; i < Nx - 1; ++ i) if( Mask[i][j] && ( !Mask[i-1][j-1] || !Mask[i-1][j] || !Mask[i-1][j+1] || !Mask[i][j-1] || @@ -597,7 +597,7 @@ namespace internal { !Mask[i+1][j]|| !Mask[i+1][j+1] ) ) Mask_border[i][j]=true; - for (int j = 0; j < Ny; ++ j) + for (std::size_t j = 0; j < Ny; ++ j) { if (Mask[0][j]) Mask_border[0][j]=true; @@ -605,7 +605,7 @@ namespace internal { Mask_border[Nx-1][j]=true; } - for (int i = 0; i < Nx; ++ i) + for (std::size_t i = 0; i < Nx; ++ i) { if(Mask[i][0]) Mask_border[i][0]=true; @@ -614,8 +614,8 @@ namespace internal { } //saving of points to keep - for (int j = 0; j < Ny; ++ j) - for (int i = 0; i < Nx; ++ i) + for (std::size_t j = 0; j < Ny; ++ j) + for (std::size_t i = 0; i < Nx; ++ i) if( point_map[i][j].size()>0) { //inside: recenter (cell center) the first point of the cell and desactivate the others points