X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Fgzstream.h;h=d333dd424ee1c70b2a570d1e7e5c72c8584f9864;hb=8d640dc77608bedddb5b00982c23665584f52d21;hp=3c4568d6847dd94dc504c3cca8b959458b050606;hpb=917e9bd0ce88a4c2c5d6f35874cda882179466f2;p=lyx.git diff --git a/src/support/gzstream.h b/src/support/gzstream.h index 3c4568d684..d333dd424e 100644 --- a/src/support/gzstream.h +++ b/src/support/gzstream.h @@ -32,9 +32,7 @@ // standard C++ with new header file names and std:: namespace #include #include -#ifdef HAVE_ZLIB_H -# include -#endif +#include // For LyX #define GZSTREAM_NAMESPACE gz @@ -59,12 +57,12 @@ private: int flush_buffer(); public: - gzstreambuf() : opened(0) { - setp( buffer, buffer + (bufferSize-1)); - setg( buffer + 4, // beginning of putback area - buffer + 4, // read position - buffer + 4); // end position - // ASSERT: both input & output capabilities will not be used together + gzstreambuf() : opened(0), mode(0) { + setp( buffer, buffer + (bufferSize-1)); + setg( buffer + 4, // beginning of putback area + buffer + 4, // read position + buffer + 4); // end position + // ASSERT: both input & output capabilities will not be used together } int is_open() { return opened; } gzstreambuf* open( const char* name, int open_mode); @@ -98,10 +96,10 @@ class igzstream : public gzstreambase, public std::istream { public: igzstream() : std::istream( &buf) {} igzstream( const char* name, int open_mode = std::ios::in) - : gzstreambase( name, open_mode), std::istream( &buf) {} + : gzstreambase( name, open_mode), std::istream( &buf) {} gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); } void open( const char* name, int open_mode = std::ios::in) { - gzstreambase::open( name, open_mode); + gzstreambase::open( name, open_mode); } }; @@ -109,10 +107,10 @@ class ogzstream : public gzstreambase, public std::ostream { public: ogzstream() : std::ostream( &buf) {} ogzstream( const char* name, int mode = std::ios::out) - : gzstreambase( name, mode), std::ostream( &buf) {} + : gzstreambase( name, mode), std::ostream( &buf) {} gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); } void open( const char* name, int open_mode = std::ios::out) { - gzstreambase::open( name, open_mode); + gzstreambase::open( name, open_mode); } };