Skip to content

Commit

Permalink
Merge pull request #650 from boostorg/gcc_warn
Browse files Browse the repository at this point in the history
Fix some gcc-13 warnings.
  • Loading branch information
jzmaddock authored Jan 17, 2025
2 parents 5e1db68 + abc70a2 commit cec05db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/boost/multiprecision/cpp_bin_float.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Exponent>(sizeof(int) * CHAR_BIT - 1) < MaxExponent - 1 ? sizeof(int) * CHAR_BIT - 1 : 3;
int e;
f = frexpq(f, &e);
while (f)
Expand Down
12 changes: 6 additions & 6 deletions include/boost/multiprecision/detail/default_ops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2338,21 +2338,21 @@ template <class T, expression_template_option ExpressionTemplates>
inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<T>::value == number_kind_complex, component_type<number<T, ExpressionTemplates>>>::type::type
abs(const number<T, ExpressionTemplates>& v)
{
return std::move(boost::math::hypot(real(v), imag(v)));
return boost::math::hypot(real(v), imag(v));
}
template <class tag, class A1, class A2, class A3, class A4>
inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<typename detail::expression<tag, A1, A2, A3, A4>::result_type>::value == number_kind_complex, component_type<typename detail::expression<tag, A1, A2, A3, A4>::result_type>>::type::type
abs(const detail::expression<tag, A1, A2, A3, A4>& v)
{
using number_type = typename detail::expression<tag, A1, A2, A3, A4>::result_type;
return std::move(abs(static_cast<number_type>(v)));
return abs(static_cast<number_type>(v));
}

template <class T, expression_template_option ExpressionTemplates>
inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<T>::value == number_kind_complex, typename scalar_result_from_possible_complex<number<T, ExpressionTemplates> >::type>::type
arg(const number<T, ExpressionTemplates>& v)
{
return std::move(atan2(imag(v), real(v)));
return atan2(imag(v), real(v));
}
template <class T, expression_template_option ExpressionTemplates>
inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<T>::value == number_kind_floating_point, typename scalar_result_from_possible_complex<number<T, ExpressionTemplates> >::type>::type
Expand All @@ -2365,7 +2365,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<typename
arg(const detail::expression<tag, A1, A2, A3, A4>& v)
{
using number_type = typename detail::expression<tag, A1, A2, A3, A4>::result_type;
return std::move(arg(static_cast<number_type>(v)));
return arg(static_cast<number_type>(v));
}
#endif // BOOST_MP_MATH_AVAILABLE

Expand All @@ -2374,7 +2374,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<T>::valu
norm(const number<T, ExpressionTemplates>& v)
{
typename component_type<number<T, ExpressionTemplates> >::type a(real(v)), b(imag(v));
return std::move(a * a + b * b);
return a * a + b * b;
}
template <class T, expression_template_option ExpressionTemplates>
inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<T>::value != number_kind_complex, typename scalar_result_from_possible_complex<number<T, ExpressionTemplates> >::type>::type
Expand All @@ -2387,7 +2387,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename scalar_result_from_possible_complex<typ
norm(const detail::expression<tag, A1, A2, A3, A4>& v)
{
using number_type = typename detail::expression<tag, A1, A2, A3, A4>::result_type;
return std::move(norm(static_cast<number_type>(v)));
return norm(static_cast<number_type>(v));
}

template <class Backend, expression_template_option ExpressionTemplates>
Expand Down

0 comments on commit cec05db

Please sign in to comment.