From abc70a2d8cfc0d647610d7f8f64cc8a6e00af209 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 17 Jan 2025 18:41:54 +0000 Subject: [PATCH] Fix some gcc-13 warnings. --- include/boost/multiprecision/cpp_bin_float.hpp | 2 +- include/boost/multiprecision/detail/default_ops.hpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boost/multiprecision/cpp_bin_float.hpp b/include/boost/multiprecision/cpp_bin_float.hpp index 4d873b4be..3745b2c53 100644 --- a/include/boost/multiprecision/cpp_bin_float.hpp +++ b/include/boost/multiprecision/cpp_bin_float.hpp @@ -346,7 +346,7 @@ class cpp_bin_float m_sign = false; m_exponent = 0; - constexpr std::ptrdiff_t bits = sizeof(int) * CHAR_BIT - 1 < MaxExponent - 1 ? sizeof(int) * CHAR_BIT - 1 : 3; + constexpr std::ptrdiff_t bits = static_cast(sizeof(int) * CHAR_BIT - 1) < MaxExponent - 1 ? sizeof(int) * CHAR_BIT - 1 : 3; int e; f = frexpq(f, &e); while (f) diff --git a/include/boost/multiprecision/detail/default_ops.hpp b/include/boost/multiprecision/detail/default_ops.hpp index bd0240aba..a11d17d10 100644 --- a/include/boost/multiprecision/detail/default_ops.hpp +++ b/include/boost/multiprecision/detail/default_ops.hpp @@ -2338,21 +2338,21 @@ template inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if::value == number_kind_complex, component_type>>::type::type abs(const number& v) { - return std::move(boost::math::hypot(real(v), imag(v))); + return boost::math::hypot(real(v), imag(v)); } template inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if::result_type>::value == number_kind_complex, component_type::result_type>>::type::type abs(const detail::expression& v) { using number_type = typename detail::expression::result_type; - return std::move(abs(static_cast(v))); + return abs(static_cast(v)); } template inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if::value == number_kind_complex, typename scalar_result_from_possible_complex >::type>::type arg(const number& v) { - return std::move(atan2(imag(v), real(v))); + return atan2(imag(v), real(v)); } template inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if::value == number_kind_floating_point, typename scalar_result_from_possible_complex >::type>::type @@ -2365,7 +2365,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if& v) { using number_type = typename detail::expression::result_type; - return std::move(arg(static_cast(v))); + return arg(static_cast(v)); } #endif // BOOST_MP_MATH_AVAILABLE @@ -2374,7 +2374,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if::valu norm(const number& v) { typename component_type >::type a(real(v)), b(imag(v)); - return std::move(a * a + b * b); + return a * a + b * b; } template inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if::value != number_kind_complex, typename scalar_result_from_possible_complex >::type>::type @@ -2387,7 +2387,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename scalar_result_from_possible_complex& v) { using number_type = typename detail::expression::result_type; - return std::move(norm(static_cast(v))); + return norm(static_cast(v)); } template