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