diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp index fff89f51cd..22fcfa6ac0 100644 --- a/include/nlohmann/detail/output/serializer.hpp +++ b/include/nlohmann/detail/output/serializer.hpp @@ -1571,7 +1571,7 @@ class serializer { return n_digits + 3; } - x = x / 10000u; + x = static_cast(x / 10000u); n_digits += 4; } } @@ -2200,7 +2200,7 @@ class serializer number_magnitude_t remove_sign(number_integer_t x) noexcept { JSON_ASSERT(x < 0); - return static_cast(-(x + 1)) + 1; + return static_cast(static_cast(-(x + 1)) + 1); } private: diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index ad99819dc3..ea6761b786 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -39057,7 +39057,7 @@ class serializer { return n_digits + 3; } - x = x / 10000u; + x = static_cast(x / 10000u); n_digits += 4; } } @@ -39686,7 +39686,7 @@ class serializer number_magnitude_t remove_sign(number_integer_t x) noexcept { JSON_ASSERT(x < 0); - return static_cast(-(x + 1)) + 1; + return static_cast(static_cast(-(x + 1)) + 1); } private: