From f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 15 Jun 2018 12:46:15 +0200 Subject: =?UTF-8?q?Run=20clang-tidy=E2=80=99s=20modernize-use-nullptr=20pa?= =?UTF-8?q?ss.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This replaces all NULL or 0 with nullptr when assigned to or returned as a pointer. --- src/io/gzipstream.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/io/gzipstream.cpp') diff --git a/src/io/gzipstream.cpp b/src/io/gzipstream.cpp index 330191ecd..dfb605f14 100644 --- a/src/io/gzipstream.cpp +++ b/src/io/gzipstream.cpp @@ -51,8 +51,8 @@ GzipInputStream::GzipInputStream(InputStream &sourceStream) loaded(false), totalIn(0), totalOut(0), - outputBuf(NULL), - srcBuf(NULL), + outputBuf(nullptr), + srcBuf(nullptr), crc(0), srcCrc(0), srcSiz(0), @@ -72,11 +72,11 @@ GzipInputStream::~GzipInputStream() close(); if ( srcBuf ) { delete[] srcBuf; - srcBuf = NULL; + srcBuf = nullptr; } if ( outputBuf ) { delete[] outputBuf; - outputBuf = NULL; + outputBuf = nullptr; } } @@ -109,11 +109,11 @@ void GzipInputStream::close() if ( srcBuf ) { delete[] srcBuf; - srcBuf = NULL; + srcBuf = nullptr; } if ( outputBuf ) { delete[] outputBuf; - outputBuf = NULL; + outputBuf = nullptr; } closed = true; } @@ -179,7 +179,7 @@ bool GzipInputStream::load() outputBuf = new (std::nothrow) unsigned char [OUT_SIZE]; if ( !outputBuf ) { delete[] srcBuf; - srcBuf = NULL; + srcBuf = nullptr; return false; } outputBufLen = 0; // Not filled in yet @@ -251,9 +251,9 @@ bool GzipInputStream::load() unsigned long dataLen = srcLen - (headerLen + 8); //printf("%x %x\n", data[0], data[dataLen-1]); - d_stream.zalloc = (alloc_func)0; - d_stream.zfree = (free_func)0; - d_stream.opaque = (voidpf)0; + d_stream.zalloc = (alloc_func)nullptr; + d_stream.zfree = (free_func)nullptr; + d_stream.opaque = (voidpf)nullptr; d_stream.next_in = data; d_stream.avail_in = dataLen; d_stream.next_out = outputBuf; -- cgit v1.2.3