mirror of
https://github.com/fmtlib/fmt.git
synced 2025-02-24 12:40:38 +00:00
Fix warning C4365 emitted from printf.h (#3865)
This commit is contained in:
parent
0166f455f6
commit
ddf0b7d2b5
@ -60,7 +60,7 @@ namespace detail {
|
||||
// signed and unsigned integers.
|
||||
template <bool IsSigned> struct int_checker {
|
||||
template <typename T> static auto fits_in_int(T value) -> bool {
|
||||
unsigned max = max_value<int>();
|
||||
unsigned max = to_unsigned(max_value<int>());
|
||||
return value <= max;
|
||||
}
|
||||
static auto fits_in_int(bool) -> bool { return true; }
|
||||
@ -205,7 +205,7 @@ class printf_width_handler {
|
||||
specs_.align = align::left;
|
||||
width = 0 - width;
|
||||
}
|
||||
unsigned int_max = max_value<int>();
|
||||
unsigned int_max = to_unsigned(max_value<int>());
|
||||
if (width > int_max) report_error("number is too big");
|
||||
return static_cast<unsigned>(width);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user