diff options
Diffstat (limited to 'common/rdr')
31 files changed, 93 insertions, 91 deletions
diff --git a/common/rdr/AESInStream.cxx b/common/rdr/AESInStream.cxx index de91a3df..d6d944a3 100644 --- a/common/rdr/AESInStream.cxx +++ b/common/rdr/AESInStream.cxx @@ -45,15 +45,15 @@ bool AESInStream::fillBuffer() { if (!in->hasData(2)) return false; - const uint8_t* ptr = in->getptr(2); - size_t length = ((int)ptr[0] << 8) | (int)ptr[1]; + const uint8_t* buf = in->getptr(2); + size_t length = ((int)buf[0] << 8) | (int)buf[1]; if (!in->hasData(2 + length + 16)) return false; ensureSpace(length); - ptr = in->getptr(2 + length + 16); - const uint8_t* ad = ptr; - const uint8_t* data = ptr + 2; - const uint8_t* mac = ptr + 2 + length; + buf = in->getptr(2 + length + 16); + const uint8_t* ad = buf; + const uint8_t* data = buf + 2; + const uint8_t* mac = buf + 2 + length; uint8_t macComputed[16]; if (keySize == 128) { diff --git a/common/rdr/AESInStream.h b/common/rdr/AESInStream.h index 6069bb71..f0e6de53 100644 --- a/common/rdr/AESInStream.h +++ b/common/rdr/AESInStream.h @@ -33,7 +33,7 @@ namespace rdr { virtual ~AESInStream(); private: - virtual bool fillBuffer(); + bool fillBuffer() override; int keySize; InStream* in; diff --git a/common/rdr/AESOutStream.h b/common/rdr/AESOutStream.h index f9e4f4da..c84ee2b8 100644 --- a/common/rdr/AESOutStream.h +++ b/common/rdr/AESOutStream.h @@ -31,11 +31,11 @@ namespace rdr { AESOutStream(OutStream* out, const uint8_t* key, int keySize); virtual ~AESOutStream(); - virtual void flush(); - virtual void cork(bool enable); + void flush() override; + void cork(bool enable) override; private: - virtual bool flushBuffer(); + bool flushBuffer() override; void writeMessage(const uint8_t* data, size_t length); int keySize; diff --git a/common/rdr/BufferedInStream.cxx b/common/rdr/BufferedInStream.cxx index 5978a8c9..3c04bafc 100644 --- a/common/rdr/BufferedInStream.cxx +++ b/common/rdr/BufferedInStream.cxx @@ -35,7 +35,7 @@ BufferedInStream::BufferedInStream() : bufSize(DEFAULT_BUF_SIZE), offset(0) { ptr = end = start = new uint8_t[bufSize]; - gettimeofday(&lastSizeCheck, NULL); + gettimeofday(&lastSizeCheck, nullptr); peakUsage = 0; } @@ -80,7 +80,7 @@ void BufferedInStream::ensureSpace(size_t needed) end = newBuffer + (end - ptr); ptr = start = newBuffer; - gettimeofday(&lastSizeCheck, NULL); + gettimeofday(&lastSizeCheck, nullptr); peakUsage = needed; } @@ -88,7 +88,7 @@ void BufferedInStream::ensureSpace(size_t needed) peakUsage = needed; // Time to shrink an excessive buffer? - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); if ((avail() == 0) && (bufSize > DEFAULT_BUF_SIZE) && ((now.tv_sec < lastSizeCheck.tv_sec) || (now.tv_sec > (lastSizeCheck.tv_sec + 5)))) { @@ -105,7 +105,7 @@ void BufferedInStream::ensureSpace(size_t needed) bufSize = newSize; } - gettimeofday(&lastSizeCheck, NULL); + gettimeofday(&lastSizeCheck, nullptr); peakUsage = needed; } diff --git a/common/rdr/BufferedInStream.h b/common/rdr/BufferedInStream.h index 89b25ffb..b3d6115e 100644 --- a/common/rdr/BufferedInStream.h +++ b/common/rdr/BufferedInStream.h @@ -35,7 +35,7 @@ namespace rdr { public: virtual ~BufferedInStream(); - virtual size_t pos(); + size_t pos() override; protected: size_t availSpace() { return start + bufSize - end; } @@ -45,7 +45,7 @@ namespace rdr { private: virtual bool fillBuffer() = 0; - virtual bool overrun(size_t needed); + bool overrun(size_t needed) override; private: size_t bufSize; diff --git a/common/rdr/BufferedOutStream.cxx b/common/rdr/BufferedOutStream.cxx index 640f6007..0d6a1eb6 100644 --- a/common/rdr/BufferedOutStream.cxx +++ b/common/rdr/BufferedOutStream.cxx @@ -31,12 +31,12 @@ using namespace rdr; static const size_t DEFAULT_BUF_SIZE = 16384; static const size_t MAX_BUF_SIZE = 32 * 1024 * 1024; -BufferedOutStream::BufferedOutStream(bool emulateCork) - : bufSize(DEFAULT_BUF_SIZE), offset(0), emulateCork(emulateCork) +BufferedOutStream::BufferedOutStream(bool emulateCork_) + : bufSize(DEFAULT_BUF_SIZE), offset(0), emulateCork(emulateCork_) { ptr = start = sentUpTo = new uint8_t[bufSize]; end = start + bufSize; - gettimeofday(&lastSizeCheck, NULL); + gettimeofday(&lastSizeCheck, nullptr); peakUsage = 0; } @@ -75,7 +75,7 @@ void BufferedOutStream::flush() ptr = sentUpTo = start; // Time to shrink an excessive buffer? - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); if ((sentUpTo == ptr) && (bufSize > DEFAULT_BUF_SIZE) && ((now.tv_sec < lastSizeCheck.tv_sec) || (now.tv_sec > (lastSizeCheck.tv_sec + 5)))) { @@ -93,7 +93,7 @@ void BufferedOutStream::flush() bufSize = newSize; } - gettimeofday(&lastSizeCheck, NULL); + gettimeofday(&lastSizeCheck, nullptr); peakUsage = 0; } } @@ -156,7 +156,7 @@ void BufferedOutStream::overrun(size_t needed) sentUpTo = start = newBuffer; end = newBuffer + newSize; - gettimeofday(&lastSizeCheck, NULL); + gettimeofday(&lastSizeCheck, nullptr); peakUsage = totalNeeded; return; diff --git a/common/rdr/BufferedOutStream.h b/common/rdr/BufferedOutStream.h index 22693257..dd765dc9 100644 --- a/common/rdr/BufferedOutStream.h +++ b/common/rdr/BufferedOutStream.h @@ -35,8 +35,8 @@ namespace rdr { public: virtual ~BufferedOutStream(); - virtual size_t length(); - virtual void flush(); + size_t length() override; + void flush() override; // hasBufferedData() checks if there is any data yet to be flushed @@ -49,7 +49,7 @@ namespace rdr { virtual bool flushBuffer() = 0; - virtual void overrun(size_t needed); + void overrun(size_t needed) override; private: size_t bufSize; diff --git a/common/rdr/Exception.cxx b/common/rdr/Exception.cxx index b1e0a841..d5546274 100644 --- a/common/rdr/Exception.cxx +++ b/common/rdr/Exception.cxx @@ -51,15 +51,15 @@ Exception::Exception(const char *format, ...) { va_end(ap); } -GAIException::GAIException(const char* s, int err) - : Exception("%s", s) +GAIException::GAIException(const char* s, int err_) + : Exception("%s", s), err(err_) { strncat(str_, ": ", len-1-strlen(str_)); #ifdef _WIN32 wchar_t *currStr = new wchar_t[len-strlen(str_)]; wcsncpy(currStr, gai_strerrorW(err), len-1-strlen(str_)); WideCharToMultiByte(CP_UTF8, 0, currStr, -1, str_+strlen(str_), - len-1-strlen(str_), 0, 0); + len-1-strlen(str_), nullptr, nullptr); delete [] currStr; #else strncat(str_, gai_strerror(err), len-1-strlen(str_)); @@ -83,9 +83,9 @@ SystemException::SystemException(const char* s, int err_) #ifdef _WIN32 wchar_t *currStr = new wchar_t[len-strlen(str_)]; FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - 0, err, 0, currStr, len-1-strlen(str_), 0); + nullptr, err, 0, currStr, len-1-strlen(str_), nullptr); WideCharToMultiByte(CP_UTF8, 0, currStr, -1, str_+strlen(str_), - len-1-strlen(str_), 0, 0); + len-1-strlen(str_), nullptr, nullptr); delete [] currStr; int l = strlen(str_); diff --git a/common/rdr/Exception.h b/common/rdr/Exception.h index 2c66ffca..f1a167e5 100644 --- a/common/rdr/Exception.h +++ b/common/rdr/Exception.h @@ -26,7 +26,7 @@ namespace rdr { struct Exception { enum { len = 256 }; char str_[len]; - Exception(const char *format = 0, ...) + Exception(const char *format=nullptr, ...) __attribute__((__format__ (__printf__, 2, 3))); virtual ~Exception() {} virtual const char* str() const { return str_; } diff --git a/common/rdr/FdInStream.cxx b/common/rdr/FdInStream.cxx index 8e12f3a4..491dc008 100644 --- a/common/rdr/FdInStream.cxx +++ b/common/rdr/FdInStream.cxx @@ -88,7 +88,7 @@ size_t FdInStream::readFd(uint8_t* buf, size_t len) FD_ZERO(&fds); FD_SET(fd, &fds); - n = select(fd+1, &fds, 0, 0, &tv); + n = select(fd+1, &fds, nullptr, nullptr, &tv); } while (n < 0 && errorNumber == EINTR); if (n < 0) diff --git a/common/rdr/FdInStream.h b/common/rdr/FdInStream.h index 0f8373fe..0bd5bf19 100644 --- a/common/rdr/FdInStream.h +++ b/common/rdr/FdInStream.h @@ -37,7 +37,7 @@ namespace rdr { int getFd() { return fd; } private: - virtual bool fillBuffer(); + bool fillBuffer() override; size_t readFd(uint8_t* buf, size_t len); diff --git a/common/rdr/FdOutStream.cxx b/common/rdr/FdOutStream.cxx index 6827655f..1f60d45b 100644 --- a/common/rdr/FdOutStream.cxx +++ b/common/rdr/FdOutStream.cxx @@ -59,7 +59,7 @@ FdOutStream::FdOutStream(int fd_) #endif fd(fd_) { - gettimeofday(&lastWrite, NULL); + gettimeofday(&lastWrite, nullptr); } FdOutStream::~FdOutStream() @@ -113,7 +113,7 @@ size_t FdOutStream::writeFd(const uint8_t* data, size_t length) FD_ZERO(&fds); FD_SET(fd, &fds); - n = select(fd+1, 0, &fds, 0, &tv); + n = select(fd+1, nullptr, &fds, nullptr, &tv); } while (n < 0 && errorNumber == EINTR); if (n < 0) @@ -136,7 +136,7 @@ size_t FdOutStream::writeFd(const uint8_t* data, size_t length) if (n < 0) throw SystemException("write", errorNumber); - gettimeofday(&lastWrite, NULL); + gettimeofday(&lastWrite, nullptr); return n; } diff --git a/common/rdr/FdOutStream.h b/common/rdr/FdOutStream.h index 05fc1fed..d9f16efb 100644 --- a/common/rdr/FdOutStream.h +++ b/common/rdr/FdOutStream.h @@ -41,10 +41,10 @@ namespace rdr { unsigned getIdleTime(); - virtual void cork(bool enable); + void cork(bool enable) override; private: - virtual bool flushBuffer(); + bool flushBuffer() override; size_t writeFd(const uint8_t* data, size_t length); int fd; struct timeval lastWrite; diff --git a/common/rdr/FileInStream.cxx b/common/rdr/FileInStream.cxx index 6de1a5b2..4239a238 100644 --- a/common/rdr/FileInStream.cxx +++ b/common/rdr/FileInStream.cxx @@ -39,7 +39,7 @@ FileInStream::FileInStream(const char *fileName) FileInStream::~FileInStream(void) { if (file) { fclose(file); - file = NULL; + file = nullptr; } } diff --git a/common/rdr/FileInStream.h b/common/rdr/FileInStream.h index e13596ce..1b409e46 100644 --- a/common/rdr/FileInStream.h +++ b/common/rdr/FileInStream.h @@ -34,7 +34,7 @@ namespace rdr { ~FileInStream(void); private: - virtual bool fillBuffer(); + bool fillBuffer() override; private: FILE *file; diff --git a/common/rdr/HexInStream.h b/common/rdr/HexInStream.h index 76f91c08..c69fcd68 100644 --- a/common/rdr/HexInStream.h +++ b/common/rdr/HexInStream.h @@ -30,7 +30,7 @@ namespace rdr { virtual ~HexInStream(); private: - virtual bool fillBuffer(); + bool fillBuffer() override; private: InStream& in_stream; diff --git a/common/rdr/HexOutStream.h b/common/rdr/HexOutStream.h index 16596bf3..7c74f9de 100644 --- a/common/rdr/HexOutStream.h +++ b/common/rdr/HexOutStream.h @@ -29,11 +29,11 @@ namespace rdr { HexOutStream(OutStream& os); virtual ~HexOutStream(); - virtual void flush(); - virtual void cork(bool enable); + void flush() override; + void cork(bool enable) override; private: - virtual bool flushBuffer(); + bool flushBuffer() override; void writeBuffer(); OutStream& out_stream; diff --git a/common/rdr/InStream.h b/common/rdr/InStream.h index 019ca5a7..939439e1 100644 --- a/common/rdr/InStream.h +++ b/common/rdr/InStream.h @@ -64,7 +64,7 @@ namespace rdr { #endif if (length > (size_t)(end - ptr)) { - if (restorePoint != NULL) { + if (restorePoint != nullptr) { bool ret; size_t restoreDiff; @@ -100,21 +100,21 @@ namespace rdr { inline void setRestorePoint() { #ifdef RFB_INSTREAM_CHECK - if (restorePoint != NULL) + if (restorePoint != nullptr) throw Exception("Nested use of input stream restore point"); #endif restorePoint = ptr; } inline void clearRestorePoint() { #ifdef RFB_INSTREAM_CHECK - if (restorePoint == NULL) + if (restorePoint == nullptr) throw Exception("Incorrect clearing of input stream restore point"); #endif - restorePoint = NULL; + restorePoint = nullptr; } inline void gotoRestorePoint() { #ifdef RFB_INSTREAM_CHECK - if (restorePoint == NULL) + if (restorePoint == nullptr) throw Exception("Incorrect activation of input stream restore point"); #endif ptr = restorePoint; @@ -204,7 +204,7 @@ namespace rdr { protected: - InStream() : restorePoint(NULL) + InStream() : restorePoint(nullptr) #ifdef RFB_INSTREAM_CHECK ,checkedBytes(0) #endif diff --git a/common/rdr/MemInStream.h b/common/rdr/MemInStream.h index 61d08482..e10273b1 100644 --- a/common/rdr/MemInStream.h +++ b/common/rdr/MemInStream.h @@ -54,12 +54,12 @@ namespace rdr { delete [] start; } - size_t pos() { return ptr - start; } + size_t pos() override { return ptr - start; } void reposition(size_t pos) { ptr = start + pos; } private: - bool overrun(size_t /*needed*/) { throw EndOfStream(); } + bool overrun(size_t /*needed*/) override { throw EndOfStream(); } const uint8_t* start; bool deleteWhenDone; }; diff --git a/common/rdr/MemOutStream.h b/common/rdr/MemOutStream.h index 5ed1ccf7..9bf2b810 100644 --- a/common/rdr/MemOutStream.h +++ b/common/rdr/MemOutStream.h @@ -41,7 +41,7 @@ namespace rdr { delete [] start; } - size_t length() { return ptr - start; } + size_t length() override { return ptr - start; } void clear() { ptr = start; }; void clearAndZero() { memset(start, 0, ptr-start); clear(); } void reposition(size_t pos) { ptr = start + pos; } @@ -55,7 +55,7 @@ namespace rdr { // overrun() either doubles the buffer or adds enough space for // needed bytes. - virtual void overrun(size_t needed) { + void overrun(size_t needed) override { size_t len = ptr - start + needed; if (len < (size_t)(end - start) * 2) len = (end - start) * 2; diff --git a/common/rdr/OutStream.h b/common/rdr/OutStream.h index 8450efd0..2921b232 100644 --- a/common/rdr/OutStream.h +++ b/common/rdr/OutStream.h @@ -36,7 +36,7 @@ namespace rdr { protected: - OutStream() : ptr(NULL), end(NULL), corked(false) {} + OutStream() : ptr(nullptr), end(nullptr), corked(false) {} public: diff --git a/common/rdr/RandomStream.cxx b/common/rdr/RandomStream.cxx index 79a1a0f7..9813abdd 100644 --- a/common/rdr/RandomStream.cxx +++ b/common/rdr/RandomStream.cxx @@ -45,9 +45,11 @@ RandomStream::RandomStream() { #ifdef RFB_HAVE_WINCRYPT provider = 0; - if (!CryptAcquireContext(&provider, 0, 0, PROV_RSA_FULL, 0)) { + if (!CryptAcquireContext(&provider, nullptr, nullptr, + PROV_RSA_FULL, 0)) { if (GetLastError() == (DWORD)NTE_BAD_KEYSET) { - if (!CryptAcquireContext(&provider, 0, 0, PROV_RSA_FULL, CRYPT_NEWKEYSET)) { + if (!CryptAcquireContext(&provider, nullptr, nullptr, + PROV_RSA_FULL, CRYPT_NEWKEYSET)) { vlog.error("unable to create keyset"); provider = 0; } @@ -68,7 +70,7 @@ RandomStream::RandomStream() #endif #endif vlog.error("no OS supplied random source - using rand()"); - seed += (unsigned int) time(0) + getpid() + getpid() * 987654 + rand(); + seed += (unsigned int) time(nullptr) + getpid() + getpid() * 987654 + rand(); srand(seed); } } diff --git a/common/rdr/RandomStream.h b/common/rdr/RandomStream.h index 521012e0..48f373c1 100644 --- a/common/rdr/RandomStream.h +++ b/common/rdr/RandomStream.h @@ -40,7 +40,7 @@ namespace rdr { virtual ~RandomStream(); private: - virtual bool fillBuffer(); + bool fillBuffer() override; private: static unsigned int seed; diff --git a/common/rdr/TLSInStream.cxx b/common/rdr/TLSInStream.cxx index 7ba98155..d13cee1f 100644 --- a/common/rdr/TLSInStream.cxx +++ b/common/rdr/TLSInStream.cxx @@ -41,7 +41,7 @@ ssize_t TLSInStream::pull(gnutls_transport_ptr_t str, void* data, size_t size) self->streamEmpty = false; delete self->saved_exception; - self->saved_exception = NULL; + self->saved_exception = nullptr; try { if (!in->hasData(1)) { @@ -72,7 +72,7 @@ ssize_t TLSInStream::pull(gnutls_transport_ptr_t str, void* data, size_t size) } TLSInStream::TLSInStream(InStream* _in, gnutls_session_t _session) - : session(_session), in(_in), saved_exception(NULL) + : session(_session), in(_in), saved_exception(nullptr) { gnutls_transport_ptr_t recv, send; @@ -83,7 +83,7 @@ TLSInStream::TLSInStream(InStream* _in, gnutls_session_t _session) TLSInStream::~TLSInStream() { - gnutls_transport_set_pull_function(session, NULL); + gnutls_transport_set_pull_function(session, nullptr); delete saved_exception; } diff --git a/common/rdr/TLSInStream.h b/common/rdr/TLSInStream.h index 5b1b716f..ca69ddde 100644 --- a/common/rdr/TLSInStream.h +++ b/common/rdr/TLSInStream.h @@ -33,7 +33,7 @@ namespace rdr { virtual ~TLSInStream(); private: - virtual bool fillBuffer(); + bool fillBuffer() override; size_t readTLS(uint8_t* buf, size_t len); static ssize_t pull(gnutls_transport_ptr_t str, void* data, size_t size); diff --git a/common/rdr/TLSOutStream.cxx b/common/rdr/TLSOutStream.cxx index a06dd285..c2f69310 100644 --- a/common/rdr/TLSOutStream.cxx +++ b/common/rdr/TLSOutStream.cxx @@ -41,7 +41,7 @@ ssize_t TLSOutStream::push(gnutls_transport_ptr_t str, const void* data, OutStream *out = self->out; delete self->saved_exception; - self->saved_exception = NULL; + self->saved_exception = nullptr; try { out->writeBytes((const uint8_t*)data, size); @@ -62,7 +62,7 @@ ssize_t TLSOutStream::push(gnutls_transport_ptr_t str, const void* data, } TLSOutStream::TLSOutStream(OutStream* _out, gnutls_session_t _session) - : session(_session), out(_out), saved_exception(NULL) + : session(_session), out(_out), saved_exception(nullptr) { gnutls_transport_ptr_t recv, send; @@ -79,7 +79,7 @@ TLSOutStream::~TLSOutStream() } catch (Exception&) { } #endif - gnutls_transport_set_push_function(session, NULL); + gnutls_transport_set_push_function(session, nullptr); delete saved_exception; } diff --git a/common/rdr/TLSOutStream.h b/common/rdr/TLSOutStream.h index 2d365f36..35714238 100644 --- a/common/rdr/TLSOutStream.h +++ b/common/rdr/TLSOutStream.h @@ -31,11 +31,11 @@ namespace rdr { TLSOutStream(OutStream* out, gnutls_session_t session); virtual ~TLSOutStream(); - virtual void flush(); - virtual void cork(bool enable); + void flush() override; + void cork(bool enable) override; private: - virtual bool flushBuffer(); + bool flushBuffer() override; size_t writeTLS(const uint8_t* data, size_t length); static ssize_t push(gnutls_transport_ptr_t str, const void* data, size_t size); diff --git a/common/rdr/ZlibInStream.cxx b/common/rdr/ZlibInStream.cxx index 6441f0a1..a90d50f7 100644 --- a/common/rdr/ZlibInStream.cxx +++ b/common/rdr/ZlibInStream.cxx @@ -29,7 +29,7 @@ using namespace rdr; ZlibInStream::ZlibInStream() - : underlying(0), zs(NULL), bytesIn(0) + : underlying(nullptr), zs(nullptr), bytesIn(0) { init(); } @@ -54,7 +54,7 @@ void ZlibInStream::flushUnderlying() skip(avail()); } - setUnderlying(NULL, 0); + setUnderlying(nullptr, 0); } void ZlibInStream::reset() @@ -65,28 +65,28 @@ void ZlibInStream::reset() void ZlibInStream::init() { - assert(zs == NULL); + assert(zs == nullptr); zs = new z_stream; - zs->zalloc = Z_NULL; - zs->zfree = Z_NULL; - zs->opaque = Z_NULL; - zs->next_in = Z_NULL; + zs->zalloc = nullptr; + zs->zfree = nullptr; + zs->opaque = nullptr; + zs->next_in = nullptr; zs->avail_in = 0; if (inflateInit(zs) != Z_OK) { delete zs; - zs = NULL; + zs = nullptr; throw Exception("ZlibInStream: inflateInit failed"); } } void ZlibInStream::deinit() { - assert(zs != NULL); - setUnderlying(NULL, 0); + assert(zs != nullptr); + setUnderlying(nullptr, 0); inflateEnd(zs); delete zs; - zs = NULL; + zs = nullptr; } bool ZlibInStream::fillBuffer() diff --git a/common/rdr/ZlibInStream.h b/common/rdr/ZlibInStream.h index cce6a6e0..a0c31161 100644 --- a/common/rdr/ZlibInStream.h +++ b/common/rdr/ZlibInStream.h @@ -44,7 +44,7 @@ namespace rdr { void init(); void deinit(); - virtual bool fillBuffer(); + bool fillBuffer() override; private: InStream* underlying; diff --git a/common/rdr/ZlibOutStream.cxx b/common/rdr/ZlibOutStream.cxx index 63820b8e..0b167711 100644 --- a/common/rdr/ZlibOutStream.cxx +++ b/common/rdr/ZlibOutStream.cxx @@ -39,10 +39,10 @@ ZlibOutStream::ZlibOutStream(OutStream* os, int compressLevel) : underlying(os), compressionLevel(compressLevel), newLevel(compressLevel) { zs = new z_stream; - zs->zalloc = Z_NULL; - zs->zfree = Z_NULL; - zs->opaque = Z_NULL; - zs->next_in = Z_NULL; + zs->zalloc = nullptr; + zs->zfree = nullptr; + zs->opaque = nullptr; + zs->next_in = nullptr; zs->avail_in = 0; if (deflateInit(zs, compressLevel) != Z_OK) { delete zs; @@ -78,14 +78,14 @@ void ZlibOutStream::setCompressionLevel(int level) void ZlibOutStream::flush() { BufferedOutStream::flush(); - if (underlying != NULL) + if (underlying != nullptr) underlying->flush(); } void ZlibOutStream::cork(bool enable) { BufferedOutStream::cork(enable); - if (underlying != NULL) + if (underlying != nullptr) underlying->cork(enable); } diff --git a/common/rdr/ZlibOutStream.h b/common/rdr/ZlibOutStream.h index 8061a58c..14df2a84 100644 --- a/common/rdr/ZlibOutStream.h +++ b/common/rdr/ZlibOutStream.h @@ -35,16 +35,16 @@ namespace rdr { public: - ZlibOutStream(OutStream* os=0, int compressionLevel=-1); + ZlibOutStream(OutStream* os=nullptr, int compressionLevel=-1); virtual ~ZlibOutStream(); void setUnderlying(OutStream* os); void setCompressionLevel(int level=-1); - virtual void flush(); - virtual void cork(bool enable); + void flush() override; + void cork(bool enable) override; private: - virtual bool flushBuffer(); + bool flushBuffer() override; void deflate(int flush); void checkCompressionLevel(); |