Commit 1d751bc6 authored by JP Cimalando's avatar JP Cimalando Committed by Victor Zverovich

fix warning in header: signed/unsigned comparison

parent 11415bce
...@@ -3940,7 +3940,8 @@ const Char *BasicFormatter<Char, ArgFormatter>::format( ...@@ -3940,7 +3940,8 @@ const Char *BasicFormatter<Char, ArgFormatter>::format(
default: default:
FMT_THROW(FormatError("width is not integer")); FMT_THROW(FormatError("width is not integer"));
} }
if (value > (std::numeric_limits<int>::max)()) unsigned max_int = (std::numeric_limits<int>::max)();
if (value > max_int)
FMT_THROW(FormatError("number is too big")); FMT_THROW(FormatError("number is too big"));
spec.width_ = static_cast<int>(value); spec.width_ = static_cast<int>(value);
} }
...@@ -3978,7 +3979,8 @@ const Char *BasicFormatter<Char, ArgFormatter>::format( ...@@ -3978,7 +3979,8 @@ const Char *BasicFormatter<Char, ArgFormatter>::format(
default: default:
FMT_THROW(FormatError("precision is not integer")); FMT_THROW(FormatError("precision is not integer"));
} }
if (value > (std::numeric_limits<int>::max)()) unsigned max_int = (std::numeric_limits<int>::max)();
if (value > max_int)
FMT_THROW(FormatError("number is too big")); FMT_THROW(FormatError("number is too big"));
spec.precision_ = static_cast<int>(value); spec.precision_ = static_cast<int>(value);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment