From 506dbbf7165ee93d4d0850e0e8edc34ecc47ae99 Mon Sep 17 00:00:00 2001 From: Stepan Ponomarev Date: Wed, 19 Oct 2022 12:40:39 +0300 Subject: [PATCH] fix errors --- include/fmt/chrono.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index d1f45e9d..85f4d9b9 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -1701,7 +1701,7 @@ struct chrono_formatter { } } - template void write_fractional_seconds(Duration d, int precision) { + template void write_fractional_seconds_p(Duration d) { constexpr auto num_fractional_digits = count_fractional_digits::value; @@ -1728,7 +1728,7 @@ struct chrono_formatter { out = std::fill_n(out, zeroes, '0'); int remaining = precision - (zeroes > 0 ? zeroes : 0); if (remaining < num_digits) { - n /= detail::pow10(num_digits - remaining); + n /= to_unsigned(detail::pow10(to_unsigned(num_digits - remaining))); out = format_decimal(out, n, remaining).end; return; } @@ -1831,7 +1831,7 @@ struct chrono_formatter { } else { write(second(), 2); if (precision >= 0) { - write_fractional_seconds(std::chrono::duration(val), precision); + write_fractional_seconds_p(std::chrono::duration(val)); } else { write_fractional_seconds(std::chrono::duration(val)); }