aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr/ZlibInStream.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-04-02 16:13:23 +0200
committerPierre Ossman <ossman@cendio.se>2024-06-24 13:42:54 +0200
commit139f0e8a4b81fe3dcd9476ec5ee16ea5e74af901 (patch)
tree8d06ede9e14516516a44c5ed710058003088eec2 /common/rdr/ZlibInStream.cxx
parent45198e5235f4b724277665b242cf855a0ff4518b (diff)
downloadtigervnc-139f0e8a4b81fe3dcd9476ec5ee16ea5e74af901.tar.gz
tigervnc-139f0e8a4b81fe3dcd9476ec5ee16ea5e74af901.zip
Use nullptr in all C++ code
It's more readable than 0, and a bit safer than NULL, so let's try to follow modern norms.
Diffstat (limited to 'common/rdr/ZlibInStream.cxx')
-rw-r--r--common/rdr/ZlibInStream.cxx22
1 files changed, 11 insertions, 11 deletions
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()