From a0ed8938d61b7b5da7a2a5ecc630b967a147e2c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 27 Mar 2023 12:54:56 +0200 Subject: [PATCH] Fix warnings --- .../CGAL/Polygon_offset_builder_traits_2.h | 2 -- .../Straight_skeleton_builder_2_impl.h | 4 +++- .../include/CGAL/Straight_skeleton_builder_2.h | 2 +- .../CGAL/Straight_skeleton_builder_traits_2.h | 3 --- .../include/CGAL/compute_outer_frame_margin.h | 1 - .../constructions/Straight_skeleton_cons_ftC2.h | 17 ++++++----------- .../CGAL/create_weighted_offset_polygons_2.h | 6 +++--- .../CGAL/create_weighted_straight_skeleton_2.h | 2 +- .../CGAL/predicates/Polygon_offset_pred_ftC2.h | 1 - .../test_sls_extrude.cpp | 2 +- 10 files changed, 15 insertions(+), 25 deletions(-) diff --git a/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_traits_2.h b/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_traits_2.h index 9e33c378c28..ec2950f74b5 100644 --- a/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_traits_2.h +++ b/Straight_skeleton_2/include/CGAL/Polygon_offset_builder_traits_2.h @@ -60,8 +60,6 @@ struct Construct_offset_point_2 : Functor_base_2 , Trisegment_2_ptr const& aNode ) const { - typedef boost::optional< typename K::Line_2 > Optional_line; - No_caches no_caches; result_type p = construct_offset_pointC2(aT,aE0,aWeight0,aE1,aWeight1,aNode, no_caches); diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_2_impl.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_2_impl.h index b1961e3fd62..fc1ba81bd3e 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_2_impl.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_builder_2_impl.h @@ -48,7 +48,9 @@ Straight_skeleton_builder_2::Straight_skeleton_builder_2 ( boost::optio ,mSSkel( new SSkel() ) { if( mMaxTime ) + { CGAL_STSKEL_BUILDER_TRACE(4, "Init with mMaxTime = " << *mMaxTime); + } } template @@ -2247,7 +2249,7 @@ extreme_h / \ extreme_h / \ Halfedge_handle extreme_h = e.first; EventPtr artificial_event = e.second; - Halfedge_handle contour_h = artificial_event->triedge().e0() ; + // Halfedge_handle contour_h = artificial_event->triedge().e0() ; Halfedge_handle split_h = artificial_event->triedge().e2() ; Halfedge_handle split_h_prev = split_h->prev() ; diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h index f32121af2c1..bcb4cb367a6 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_2.h @@ -1447,7 +1447,7 @@ public: WeightIterator aWeightsEnd, const Converter& cvt) { - auto lWeightsN = std::distance(aWeightsBegin, aWeightsEnd); + const std::size_t lWeightsN = std::distance(aWeightsBegin, aWeightsEnd); CGAL_assertion(lWeightsN <= mSSkel->SSkel::Base::size_of_faces()); Face_iterator fit = std::next(mSSkel->SSkel::Base::faces_end(), -lWeightsN); diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_traits_2.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_traits_2.h index 57d758ff87c..14c1036db1c 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_traits_2.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_builder_traits_2.h @@ -756,9 +756,6 @@ public: typedef decltype(aNode->halfedge()) Halfedge_handle; typedef CGAL_SS_i::Segment_2_with_ID Target_Segment_with_ID_2; - typedef CGAL_SS_i::Triedge Triedge; - typedef CGAL::Trisegment_2 Target_Trisegment_2; - typedef Trisegment_2_ptr Target_Trisegment_2_ptr; CGAL_STSKEL_TRAITS_TRACE("Computing approximate filtering bound of V" << aNode->id() << " [" << typeid(Target_FT).name() << "]" ); diff --git a/Straight_skeleton_2/include/CGAL/compute_outer_frame_margin.h b/Straight_skeleton_2/include/CGAL/compute_outer_frame_margin.h index 01fc5cc2111..57a46a7538c 100644 --- a/Straight_skeleton_2/include/CGAL/compute_outer_frame_margin.h +++ b/Straight_skeleton_2/include/CGAL/compute_outer_frame_margin.h @@ -37,7 +37,6 @@ boost::optional< typename Traits::FT > compute_outer_frame_margin ( ForwardPoint typedef typename Traits::FT FT ; typedef typename Traits::Point_2 Point_2 ; typedef typename Traits::Segment_2 Segment_2 ; - typedef typename Traits::Trisegment_2_ptr Trisegment_2_ptr ; Kernel kernel ; diff --git a/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h b/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h index 90ad59aa0f3..9eded1c897b 100644 --- a/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h +++ b/Straight_skeleton_2/include/CGAL/constructions/Straight_skeleton_cons_ftC2.h @@ -236,7 +236,6 @@ boost::optional< typename K::Line_2 > compute_normalized_line_coeffC2( Segment_2_with_ID const& e, Caches& aCaches ) { - typedef typename K::Segment_2 Segment_2 ; typedef typename K::Line_2 Line_2 ; if(aCaches.mCoeff_cache.IsCached(e.mID) ) @@ -430,11 +429,11 @@ compute_oriented_midpoint ( Segment_2_with_ID const& e0, FT delta01 = CGAL::squared_distance(e0.target(),e1.source()); if( CGAL_NTS is_finite(delta01) && CGAL_NTS is_zero(delta01)) - return (true /*ok*/, e0.target()); + return cgal_make_optional(e0.target()); FT delta10 = CGAL::squared_distance(e1.target(),e0.source()); if( CGAL_NTS is_finite(delta10) && CGAL_NTS is_zero(delta10)) - return (true /*ok*/, e1.target()); + return cgal_make_optional(e1.target()); bool ok = false ; typename K::Point_2 mp ; @@ -542,7 +541,6 @@ compute_artifical_isec_timeC2 ( Trisegment_2_ptr< Trisegment_2 Optional_point_2 ; typedef boost::optional Optional_line_2 ; CGAL_STSKEL_TRAITS_TRACE("\n~~ Computing artificial isec time [" << typeid(FT).name() << "]"); @@ -778,7 +776,7 @@ compute_offset_lines_isec_timeC2 ( Trisegment_2_ptr< Trisegment_2collinearity() != TRISEGMENT_COLLINEARITY_ALL ) ; - boost::optional< Rational< typename K::FT > > rRes = + boost::optional< Rational > rRes = tri->collinearity() == TRISEGMENT_COLLINEARITY_NONE ? compute_normal_offset_lines_isec_timeC2 (tri, aCaches) : compute_degenerate_offset_lines_isec_timeC2(tri, aCaches); @@ -857,14 +855,12 @@ boost::optional< typename K::Point_2 > construct_artifical_isecC2 ( Trisegment_2_ptr< Trisegment_2 > > const& tri, Caches& aCaches ) { - typedef typename K::FT FT ; - typedef typename K::Boolean Boolean ; typedef typename K::Point_2 Point_2 ; typedef typename K::Segment_2 Segment_2 ; typedef typename K::Ray_2 Ray_2 ; typedef typename K::Direction_2 Direction_2 ; - CGAL_STSKEL_TRAITS_TRACE("\n~~ Computing artificial isec point [" << typeid(FT).name() << "]"); + CGAL_STSKEL_TRAITS_TRACE("\n~~ Computing artificial isec point [" << typeid(typename K::FT).name() << "]"); CGAL_STSKEL_TRAITS_TRACE("Event:\n" << tri); CGAL_precondition(tri->e0() == tri->e1()); @@ -1008,7 +1004,7 @@ construct_degenerate_offset_lines_isecC2 ( Trisegment_2_ptr< Trisegment_2 construct_offset_lines_isecC2 ( Trisegment_2_ptr< Trisegment_2 > > const& tri, Caches& aCaches ) { - typedef typename K::FT FT ; typedef typename K::Point_2 Point_2 ; - CGAL_STSKEL_TRAITS_TRACE("construct_offset_lines_isecC2(" << tri->id() << ") [" << typeid(FT).name() << "]" ); + CGAL_STSKEL_TRAITS_TRACE("construct_offset_lines_isecC2(" << tri->id() << ") [" << typeid(typename K::FT).name() << "]" ); if(aCaches.mPoint_cache.IsCached(tri->id()) ) return aCaches.mPoint_cache.Get(tri->id()) ; diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h index e39c4883583..96b6da56bae 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_2.h @@ -98,10 +98,10 @@ create_partial_interior_weighted_straight_skeleton_2 ( const FT& aMaxTime, ssb.enter_contour ( aOuterContour_VerticesBegin, aOuterContour_VerticesEnd, conv ) ; ssb.enter_contour_weights ( aOuterContour_WeightsBegin, aOuterContour_WeightsEnd, wconv ) ; - for ( HoleIterator hi = aHolesBegin ; hi != aHolesEnd ; ++ hi ) + for(HoleIterator hi = aHolesBegin; hi != aHolesEnd && aHoles_WeightsBegin != aHoles_WeightsEnd; ++ hi, ++aHoles_WeightsBegin) { - ssb.enter_contour( CGAL_SS_i::vertices_begin(*hi), CGAL_SS_i::vertices_end(*hi), conv ) ; - ssb.enter_contour_weights( aHoles_WeightsBegin->begin(), aHoles_WeightsBegin->end(), wconv ) ; + ssb.enter_contour(CGAL_SS_i::vertices_begin(*hi), CGAL_SS_i::vertices_end(*hi), conv); + ssb.enter_contour_weights(aHoles_WeightsBegin->begin(), aHoles_WeightsBegin->end(), wconv); } return ssb.construct_skeleton(); diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h index 9c77caef259..6755eb9a05f 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_straight_skeleton_2.h @@ -61,7 +61,7 @@ create_interior_weighted_straight_skeleton_2(PointIterator outer_contour_vertice ssb.enter_contour(outer_contour_vertices_begin, outer_contour_vertices_end, point_converter); ssb.enter_contour_weights(outer_contour_weights_begin, outer_contour_weights_end, weight_converter); - for(HoleIterator hi = holes_begin; hi != holes_end; ++hi, ++holes_weights_begin) + for(HoleIterator hi = holes_begin; hi != holes_end && holes_weights_begin != holes_weights_end; ++hi, ++holes_weights_begin) { ssb.enter_contour(CGAL_SS_i::vertices_begin(*hi), CGAL_SS_i::vertices_end(*hi), point_converter); ssb.enter_contour_weights(holes_weights_begin->begin(), holes_weights_begin->end(), weight_converter); diff --git a/Straight_skeleton_2/include/CGAL/predicates/Polygon_offset_pred_ftC2.h b/Straight_skeleton_2/include/CGAL/predicates/Polygon_offset_pred_ftC2.h index b2ec5b618bd..2d5da206dd6 100644 --- a/Straight_skeleton_2/include/CGAL/predicates/Polygon_offset_pred_ftC2.h +++ b/Straight_skeleton_2/include/CGAL/predicates/Polygon_offset_pred_ftC2.h @@ -33,7 +33,6 @@ compare_offset_against_isec_timeC2 ( typename K::FT const& t, Trisegment_2_ptr< Trisegment_2 > > const& tri ) { typedef typename K::FT FT ; - typedef typename K::Line_2 Line_2 ; typedef Rational Rational ; typedef Quotient Quotient ; diff --git a/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/test_sls_extrude.cpp b/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/test_sls_extrude.cpp index 653d1574e08..f39b833307c 100644 --- a/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/test_sls_extrude.cpp +++ b/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/test_sls_extrude.cpp @@ -234,7 +234,7 @@ bool test(const char* poly_filename, return true; } -int main(int argc, char** argv) +int main(int, char**) { std::cout.precision(17); std::cerr.precision(17);