fs/io/GunzipReader: use C++11 initializer

This commit is contained in:
Max Kellermann 2017-01-04 10:37:34 +01:00
parent bde50b1be8
commit 288b98ccbf
5 changed files with 10 additions and 11 deletions

View File

@ -31,13 +31,13 @@ class GunzipReader;
* #GunzipReader. * #GunzipReader.
*/ */
class AutoGunzipReader final : public Reader { class AutoGunzipReader final : public Reader {
Reader *next; Reader *next = nullptr;
PeekReader peek; PeekReader peek;
GunzipReader *gunzip; GunzipReader *gunzip = nullptr;
public: public:
AutoGunzipReader(Reader &_next) AutoGunzipReader(Reader &_next)
:next(nullptr), peek(_next), gunzip(nullptr) {} :peek(_next) {}
~AutoGunzipReader(); ~AutoGunzipReader();
/* virtual methods from class Reader */ /* virtual methods from class Reader */

View File

@ -35,14 +35,13 @@ class BufferedReader {
DynamicFifoBuffer<char> buffer; DynamicFifoBuffer<char> buffer;
bool eof; bool eof = false;
unsigned line_number; unsigned line_number = 0;
public: public:
BufferedReader(Reader &_reader) BufferedReader(Reader &_reader)
:reader(_reader), buffer(4096), eof(false), :reader(_reader), buffer(4096) {}
line_number(0) {}
/** /**
* Reset the internal state. Should be called after rewinding * Reset the internal state. Should be called after rewinding

View File

@ -22,7 +22,7 @@
#include "lib/zlib/Error.hxx" #include "lib/zlib/Error.hxx"
GunzipReader::GunzipReader(Reader &_next) GunzipReader::GunzipReader(Reader &_next)
:next(_next), eof(false) :next(_next)
{ {
z.next_in = nullptr; z.next_in = nullptr;
z.avail_in = 0; z.avail_in = 0;

View File

@ -33,7 +33,7 @@
class GunzipReader final : public Reader { class GunzipReader final : public Reader {
Reader &next; Reader &next;
bool eof; bool eof = false;
z_stream z; z_stream z;

View File

@ -34,13 +34,13 @@
class PeekReader final : public Reader { class PeekReader final : public Reader {
Reader &next; Reader &next;
size_t buffer_size, buffer_position; size_t buffer_size = 0, buffer_position = 0;
uint8_t buffer[64]; uint8_t buffer[64];
public: public:
PeekReader(Reader &_next) PeekReader(Reader &_next)
:next(_next), buffer_size(0), buffer_position(0) {} :next(_next) {}
const void *Peek(size_t size); const void *Peek(size_t size);