From 1788883262de8a767e4194171ed157ede11ddd74 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 7 May 2016 07:03:21 -0700 Subject: [PATCH] Fix warnings --- fmt/ostream.h | 10 +++++----- fmt/time.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fmt/ostream.h b/fmt/ostream.h index 3963763f..458d31de 100644 --- a/fmt/ostream.h +++ b/fmt/ostream.h @@ -51,13 +51,13 @@ class FormatBuf : public std::basic_streambuf { 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; } diff --git a/fmt/time.h b/fmt/time.h index 20e74dc2..863382c0 100644 --- a/fmt/time.h +++ b/fmt/time.h @@ -54,7 +54,7 @@ void format(BasicFormatter &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;