diff --git a/include/boost/geometry/policies/relate/intersection_points.hpp b/include/boost/geometry/policies/relate/intersection_points.hpp index 1ba08452f..1d7671ddf 100644 --- a/include/boost/geometry/policies/relate/intersection_points.hpp +++ b/include/boost/geometry/policies/relate/intersection_points.hpp @@ -2,8 +2,9 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2016. -// Modifications copyright (c) 2016 Oracle and/or its affiliates. +// This file was modified by Oracle on 2016, 2022. +// Modifications copyright (c) 2016-2022 Oracle and/or its affiliates. +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -68,7 +69,7 @@ struct segments_intersection_points Ratio const& rb_from_wrt_a, Ratio const& rb_to_wrt_a) { return_type result; - unsigned int index = 0, count_a = 0, count_b = 0; + unsigned int index = 0; Ratio on_a[2]; // The conditions "index < 2" are necessary for non-robust handling, @@ -87,7 +88,6 @@ struct segments_intersection_points result.fractions[index].assign(Ratio::zero(), ra_from_wrt_b); on_a[index] = Ratio::zero(); index++; - count_a++; } if (b1_wrt_a == 2 //rb_from_wrt_a.in_segment() && index < 2) @@ -103,7 +103,6 @@ struct segments_intersection_points result.fractions[index].assign(rb_from_wrt_a, Ratio::zero()); on_a[index] = rb_from_wrt_a; index++; - count_b++; } if (a2_wrt_b >= 1 && a2_wrt_b <= 3 //ra_to_wrt_b.on_segment() @@ -116,7 +115,6 @@ struct segments_intersection_points result.fractions[index].assign(Ratio::one(), ra_to_wrt_b); on_a[index] = Ratio::one(); index++; - count_a++; } if (b2_wrt_a == 2 // rb_to_wrt_a.in_segment() && index < 2) @@ -125,7 +123,6 @@ struct segments_intersection_points result.fractions[index].assign(rb_to_wrt_a, Ratio::one()); on_a[index] = rb_to_wrt_a; index++; - count_b++; } // TEMPORARY diff --git a/include/boost/geometry/util/math.hpp b/include/boost/geometry/util/math.hpp index 0f5a1a773..c88572ed5 100644 --- a/include/boost/geometry/util/math.hpp +++ b/include/boost/geometry/util/math.hpp @@ -4,8 +4,8 @@ // Copyright (c) 2008-2015 Bruno Lalande, Paris, France. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2014-2021. -// Modifications copyright (c) 2014-2021, Oracle and/or its affiliates. +// This file was modified by Oracle on 2014-2022. +// Modifications copyright (c) 2014-2022, Oracle and/or its affiliates. // Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle @@ -229,7 +229,7 @@ struct smaller { return false; } - + return ! equals::apply(b, a, equals_default_policy()); } }; @@ -859,16 +859,16 @@ inline void sin_cos_degrees(T const& x, { // In order to minimize round-off errors, this function exactly reduces // the argument to the range [-45, 45] before converting it to radians. - T remainder; int quotient; - remainder = math::mod(x, T(360)); - quotient = floor(remainder / 90 + T(0.5)); - remainder -= 90 * quotient; + T remainder = math::mod(x, T(360)); + T const quotient = std::floor(remainder / T(90) + T(0.5)); + remainder -= T(90) * quotient; // Convert to radians. remainder *= d2r(); - T s = sin(remainder), c = cos(remainder); + T const s = sin(remainder); + T const c = cos(remainder); switch (unsigned(quotient) & 3U) { @@ -881,7 +881,8 @@ inline void sin_cos_degrees(T const& x, // Set sign of 0 results. -0 only produced for sin(-0). if (x != 0) { - sinx += T(0); cosx += T(0); + sinx += T(0); + cosx += T(0); } }