diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-06-09 19:00:55 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-06-09 19:19:59 (GMT) |
commit | 644051bad4ce7b088ea8af07c9b82a5920c96f4b (patch) | |
tree | 5c18f3cee950a7e9a683e6cbb666ec0ea128ee0e /Swiften/Compress | |
parent | b3b77f1d4a85a9a933b1a913a90b57a0e2db42a3 (diff) | |
download | swift-contrib-644051bad4ce7b088ea8af07c9b82a5920c96f4b.zip swift-contrib-644051bad4ce7b088ea8af07c9b82a5920c96f4b.tar.bz2 |
Enabled & fixed some more C++ warnings.
Diffstat (limited to 'Swiften/Compress')
-rw-r--r-- | Swiften/Compress/ZLibCompressor.cpp | 19 | ||||
-rw-r--r-- | Swiften/Compress/ZLibCompressor.h | 11 | ||||
-rw-r--r-- | Swiften/Compress/ZLibDecompressor.cpp | 19 | ||||
-rw-r--r-- | Swiften/Compress/ZLibDecompressor.h | 11 |
4 files changed, 42 insertions, 18 deletions
diff --git a/Swiften/Compress/ZLibCompressor.cpp b/Swiften/Compress/ZLibCompressor.cpp new file mode 100644 index 0000000..7e3116e --- /dev/null +++ b/Swiften/Compress/ZLibCompressor.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2010 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#include "Swiften/Compress/ZLibCompressor.h" + +#pragma GCC diagnostic ignored "-Wold-style-cast" + +namespace Swift { + +ZLibCompressor::ZLibCompressor() { + int result = deflateInit(&stream_, COMPRESSION_LEVEL); + assert(result == Z_OK); + (void) result; +} + +} diff --git a/Swiften/Compress/ZLibCompressor.h b/Swiften/Compress/ZLibCompressor.h index d1d835b..7fe5387 100644 --- a/Swiften/Compress/ZLibCompressor.h +++ b/Swiften/Compress/ZLibCompressor.h @@ -4,8 +4,7 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFTEN_ZLibCompressor_H -#define SWIFTEN_ZLibCompressor_H +#pragma once #include <cassert> @@ -15,11 +14,7 @@ namespace Swift { class ZLibCompressor : public ZLibCodecompressor { public: - ZLibCompressor() { - int result = deflateInit(&stream_, COMPRESSION_LEVEL); - assert(result == Z_OK); - (void) result; - } + ZLibCompressor(); ~ZLibCompressor() { deflateEnd(&stream_); @@ -33,5 +28,3 @@ namespace Swift { static const int COMPRESSION_LEVEL = 9; }; } - -#endif diff --git a/Swiften/Compress/ZLibDecompressor.cpp b/Swiften/Compress/ZLibDecompressor.cpp new file mode 100644 index 0000000..af7349b --- /dev/null +++ b/Swiften/Compress/ZLibDecompressor.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2010 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#include "Swiften/Compress/ZLibDecompressor.h" + +#pragma GCC diagnostic ignored "-Wold-style-cast" + +namespace Swift { + +ZLibDecompressor::ZLibDecompressor() { + int result = inflateInit(&stream_); + assert(result == Z_OK); + (void) result; +} + +} diff --git a/Swiften/Compress/ZLibDecompressor.h b/Swiften/Compress/ZLibDecompressor.h index ce8573e..ec08a4f 100644 --- a/Swiften/Compress/ZLibDecompressor.h +++ b/Swiften/Compress/ZLibDecompressor.h @@ -4,8 +4,7 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#ifndef SWIFTEN_ZLibDecompressor_H -#define SWIFTEN_ZLibDecompressor_H +#pragma once #include <cassert> @@ -15,11 +14,7 @@ namespace Swift { class ZLibDecompressor : public ZLibCodecompressor { public: - ZLibDecompressor() { - int result = inflateInit(&stream_); - assert(result == Z_OK); - (void) result; - } + ZLibDecompressor(); ~ZLibDecompressor() { inflateEnd(&stream_); @@ -30,5 +25,3 @@ namespace Swift { } }; } - -#endif |