From 80a3741afc2440d7ee4a78b98432846fdb147bb4 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Sat, 29 Jul 2023 10:09:42 -0700 Subject: [PATCH] Avoid compiler warning with manual abs in mini_format_int_s(). Fixes #28 --- include/st_string_priv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/st_string_priv.h b/include/st_string_priv.h index 5fd47ef..2332a93 100644 --- a/include/st_string_priv.h +++ b/include/st_string_priv.h @@ -154,8 +154,8 @@ namespace _ST_PRIVATE { typedef typename std::make_unsigned::type uint_T; ST::uint_formatter formatter; - uint_T abs_value = value < 0 ? -static_cast(value) - : static_cast(value); + uint_T abs_value = value < 0 ? 0 - static_cast(value) + : static_cast(value); formatter.format(abs_value, radix, upper_case); ST::char_buffer result;