diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp index 9a8203695..93929c35b 100644 --- a/include/nlohmann/detail/output/serializer.hpp +++ b/include/nlohmann/detail/output/serializer.hpp @@ -1430,7 +1430,7 @@ class serializer // without leading zeros if (abs_value < 10000000000000000u) { - const std::uint64_t value = abs_value; + const auto value = static_cast(abs_value); // fits: abs_value < 10^16 const std::uint64_t upper = value / 100000000u; const std::uint64_t first = dtoa_impl::eight_digit_bytes(upper != 0 ? upper : value); const auto leading = static_cast(count_leading_zeros(first) / 8); // (first is not 0) diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index df02c065c..54af5b5ce 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -28951,7 +28951,7 @@ class serializer // without leading zeros if (abs_value < 10000000000000000u) { - const std::uint64_t value = abs_value; + const auto value = static_cast(abs_value); // fits: abs_value < 10^16 const std::uint64_t upper = value / 100000000u; const std::uint64_t first = dtoa_impl::eight_digit_bytes(upper != 0 ? upper : value); const auto leading = static_cast(count_leading_zeros(first) / 8); // (first is not 0)