From 588ee2f1cc11061332c508a848f2568ea2585ddb Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 3 Mar 2013 22:51:27 +0900 Subject: [PATCH] GZipFile: Move buf_, buflen_ to initializer list --- src/GZipFile.cc | 5 ++--- src/GZipFile.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/GZipFile.cc b/src/GZipFile.cc index d386d60b..947c5318 100644 --- a/src/GZipFile.cc +++ b/src/GZipFile.cc @@ -44,7 +44,8 @@ namespace aria2 { GZipFile::GZipFile(const char* filename, const char* mode) - : BufferedFile(0), fp_(0), open_(false) + : BufferedFile(0), fp_(0), open_(false), + buflen_(1024), buf_(reinterpret_cast(malloc(buflen_))) { FILE* fp = #ifdef __MINGW32__ @@ -72,8 +73,6 @@ GZipFile::GZipFile(const char* filename, const char* mode) } fclose(fp); } - buflen_ = 1024; - buf_ = reinterpret_cast(malloc(buflen_)); } GZipFile::~GZipFile() diff --git a/src/GZipFile.h b/src/GZipFile.h index 9e294235..4e612624 100644 --- a/src/GZipFile.h +++ b/src/GZipFile.h @@ -60,8 +60,8 @@ private: gzFile fp_; bool open_; - char* buf_; size_t buflen_; + char* buf_; protected: virtual bool isError() const; virtual bool isEOF() const { return gzeof(fp_); }