summaryrefslogtreecommitdiffstats
path: root/src/StringCompression.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-08-25 09:04:17 +0200
committerGitHub <noreply@github.com>2016-08-25 09:04:17 +0200
commitd52afadad491474f63e8184cb5a08c0ca21ab48c (patch)
treed5afab6035ca6bb0b58fd03ad5cfe3b3f8e1da55 /src/StringCompression.cpp
parentMerge pull request #3342 from cuberite/FixEmptyHeader (diff)
parentFixed type-casting-related warnings. (diff)
downloadcuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar
cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.gz
cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.bz2
cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.lz
cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.xz
cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.zst
cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.zip
Diffstat (limited to 'src/StringCompression.cpp')
-rw-r--r--src/StringCompression.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/StringCompression.cpp b/src/StringCompression.cpp
index 8be6d0026..ff434bbb1 100644
--- a/src/StringCompression.cpp
+++ b/src/StringCompression.cpp
@@ -16,7 +16,7 @@ int CompressString(const char * a_Data, size_t a_Length, AString & a_Compressed,
// HACK: We're assuming that AString returns its internal buffer in its data() call and we're overwriting that buffer!
// It saves us one allocation and one memcpy of the entire compressed data
- // It may not work on some STL implementations! (Confirmed working on MSVC 2008 & 2010)
+ // It may not work on some STL implementations! (Confirmed working on all currently used MSVC, GCC and Clang versions)
a_Compressed.resize(CompressedSize);
int errorcode = compress2(reinterpret_cast<Bytef *>(const_cast<char *>(a_Compressed.data())), &CompressedSize, reinterpret_cast<const Bytef *>(a_Data), static_cast<uLong>(a_Length), a_Factor);
if (errorcode != Z_OK)
@@ -35,7 +35,7 @@ int UncompressString(const char * a_Data, size_t a_Length, AString & a_Uncompres
{
// HACK: We're assuming that AString returns its internal buffer in its data() call and we're overwriting that buffer!
// It saves us one allocation and one memcpy of the entire compressed data
- // It may not work on some STL implementations! (Confirmed working on MSVC 2008 & 2010)
+ // It may not work on some STL implementations! (Confirmed working on all currently used MSVC, GCC and Clang versions)
a_Uncompressed.resize(a_UncompressedSize);
uLongf UncompressedSize = static_cast<uLongf>(a_UncompressedSize); // On some architectures the uLongf is different in size to int, that may be the cause of the -5 error
int errorcode = uncompress(reinterpret_cast<Bytef *>(const_cast<char *>(a_Uncompressed.data())), &UncompressedSize, reinterpret_cast<const Bytef *>(a_Data), static_cast<uLong>(a_Length));