From d0cf100a654759436f026783dad0ffc528d1b080 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sat, 17 May 2014 14:10:34 +0200 Subject: [PATCH] [get_turns][relate][test][index] Fix unused variable warnings. In the rtree/pack_create replace (void)variable to boost::ignore_unused_variable_warning(). --- .../detail/overlay/get_turn_info_for_endpoint.hpp | 6 ++++-- .../detail/overlay/get_turn_info_helpers.hpp | 2 +- .../algorithms/detail/overlay/get_turn_info_la.hpp | 12 +++++++----- .../algorithms/detail/relate/linear_areal.hpp | 9 +++------ .../algorithms/detail/relate/linear_linear.hpp | 11 ++++------- .../geometry/algorithms/detail/relate/result.hpp | 2 +- .../geometry/index/detail/rtree/pack_create.hpp | 2 +- test/algorithms/assign.cpp | 2 +- test/algorithms/test_convex_hull.hpp | 2 +- 9 files changed, 23 insertions(+), 25 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp index cd07e784a..e7df458fa 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp @@ -394,8 +394,8 @@ struct get_turn_info_for_endpoint typename TurnInfo, typename IntersectionInfo > - static inline bool handle_internal(Point1 const& i1, Point1 const& j1, Point1 const& /*k1*/, - Point2 const& i2, Point2 const& j2, Point2 const& k2, + static inline bool handle_internal(Point1 const& /*i1*/, Point1 const& /*j1*/, Point1 const& /*k1*/, + Point2 const& i2, Point2 const& j2, Point2 const& /*k2*/, RobustPoint1 const& ri1, RobustPoint1 const& rj1, RobustPoint1 const& /*rk1*/, RobustPoint2 const& ri2, RobustPoint2 const& rj2, RobustPoint2 const& rk2, bool first1, bool last1, bool first2, bool last2, @@ -403,6 +403,8 @@ struct get_turn_info_for_endpoint IntersectionInfo const& inters, int ip_index, operation_type & op1, operation_type & op2) { + boost::ignore_unused_variable_warning(i2); + boost::ignore_unused_variable_warning(j2); boost::ignore_unused_variable_warning(ip_index); boost::ignore_unused_variable_warning(tp_model); diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp index 6b3c54d5f..3f0d5da1f 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp @@ -160,7 +160,7 @@ public: intersection_info_base(Point1 const& pi, Point1 const& pj, Point1 const& pk, Point2 const& qi, Point2 const& qj, Point2 const& qk, - no_rescale_policy const& robust_policy) + no_rescale_policy const& /*robust_policy*/) : m_side_calc(pi, pj, pk, qi, qj, qk) {} diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp index 9556dbfaa..374c82082 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp @@ -446,7 +446,7 @@ struct get_turn_info_linear_areal typename OutIt> static inline bool append_collinear_spikes(TurnInfo & tp, IntersectionInfo const& inters, - bool is_p_last, bool is_q_last, + bool is_p_last, bool /*is_q_last*/, method_type method, append_version_c version, OutIt out) { @@ -489,7 +489,7 @@ struct get_turn_info_linear_areal typename OutIt> static inline bool append_opposite_spikes(TurnInfo & tp, IntersectionInfo const& inters, - bool is_p_last, bool is_q_last, + bool is_p_last, bool /*is_q_last*/, OutIt out) { bool is_p_spike = ( Version == append_touches ? @@ -635,10 +635,10 @@ struct get_turn_info_linear_areal typename IntersectionInfo, typename OutputIterator> static inline bool get_turn_info_for_endpoint( - Point1 const& pi, Point1 const& pj, Point1 const& pk, - Point2 const& qi, Point2 const& qj, Point2 const& qk, + Point1 const& pi, Point1 const& /*pj*/, Point1 const& /*pk*/, + Point2 const& qi, Point2 const& /*qj*/, Point2 const& /*qk*/, bool is_p_first, bool is_p_last, - bool is_q_first, bool is_q_last, + bool /*is_q_first*/, bool is_q_last, TurnInfo const& tp_model, IntersectionInfo const& inters, method_type /*method*/, @@ -659,6 +659,8 @@ struct get_turn_info_linear_areal if ( !is_p_first && !is_p_last ) return false; +// TODO: is_q_last could probably be replaced by false and removed from parameters + linear_intersections intersections(pi, qi, inters.result(), is_p_last, is_q_last); linear_intersections::ip_info const& ip0 = intersections.template get<0>(); linear_intersections::ip_info const& ip1 = intersections.template get<1>(); diff --git a/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp b/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp index 0bf667eb2..26750de3b 100644 --- a/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp +++ b/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp @@ -464,14 +464,11 @@ struct linear_areal typename Geometry, typename OtherGeometry, typename BoundaryChecker> - void apply(Result & res, - TurnIt first, TurnIt it, TurnIt last, + void apply(Result & res, TurnIt it, Geometry const& geometry, OtherGeometry const& other_geometry, BoundaryChecker const& boundary_checker) { - //BOOST_ASSERT( it != last ); - overlay::operation_type op = it->operations[op_id].operation; if ( op != overlay::operation_union @@ -769,7 +766,7 @@ struct linear_areal void apply(Result & res, TurnIt first, TurnIt last, Geometry const& geometry, - OtherGeometry const& other_geometry, + OtherGeometry const& /*other_geometry*/, BoundaryChecker const& boundary_checker) { //BOOST_ASSERT( first != last ); @@ -966,7 +963,7 @@ struct linear_areal for ( TurnIt it = first ; it != last ; ++it ) { - analyser.apply(res, first, it, last, + analyser.apply(res, it, geometry, other_geometry, boundary_checker); diff --git a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp b/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp index fc424fff5..3476a4178 100644 --- a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp @@ -257,15 +257,12 @@ struct linear_linear typename OtherGeometry, typename BoundaryChecker, typename OtherBoundaryChecker> - void apply(Result & res, - TurnIt first, TurnIt it, TurnIt last, + void apply(Result & res, TurnIt it, Geometry const& geometry, OtherGeometry const& other_geometry, BoundaryChecker const& boundary_checker, OtherBoundaryChecker const& other_boundary_checker) { - //BOOST_ASSERT( it != last ); - overlay::operation_type op = it->operations[op_id].operation; segment_identifier const& seg_id = it->operations[op_id].seg_id; @@ -563,7 +560,7 @@ struct linear_linear Geometry const& geometry, OtherGeometry const& /*other_geometry*/, BoundaryChecker const& boundary_checker, - OtherBoundaryChecker const& other_boundary_checker) + OtherBoundaryChecker const& /*other_boundary_checker*/) { //BOOST_ASSERT( first != last ); @@ -621,7 +618,7 @@ struct linear_linear Geometry const& geometry, OtherGeometry const& other_geometry, BoundaryChecker const& boundary_checker, - OtherBoundaryChecker const& other_boundary_checker, + OtherBoundaryChecker const& /*other_boundary_checker*/, bool first_in_range) { typename detail::single_geometry_return_type::type @@ -747,7 +744,7 @@ struct linear_linear for ( TurnIt it = first ; it != last ; ++it ) { - analyser.apply(res, first, it, last, + analyser.apply(res, it, geometry, other_geometry, boundary_checker, other_boundary_checker); diff --git a/include/boost/geometry/algorithms/detail/relate/result.hpp b/include/boost/geometry/algorithms/detail/relate/result.hpp index 1064246e4..0479a6440 100644 --- a/include/boost/geometry/algorithms/detail/relate/result.hpp +++ b/include/boost/geometry/algorithms/detail/relate/result.hpp @@ -911,7 +911,7 @@ struct static_check_dispatch return el == mask_el; } // else - static inline bool apply_dispatch(char el, integral_constant) + static inline bool apply_dispatch(char /*el*/, integral_constant) { return true; } diff --git a/include/boost/geometry/index/detail/rtree/pack_create.hpp b/include/boost/geometry/index/detail/rtree/pack_create.hpp index 232f4654f..e3ac16aef 100644 --- a/include/boost/geometry/index/detail/rtree/pack_create.hpp +++ b/include/boost/geometry/index/detail/rtree/pack_create.hpp @@ -294,7 +294,7 @@ private: inline static subtree_elements_counts calculate_subtree_elements_counts(std::size_t elements_count, parameters_type const& parameters, size_type & leafs_level) { - (void)parameters; + boost::ignore_unused_variable_warning(parameters); subtree_elements_counts res(1, 1); leafs_level = 0; diff --git a/test/algorithms/assign.cpp b/test/algorithms/assign.cpp index 52d935f93..a64f4010d 100644 --- a/test/algorithms/assign.cpp +++ b/test/algorithms/assign.cpp @@ -38,7 +38,7 @@ void check_geometry(Geometry const& geometry, std::string const& expected) } template -void check_assign_points(Points const& points, std::string const& expected) +void check_assign_points(Points const& points, std::string const& /*expected*/) { Geometry geometry; bg::assign_points(geometry, points); diff --git a/test/algorithms/test_convex_hull.hpp b/test/algorithms/test_convex_hull.hpp index edf4db48b..a11b42dd7 100644 --- a/test/algorithms/test_convex_hull.hpp +++ b/test/algorithms/test_convex_hull.hpp @@ -27,7 +27,7 @@ template void check_convex_hull(Geometry const& geometry, Hull const& hull, - std::size_t size_original, std::size_t size_hull, + std::size_t /*size_original*/, std::size_t size_hull, double expected_area, bool reverse) { std::size_t n = bg::num_points(hull);