From 5afe88df2538274859a162ffd63ed52118e80c19 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 26 Jan 2024 16:07:54 +0100 Subject: Apply C++11 fixits modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using --- src/utils/zlib.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/utils/zlib.cpp') diff --git a/src/utils/zlib.cpp b/src/utils/zlib.cpp index 7a5421fd..8234766e 100644 --- a/src/utils/zlib.cpp +++ b/src/utils/zlib.cpp @@ -57,7 +57,7 @@ int inflateMemory(unsigned char *in, unsigned int inLength, do { - if (strm.next_out == NULL) + if (strm.next_out == nullptr) { inflateEnd(&strm); return Z_MEM_ERROR; @@ -80,7 +80,7 @@ int inflateMemory(unsigned char *in, unsigned int inLength, { out = (unsigned char*) realloc(out, bufferSize * 2); - if (out == NULL) + if (out == nullptr) { inflateEnd(&strm); return Z_MEM_ERROR; @@ -105,7 +105,7 @@ int inflateMemory(unsigned char *in, unsigned int inLength, unsigned int outLength = 0; int ret = inflateMemory(in, inLength, out, outLength); - if (ret != Z_OK || out == NULL) + if (ret != Z_OK || out == nullptr) { if (ret == Z_MEM_ERROR) { @@ -125,7 +125,7 @@ int inflateMemory(unsigned char *in, unsigned int inLength, } free(out); - out = NULL; + out = nullptr; outLength = 0; } @@ -163,7 +163,7 @@ void *loadCompressedFile(const std::string &filename, int &filesize) { logger->log("Could not decompress file: %s", filename.c_str()); - return NULL; + return nullptr; } filesize = inflatedSize; @@ -179,5 +179,5 @@ void *loadCompressedFile(const std::string &filename, int &filesize) logger->log("Error loading file from drive: %s", filename.c_str()); } - return NULL; + return nullptr; } -- cgit v1.2.3-70-g09d2