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