From d2e8643607424cd74616e2e863f5609e7b8458a5 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 24 Aug 2016 21:45:03 +0200 Subject: Fixed type-casting-related warnings. --- src/StringCompression.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/StringCompression.cpp') 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(const_cast(a_Compressed.data())), &CompressedSize, reinterpret_cast(a_Data), static_cast(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(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(const_cast(a_Uncompressed.data())), &UncompressedSize, reinterpret_cast(a_Data), static_cast(a_Length)); -- cgit v1.2.3