From 3efe2ec339de85014ac766dc6b36fe825adeeff3 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Wed, 31 Mar 2021 09:40:19 +0200 Subject: [PATCH] Fix warnings: CGAL objects use int parameters for operator[] --- .../include/CGAL/PCA_util_Eigen.h | 4 ++-- .../include/CGAL/Subiterator.h | 4 ++-- .../CGAL/linear_least_squares_fitting_cuboids_3.h | 8 ++++---- .../CGAL/linear_least_squares_fitting_rectangles_2.h | 4 ++-- .../CGAL/linear_least_squares_fitting_segments_2.h | 2 +- .../CGAL/linear_least_squares_fitting_segments_3.h | 4 ++-- .../CGAL/linear_least_squares_fitting_tetrahedra_3.h | 12 ++++++------ .../CGAL/linear_least_squares_fitting_triangles_2.h | 4 ++-- .../CGAL/linear_least_squares_fitting_triangles_3.h | 8 ++++---- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Principal_component_analysis/include/CGAL/PCA_util_Eigen.h b/Principal_component_analysis/include/CGAL/PCA_util_Eigen.h index af8e8fb634e..5cd1dbbd7d8 100644 --- a/Principal_component_analysis/include/CGAL/PCA_util_Eigen.h +++ b/Principal_component_analysis/include/CGAL/PCA_util_Eigen.h @@ -220,10 +220,10 @@ assemble_covariance_matrix_3(InputIterator first, typedef typename K::FT FT; typedef typename K::Iso_cuboid_3 Iso_cuboid; typedef typename K::Triangle_3 Triangle; - auto converter = [](const Iso_cuboid& c, std::size_t idx) -> Triangle + auto converter = [](const Iso_cuboid& c, int idx) -> Triangle { // Decomposition of 6 faces of the cuboid into 12 triangles - static constexpr std::array, 12 > indices + static constexpr std::array, 12 > indices = {{ { 0, 1, 2 }, { 0, 2, 3 }, { 2, 3, 4 }, { 2, 4, 7 }, { 3, 4, 5 }, { 3, 5, 0 }, { 4, 5, 6 }, { 4, 6, 7 }, { 5, 6, 1 }, { 5, 1, 0 }, { 6, 7, 2 }, { 6, 2, 1 } }}; diff --git a/Principal_component_analysis/include/CGAL/Subiterator.h b/Principal_component_analysis/include/CGAL/Subiterator.h index fbadd1980c2..186776918be 100644 --- a/Principal_component_analysis/include/CGAL/Subiterator.h +++ b/Principal_component_analysis/include/CGAL/Subiterator.h @@ -31,12 +31,12 @@ public: using Input_type = typename std::iterator_traits::value_type; using Output_type = ValueType; - using Converter = std::function; + using Converter = std::function; private: Converter m_converter; - std::size_t m_next_index; + int m_next_index; InputIterator m_base; mutable Output_type m_current; diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_cuboids_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_cuboids_3.h index 4b552111dd2..c0071304d6a 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_cuboids_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_cuboids_3.h @@ -113,7 +113,7 @@ linear_least_squares_fitting_3(InputIterator first, // precondition: at least one element in the container. CGAL_precondition(first != beyond); - auto converter = [](const Iso_cuboid& c, std::size_t idx) -> Segment + auto converter = [](const Iso_cuboid& c, int idx) -> Segment { if (idx < 7) return Segment (c[idx], c[idx+1]); @@ -148,7 +148,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Point_3 Point; typedef typename K::Iso_cuboid_3 Iso_cuboid; - auto converter = [](const Iso_cuboid& c, std::size_t idx) -> Point { return c[idx]; }; + auto converter = [](const Iso_cuboid& c, int idx) -> Point { return c[idx]; }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); @@ -240,7 +240,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Segment_3 Segment; typedef typename K::Iso_cuboid_3 Iso_cuboid; - auto converter = [](const Iso_cuboid& c, std::size_t idx) -> Segment + auto converter = [](const Iso_cuboid& c, int idx) -> Segment { if (idx < 7) return Segment (c[idx], c[idx+1]); @@ -279,7 +279,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Point_3 Point; typedef typename K::Iso_cuboid_3 Iso_cuboid; - auto converter = [](const Iso_cuboid& c, std::size_t idx) -> Point { return c[idx]; }; + auto converter = [](const Iso_cuboid& c, int idx) -> Point { return c[idx]; }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_rectangles_2.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_rectangles_2.h index 8c37f5960bb..34a00b79519 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_rectangles_2.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_rectangles_2.h @@ -158,7 +158,7 @@ linear_least_squares_fitting_2(InputIterator first, // types typedef typename K::Iso_rectangle_2 Iso_rectangle; typedef typename K::Segment_2 Segment_2; - auto converter = [](const Iso_rectangle& r, std::size_t idx) -> Segment_2 { return Segment_2(r[idx], r[(idx+1)%4]); }; + auto converter = [](const Iso_rectangle& r, int idx) -> Segment_2 { return Segment_2(r[idx], r[(idx+1)%4]); }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); @@ -188,7 +188,7 @@ linear_least_squares_fitting_2(InputIterator first, // types typedef typename K::Iso_rectangle_2 Iso_rectangle; typedef typename K::Point_2 Point_2; - auto converter = [](const Iso_rectangle& r, std::size_t idx) -> Point_2 { return r[idx]; }; + auto converter = [](const Iso_rectangle& r, int idx) -> Point_2 { return r[idx]; }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h index aa3a3432fdf..5407c3fe497 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h @@ -147,7 +147,7 @@ linear_least_squares_fitting_2(InputIterator first, // types typedef typename K::Point_2 Point; typedef typename K::Segment_2 Segment; - auto converter = [](const Segment& s, std::size_t idx) -> Point { return s[idx]; }; + auto converter = [](const Segment& s, int idx) -> Point { return s[idx]; }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_3.h index 7fababd309b..b685d8d1f41 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_3.h @@ -75,7 +75,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Segment_3 Segment; typedef typename K::Point_3 Point; - auto converter = [](const Segment& s, std::size_t idx) -> Point { return s[idx]; }; + auto converter = [](const Segment& s, int idx) -> Point { return s[idx]; }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); @@ -134,7 +134,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Segment_3 Segment; typedef typename K::Point_3 Point; - auto converter = [](const Segment& s, std::size_t idx) -> Point { return s[idx]; }; + auto converter = [](const Segment& s, int idx) -> Point { return s[idx]; }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h index b7f36c518d2..cfe029d5f0c 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h @@ -76,7 +76,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Tetrahedron_3 Tetrahedron; typedef typename K::Triangle_3 Triangle; - auto converter = [](const Tetrahedron& t, std::size_t idx) -> Triangle + auto converter = [](const Tetrahedron& t, int idx) -> Triangle { return Triangle(t[idx], t[(idx+1)%4], t[(idx+2)%4]); }; // precondition: at least one element in the container. @@ -105,7 +105,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Tetrahedron_3 Tetrahedron; typedef typename K::Segment_3 Segment; - auto converter = [](const Tetrahedron& t, std::size_t idx) -> Segment + auto converter = [](const Tetrahedron& t, int idx) -> Segment { if (idx < 4) return Segment (t[idx], t[(idx+1)%4]); @@ -139,7 +139,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Tetrahedron_3 Tetrahedron; typedef typename K::Point_3 Point; - auto converter = [](const Tetrahedron& t, std::size_t idx) -> Point { return t[idx]; }; + auto converter = [](const Tetrahedron& t, int idx) -> Point { return t[idx]; }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); @@ -198,7 +198,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Tetrahedron_3 Tetrahedron; typedef typename K::Triangle_3 Triangle; - auto converter = [](const Tetrahedron& t, std::size_t idx) -> Triangle + auto converter = [](const Tetrahedron& t, int idx) -> Triangle { return Triangle(t[idx], t[(idx+1)%4], t[(idx+2)%4]); }; // precondition: at least one element in the container. @@ -227,7 +227,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Tetrahedron_3 Tetrahedron; typedef typename K::Segment_3 Segment; - auto converter = [](const Tetrahedron& t, std::size_t idx) -> Segment + auto converter = [](const Tetrahedron& t, int idx) -> Segment { if (idx < 4) return Segment (t[idx], t[(idx+1)%4]); @@ -260,7 +260,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Tetrahedron_3 Tetrahedron; typedef typename K::Point_3 Point; - auto converter = [](const Tetrahedron& t, std::size_t idx) -> Point { return t[idx]; }; + auto converter = [](const Tetrahedron& t, int idx) -> Point { return t[idx]; }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_2.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_2.h index 7d32f2bcdbd..91c5d2b6449 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_2.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_2.h @@ -159,7 +159,7 @@ linear_least_squares_fitting_2(InputIterator first, // types typedef typename Kernel::Triangle_2 Triangle; typedef typename Kernel::Segment_2 Segment; - auto converter = [](const Triangle& t, std::size_t idx) -> Segment { return Segment(t[idx], t[(idx+1)%3]); }; + auto converter = [](const Triangle& t, int idx) -> Segment { return Segment(t[idx], t[(idx+1)%3]); }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); @@ -189,7 +189,7 @@ linear_least_squares_fitting_2(InputIterator first, typedef typename Kernel::Triangle_2 Triangle; typedef typename Kernel::Point_2 Point; - auto converter = [](const Triangle& t, std::size_t idx) -> Point { return t[idx]; }; + auto converter = [](const Triangle& t, int idx) -> Point { return t[idx]; }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h index 3c403399cbb..a2a1e96bec4 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h @@ -74,7 +74,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Triangle_3 Triangle; typedef typename K::Segment_3 Segment; - auto converter = [](const Triangle& t, std::size_t idx) -> Segment { return Segment(t[idx], t[(idx+1)%3]); }; + auto converter = [](const Triangle& t, int idx) -> Segment { return Segment(t[idx], t[(idx+1)%3]); }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); @@ -103,7 +103,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Triangle_3 Triangle; typedef typename K::Point_3 Point; - auto converter = [](const Triangle& t, std::size_t idx) -> Point { return t[idx]; }; + auto converter = [](const Triangle& t, int idx) -> Point { return t[idx]; }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); @@ -163,7 +163,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Triangle_3 Triangle; typedef typename K::Segment_3 Segment; - auto converter = [](const Triangle& t, std::size_t idx) -> Segment { return Segment(t[idx], t[(idx+1)%3]); }; + auto converter = [](const Triangle& t, int idx) -> Segment { return Segment(t[idx], t[(idx+1)%3]); }; // precondition: at least one element in the container. CGAL_precondition(first != beyond); @@ -191,7 +191,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename K::Triangle_3 Triangle; typedef typename K::Point_3 Point; - auto converter = [](const Triangle& t, std::size_t idx) -> Point { return t[idx]; }; + auto converter = [](const Triangle& t, int idx) -> Point { return t[idx]; }; // precondition: at least one element in the container. CGAL_precondition(first != beyond);