Skip to content

Commit

Permalink
Replace unusual method calling
Browse files Browse the repository at this point in the history
  • Loading branch information
0x8000-0000 committed Dec 20, 2018
1 parent eb4ed29 commit b1c727e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/fmt/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ struct chrono_format_checker {

template <typename Int>
inline int to_int(Int value) {
FMT_ASSERT(value >= (std::numeric_limits<int>::min)() &&
value <= (std::numeric_limits<int>::max)(), "invalid value");
FMT_ASSERT(value >= (std::numeric_limits<int>::min()) &&
value <= (std::numeric_limits<int>::max()), "invalid value");
return static_cast<int>(value);
}

Expand Down
4 changes: 2 additions & 2 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ FMT_CONSTEXPR unsigned parse_nonnegative_int(
}
unsigned value = 0;
// Convert to unsigned to prevent a warning.
unsigned max_int = (std::numeric_limits<int>::max)();
unsigned max_int = internal::to_unsigned(std::numeric_limits<int>::max());
unsigned big = max_int / 10;
do {
// Check for overflow.
Expand Down Expand Up @@ -1655,7 +1655,7 @@ FMT_CONSTEXPR void set_dynamic_spec(
T &value, basic_format_arg<Context> arg, ErrorHandler eh) {
unsigned long long big_value =
visit_format_arg(Handler<ErrorHandler>(eh), arg);
if (big_value > to_unsigned((std::numeric_limits<int>::max)()))
if (big_value > internal::to_unsigned(std::numeric_limits<int>::max()))
eh.on_error("number is too big");
value = static_cast<T>(big_value);
}
Expand Down
2 changes: 1 addition & 1 deletion include/fmt/ostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void write(std::basic_ostream<Char> &os, basic_buffer<Char> &buf) {
typedef std::make_unsigned<std::streamsize>::type UnsignedStreamSize;
UnsignedStreamSize size = buf.size();
UnsignedStreamSize max_size =
internal::to_unsigned((std::numeric_limits<std::streamsize>::max)());
internal::to_unsigned(std::numeric_limits<std::streamsize>::max());
do {
UnsignedStreamSize n = size <= max_size ? size : max_size;
os.write(data, static_cast<std::streamsize>(n));
Expand Down
4 changes: 2 additions & 2 deletions include/fmt/printf.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ FMT_CONSTEXPR unsigned parse_nonnegative_int(Iterator &it, ErrorHandler &&eh) {
}
unsigned value = 0;
// Convert to unsigned to prevent a warning.
unsigned max_int = (std::numeric_limits<int>::max)();
unsigned max_int = internal::to_unsigned(std::numeric_limits<int>::max());
unsigned big = max_int / 10;
do {
// Check for overflow.
Expand Down Expand Up @@ -493,7 +493,7 @@ class basic_printf_context :
// to the maximum unsigned value, the next argument.
format_arg get_arg(
iterator it,
unsigned arg_index = (std::numeric_limits<unsigned>::max)());
unsigned arg_index = std::numeric_limits<unsigned>::max());

// Parses argument index, flags and width and returns the argument index.
unsigned parse_header(iterator &it, format_specs &spec);
Expand Down

0 comments on commit b1c727e

Please sign in to comment.