From 98605e7a56d16ef0f95e63d96f9467fd45cefd7b Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 19 Apr 2023 17:36:06 +0200 Subject: [PATCH] Fix MSVC 14.0 warning C4244 --- include/boost/charconv/detail/dragonbox.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/charconv/detail/dragonbox.hpp b/include/boost/charconv/detail/dragonbox.hpp index d962d1e..ff4624c 100644 --- a/include/boost/charconv/detail/dragonbox.hpp +++ b/include/boost/charconv/detail/dragonbox.hpp @@ -382,13 +382,13 @@ struct dragonbox_signed_significand_bits // so we does this manually. BOOST_IF_CONSTEXPR (std::is_same::value && N == 2) { - return umul64(static_cast(n), UINT32_C(1374389535)) >> 37; + return static_cast(umul64(static_cast(n), UINT32_C(1374389535)) >> 37); } // Specialize for 64-bit division by 1000. // Ensure that the correctness condition is met. else BOOST_IF_CONSTEXPR (std::is_same::value && N == 3 && n_max <= UINT64_C(15534100272597517998)) { - return umul128_upper64(n, UINT64_C(2361183241434822607)) >> 7; + return static_cast(umul128_upper64(n, UINT64_C(2361183241434822607)) >> 7); } else { @@ -400,13 +400,13 @@ struct dragonbox_signed_significand_bits template BOOST_CXX14_CONSTEXPR UInt divide_by_pow10(unsigned N, UInt n_max, UInt n) noexcept { - if (std::is_same::value && N == 2) + BOOST_IF_CONSTEXPR (std::is_same::value && N == 2) { - return static_cast(umul64(n, UINT32_C(1374389535)) >> 37); + return static_cast(umul64(static_cast(n), static_cast(1374389535)) >> UINT32_C(37)); } // Specialize for 64-bit division by 1000. // Ensure that the correctness condition is met. - else if (std::is_same::value && N == 3 && n_max <= UINT64_C(15534100272597517998)) + else BOOST_IF_CONSTEXPR (std::is_same::value && N == 3 && n_max <= UINT64_C(15534100272597517998)) { return static_cast(umul128_upper64(n, UINT64_C(2361183241434822607)) >> 7); }