diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 599252dd..b15eb21c 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -815,8 +815,7 @@ inline uint128_wrapper umul128(uint64_t x, uint64_t y) noexcept { result.low_ = _umul128(x, y, &result.high_); return result; #else - const uint64_t mask = - static_cast(std::numeric_limits::max()); + const uint64_t mask = static_cast(max_value()); uint64_t a = x >> 32; uint64_t b = x & mask; @@ -1820,12 +1819,12 @@ FMT_INLINE int remove_trailing_zeros(uint32_t& n) noexcept { int s = 0; while (true) { auto q = rotr(n * mod_inv_25, 2); - if (q > std::numeric_limits::max() / 100) break; + if (q > max_value() / 100) break; n = q; s += 2; } auto q = rotr(n * mod_inv_5, 1); - if (q <= std::numeric_limits::max() / 10) { + if (q <= max_value() / 10) { n = q; s |= 1; } @@ -1852,12 +1851,12 @@ FMT_INLINE int remove_trailing_zeros(uint64_t& n) noexcept { int s = 8; while (true) { auto q = rotr(n32 * mod_inv_25, 2); - if (q > std::numeric_limits::max() / 100) break; + if (q > max_value() / 100) break; n32 = q; s += 2; } auto q = rotr(n32 * mod_inv_5, 1); - if (q <= std::numeric_limits::max() / 10) { + if (q <= max_value() / 10) { n32 = q; s |= 1; } @@ -1873,12 +1872,12 @@ FMT_INLINE int remove_trailing_zeros(uint64_t& n) noexcept { int s = 0; while (true) { auto q = rotr(n * mod_inv_25, 2); - if (q > std::numeric_limits::max() / 100) break; + if (q > max_value() / 100) break; n = q; s += 2; } auto q = rotr(n * mod_inv_5, 1); - if (q <= std::numeric_limits::max() / 10) { + if (q <= max_value() / 10) { n = q; s |= 1; }