Skip to content

Commit cec05db

Browse files
authored
Merge pull request boostorg#650 from boostorg/gcc_warn
Fix some gcc-13 warnings.
2 parents 5e1db68 + abc70a2 commit cec05db

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/boost/multiprecision/cpp_bin_float.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ class cpp_bin_float
346346
m_sign = false;
347347
m_exponent = 0;
348348

349-
constexpr std::ptrdiff_t bits = sizeof(int) * CHAR_BIT - 1 < MaxExponent - 1 ? sizeof(int) * CHAR_BIT - 1 : 3;
349+
constexpr std::ptrdiff_t bits = static_cast<Exponent>(sizeof(int) * CHAR_BIT - 1) < MaxExponent - 1 ? sizeof(int) * CHAR_BIT - 1 : 3;
350350
int e;
351351
f = frexpq(f, &e);
352352
while (f)

include/boost/multiprecision/detail/default_ops.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -2338,21 +2338,21 @@ template <class T, expression_template_option ExpressionTemplates>
23382338
inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<T>::value == number_kind_complex, component_type<number<T, ExpressionTemplates>>>::type::type
23392339
abs(const number<T, ExpressionTemplates>& v)
23402340
{
2341-
return std::move(boost::math::hypot(real(v), imag(v)));
2341+
return boost::math::hypot(real(v), imag(v));
23422342
}
23432343
template <class tag, class A1, class A2, class A3, class A4>
23442344
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
23452345
abs(const detail::expression<tag, A1, A2, A3, A4>& v)
23462346
{
23472347
using number_type = typename detail::expression<tag, A1, A2, A3, A4>::result_type;
2348-
return std::move(abs(static_cast<number_type>(v)));
2348+
return abs(static_cast<number_type>(v));
23492349
}
23502350

23512351
template <class T, expression_template_option ExpressionTemplates>
23522352
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
23532353
arg(const number<T, ExpressionTemplates>& v)
23542354
{
2355-
return std::move(atan2(imag(v), real(v)));
2355+
return atan2(imag(v), real(v));
23562356
}
23572357
template <class T, expression_template_option ExpressionTemplates>
23582358
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
@@ -2365,7 +2365,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<typename
23652365
arg(const detail::expression<tag, A1, A2, A3, A4>& v)
23662366
{
23672367
using number_type = typename detail::expression<tag, A1, A2, A3, A4>::result_type;
2368-
return std::move(arg(static_cast<number_type>(v)));
2368+
return arg(static_cast<number_type>(v));
23692369
}
23702370
#endif // BOOST_MP_MATH_AVAILABLE
23712371

@@ -2374,7 +2374,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<T>::valu
23742374
norm(const number<T, ExpressionTemplates>& v)
23752375
{
23762376
typename component_type<number<T, ExpressionTemplates> >::type a(real(v)), b(imag(v));
2377-
return std::move(a * a + b * b);
2377+
return a * a + b * b;
23782378
}
23792379
template <class T, expression_template_option ExpressionTemplates>
23802380
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
@@ -2387,7 +2387,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename scalar_result_from_possible_complex<typ
23872387
norm(const detail::expression<tag, A1, A2, A3, A4>& v)
23882388
{
23892389
using number_type = typename detail::expression<tag, A1, A2, A3, A4>::result_type;
2390-
return std::move(norm(static_cast<number_type>(v)));
2390+
return norm(static_cast<number_type>(v));
23912391
}
23922392

23932393
template <class Backend, expression_template_option ExpressionTemplates>

0 commit comments

Comments
 (0)