mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-02 11:28:20 +00:00
Fix warnings
This commit is contained in:
parent
90730e706b
commit
1788883262
@ -51,13 +51,13 @@ class FormatBuf : public std::basic_streambuf<Char> {
|
||||
|
||||
int_type overflow(int_type ch = traits_type::eof()) {
|
||||
if (!traits_type::eq_int_type(ch, traits_type::eof())) {
|
||||
size_t size = this->size();
|
||||
buffer_.resize(size);
|
||||
buffer_.reserve(size * 2);
|
||||
size_t buf_size = size();
|
||||
buffer_.resize(buf_size);
|
||||
buffer_.reserve(buf_size * 2);
|
||||
|
||||
start_ = &buffer_[0];
|
||||
start_[size] = traits_type::to_char_type(ch);
|
||||
this->setp(start_+ size + 1, start_ + size * 2);
|
||||
start_[buf_size] = traits_type::to_char_type(ch);
|
||||
this->setp(start_+ buf_size + 1, start_ + buf_size * 2);
|
||||
}
|
||||
return ch;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ void format(BasicFormatter<char, ArgFormatter> &f,
|
||||
buffer.resize(start + count);
|
||||
break;
|
||||
}
|
||||
enum {MIN_GROWTH = 10};
|
||||
const std::size_t MIN_GROWTH = 10;
|
||||
buffer.reserve(buffer.capacity() + size > MIN_GROWTH ? size : MIN_GROWTH);
|
||||
}
|
||||
format_str = end + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user