Skip to content

Commit

Permalink
Avoid compiler warning with manual abs in mini_format_int_s().
Browse files Browse the repository at this point in the history
Fixes #28
  • Loading branch information
zrax committed Jul 29, 2023
1 parent 601e945 commit 80a3741
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/st_string_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ namespace _ST_PRIVATE
{
typedef typename std::make_unsigned<int_T>::type uint_T;
ST::uint_formatter<uint_T> formatter;
uint_T abs_value = value < 0 ? -static_cast<uint_T>(value)
: static_cast<uint_T>(value);
uint_T abs_value = value < 0 ? 0 - static_cast<uint_T>(value)
: static_cast<uint_T>(value);
formatter.format(abs_value, radix, upper_case);

ST::char_buffer result;
Expand Down

0 comments on commit 80a3741

Please sign in to comment.