Mercurial > hg > orthanc
diff Core/Compression/ZlibCompressor.cpp @ 3378:596cfabd72c5
Fixed a couple of truncation warnings
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Fri, 17 May 2019 08:36:18 +0200 |
parents | 4e43e67f8ecf |
children | 94f4a18a79cc |
line wrap: on
line diff
--- a/Core/Compression/ZlibCompressor.cpp Thu May 16 12:31:47 2019 +0200 +++ b/Core/Compression/ZlibCompressor.cpp Fri May 17 08:36:18 2019 +0200 @@ -53,7 +53,8 @@ return; } - uLongf compressedSize = compressBound(uncompressedSize) + 1024 /* security margin */; + uLongf compressedSize = compressBound(static_cast<uLong>(uncompressedSize)) + + 1024 /* security margin */; if (compressedSize == 0) { compressedSize = 1; @@ -74,7 +75,7 @@ int error = compress2(target, &compressedSize, const_cast<Bytef *>(static_cast<const Bytef *>(uncompressed)), - uncompressedSize, + static_cast<uLong>(uncompressedSize), GetCompressionLevel()); if (error != Z_OK) @@ -137,7 +138,7 @@ (reinterpret_cast<uint8_t*>(&uncompressed[0]), &tmp, reinterpret_cast<const uint8_t*>(compressed) + sizeof(uint64_t), - compressedSize - sizeof(uint64_t)); + static_cast<uLong>(compressedSize - sizeof(uint64_t))); if (error != Z_OK) {