mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02:00
small changes to reduce clang-9 warnings (#1808)
* include/fmt/format.h: int_writer: removed unnecessary iterator type re-declaration (prevents shadow-waringing in clang) * include/fmt/format.h: int_writer: correctly cast signed integer to unsigned to prevent 'implicit conversion changes signedness'-warnings in clang. Co-authored-by: Martin Wührer <martin.wuehrer@artech.at>
This commit is contained in:
@ -1610,7 +1610,8 @@ template <typename OutputIt, typename Char, typename UInt> struct int_writer {
|
|||||||
format_decimal(digits, abs_value, num_digits);
|
format_decimal(digits, abs_value, num_digits);
|
||||||
basic_memory_buffer<Char> buffer;
|
basic_memory_buffer<Char> buffer;
|
||||||
size += prefix_size;
|
size += prefix_size;
|
||||||
buffer.resize(to_unsigned(size));
|
const auto usize = to_unsigned(size);
|
||||||
|
buffer.resize(usize);
|
||||||
basic_string_view<Char> s(&sep, sep_size);
|
basic_string_view<Char> s(&sep, sep_size);
|
||||||
// Index of a decimal digit with the least significant digit having index 0.
|
// Index of a decimal digit with the least significant digit having index 0.
|
||||||
int digit_index = 0;
|
int digit_index = 0;
|
||||||
@ -1630,9 +1631,8 @@ template <typename OutputIt, typename Char, typename UInt> struct int_writer {
|
|||||||
make_checked(p, s.size()));
|
make_checked(p, s.size()));
|
||||||
}
|
}
|
||||||
if (prefix_size != 0) p[-1] = static_cast<Char>('-');
|
if (prefix_size != 0) p[-1] = static_cast<Char>('-');
|
||||||
using iterator = remove_reference_t<decltype(reserve(out, 0))>;
|
|
||||||
auto data = buffer.data();
|
auto data = buffer.data();
|
||||||
out = write_padded<align::right>(out, specs, size, size, [=](iterator it) {
|
out = write_padded<align::right>(out, specs, usize, usize, [=](iterator it) {
|
||||||
return copy_str<Char>(data, data + size, it);
|
return copy_str<Char>(data, data + size, it);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user