diff options
author | Krystian Kuźniarek <krystian.kuzniarek@gmail.com> | 2020-09-10 17:09:16 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-09-10 17:09:16 +0100 |
commit | ef8b4335d9de68082e7fb41a8c505b90cfc71cb9 (patch) | |
tree | b25a80119b41c151b24288a5d89a6fa5392b4349 /libstdc++-v3/include/c_global | |
parent | 2b4cc19bd58b3957ed8b95b4d67b135233c147a1 (diff) | |
download | gcc-ef8b4335d9de68082e7fb41a8c505b90cfc71cb9.zip gcc-ef8b4335d9de68082e7fb41a8c505b90cfc71cb9.tar.gz gcc-ef8b4335d9de68082e7fb41a8c505b90cfc71cb9.tar.bz2 |
libstdc++: Add parentheses around assignments used as truth values
libstdc++-v3/ChangeLog:
* include/c_global/cmath (__lerp): Avoid -Wparentheses warnings.
Diffstat (limited to 'libstdc++-v3/include/c_global')
-rw-r--r-- | libstdc++-v3/include/c_global/cmath | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath index b99aaf8..2508051 100644 --- a/libstdc++-v3/include/c_global/cmath +++ b/libstdc++-v3/include/c_global/cmath @@ -1893,7 +1893,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr _Fp __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept { - if (__a <= 0 && __b >= 0 || __a >= 0 && __b <= 0) + if ((__a <= 0 && __b >= 0) || (__a >= 0 && __b <= 0)) return __t * __b + (1 - __t) * __a; if (__t == 1) @@ -1902,7 +1902,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Exact at __t=0, monotonic except near __t=1, // bounded, determinate, and consistent: const _Fp __x = __a + __t * (__b - __a); - return __t > 1 == __b > __a + return (__t > 1) == (__b > __a) ? (__b < __x ? __x : __b) : (__b > __x ? __x : __b); // monotonic near __t=1 } |