diff --git a/octa/format.hh b/octa/format.hh index 97fca25..91086e8 100644 --- a/octa/format.hh +++ b/octa/format.hh @@ -246,9 +246,9 @@ namespace detail { /* Integer helpers */ - template + template static inline octa::Size write_u(R &writer, const FormatSpec &fl, - bool neg, octa::Uintmax val) { + bool neg, T val) { char buf[20]; octa::Size n = 0; for (; val; val /= 10) buf[n++] = '0' + val % 10; @@ -276,8 +276,9 @@ namespace detail { template struct WriteIntVal { static inline octa::Size write(R &writer, const FormatSpec &fl, T val) { + using UT = octa::MakeUnsigned; return octa::detail::write_u(writer, fl, val < 0, - (val < 0) ? -val : val); + (val < 0) ? UT(-val) : UT(val)); } };