Merge pull request #1078 from vissarion/fix/warnings

Fix a few warnings
This commit is contained in:
Vissarion Fisikopoulos 2022-11-08 10:46:45 +02:00 committed by GitHub
commit 4a255ab4b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 16 deletions

View File

@ -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

View File

@ -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<Type, true>
{
return false;
}
return ! equals<Type, true>::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>();
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);
}
}