Skip to content

Commit

Permalink
fix compiler warnings in public header files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Schwers authored and vitaut committed Sep 17, 2020
1 parent d55e61f commit 45da432
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@ template <typename OutputIt, typename Char, typename UInt> struct int_writer {
char digits[40];
format_decimal(digits, abs_value, num_digits);
basic_memory_buffer<Char> buffer;
size += prefix_size;
size += static_cast<int>(prefix_size);
const auto usize = to_unsigned(size);
buffer.resize(usize);
basic_string_view<Char> s(&sep, sep_size);
Expand Down Expand Up @@ -3495,7 +3495,7 @@ inline std::string to_string(T value) {
// The buffer should be large enough to store the number including the sign or
// "false" for bool.
constexpr int max_size = detail::digits10<T>() + 2;
char buffer[max_size > 5 ? max_size : 5];
char buffer[max_size > 5 ? static_cast<unsigned>(max_size) : 5];
char* begin = buffer;
return std::string(begin, detail::write<char>(begin, value));
}
Expand Down

0 comments on commit 45da432

Please sign in to comment.