fix compiler warnings in public header files
core.h: buffer had virtual functions but the dtor was not virtual. format.f: fix two sign conversions warnings
This commit is contained in:
parent
6cccdc24bc
commit
6f50b0293f
@ -669,7 +669,7 @@ template <typename T> class buffer {
|
|||||||
size_(sz),
|
size_(sz),
|
||||||
capacity_(cap) {}
|
capacity_(cap) {}
|
||||||
|
|
||||||
~buffer() = default;
|
virtual ~buffer() = default;
|
||||||
|
|
||||||
/** Sets the buffer data and capacity. */
|
/** Sets the buffer data and capacity. */
|
||||||
void set(T* buf_data, size_t buf_capacity) FMT_NOEXCEPT {
|
void set(T* buf_data, size_t buf_capacity) FMT_NOEXCEPT {
|
||||||
|
|||||||
@ -1609,7 +1609,7 @@ template <typename OutputIt, typename Char, typename UInt> struct int_writer {
|
|||||||
char digits[40];
|
char digits[40];
|
||||||
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 += static_cast<int>(prefix_size);
|
||||||
const auto usize = to_unsigned(size);
|
const auto usize = to_unsigned(size);
|
||||||
buffer.resize(usize);
|
buffer.resize(usize);
|
||||||
basic_string_view<Char> s(&sep, sep_size);
|
basic_string_view<Char> s(&sep, sep_size);
|
||||||
@ -3493,7 +3493,7 @@ inline std::string to_string(T value) {
|
|||||||
// The buffer should be large enough to store the number including the sign or
|
// The buffer should be large enough to store the number including the sign or
|
||||||
// "false" for bool.
|
// "false" for bool.
|
||||||
constexpr int max_size = detail::digits10<T>() + 2;
|
constexpr int max_size = detail::digits10<T>() + 2;
|
||||||
char buffer[max_size > 5 ? max_size : 5];
|
char buffer[max_size > 5 ? static_cast<size_t>(max_size) : 5];
|
||||||
char* begin = buffer;
|
char* begin = buffer;
|
||||||
return std::string(begin, detail::write<char>(begin, value));
|
return std::string(begin, detail::write<char>(begin, value));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user