From 0bd3912672fa7f9192b477fc0520944893ecd4c9 Mon Sep 17 00:00:00 2001 From: Evgeniy Dushistov Date: Sat, 6 Jul 2013 22:33:20 +0000 Subject: [PATCH] use c++11 and modern compilator abilities --- src/lib/dictziplib.cpp | 10 +++++----- src/lib/dictziplib.hpp | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/dictziplib.cpp b/src/lib/dictziplib.cpp index 2a45d61..909340d 100644 --- a/src/lib/dictziplib.cpp +++ b/src/lib/dictziplib.cpp @@ -309,7 +309,7 @@ bool dictData::open(const std::string& fname, int computeCRC) for (j = 0; j < DICT_CACHE_SIZE; j++) { cache[j].chunk = -1; cache[j].stamp = -1; - cache[j].inBuffer = NULL; + cache[j].inBuffer = nullptr; cache[j].count = 0; } @@ -375,12 +375,12 @@ void dictData::read(char *buffer, unsigned long start, unsigned long size) case DICT_DZIP: if (!this->initialized) { ++this->initialized; - this->zStream.zalloc = NULL; - this->zStream.zfree = NULL; - this->zStream.opaque = NULL; + this->zStream.zalloc = nullptr; + this->zStream.zfree = nullptr; + this->zStream.opaque = nullptr; this->zStream.next_in = 0; this->zStream.avail_in = 0; - this->zStream.next_out = NULL; + this->zStream.next_out = nullptr; this->zStream.avail_out = 0; if (inflateInit2( &this->zStream, -15 ) != Z_OK) { //err_internal( __FUNCTION__, diff --git a/src/lib/dictziplib.hpp b/src/lib/dictziplib.hpp index 172912d..a2c429c 100644 --- a/src/lib/dictziplib.hpp +++ b/src/lib/dictziplib.hpp @@ -1,5 +1,4 @@ -#ifndef __DICT_ZIP_LIB_H__ -#define __DICT_ZIP_LIB_H__ +#pragma once #include #include @@ -54,4 +53,3 @@ private: int read_header(const std::string &filename, int computeCRC); }; -#endif//!__DICT_ZIP_LIB_H__