diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-07-29 18:45:36 +0200 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-07-29 18:45:36 +0200 |
commit | 735d590abf7f804a4504b70c84a289ba86c5f8e3 (patch) | |
tree | 13b603c8bbf8177da92ce87f5413fb646d204f3f /src/Protocol/ChunkDataSerializer.cpp | |
parent | Merge pull request #2376 from mjhanninen/fix-freebsd-build (diff) | |
parent | Silenced and fixed many warning messages across multiple files. (diff) | |
download | cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.gz cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.bz2 cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.lz cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.xz cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.zst cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.zip |
Diffstat (limited to 'src/Protocol/ChunkDataSerializer.cpp')
-rw-r--r-- | src/Protocol/ChunkDataSerializer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Protocol/ChunkDataSerializer.cpp b/src/Protocol/ChunkDataSerializer.cpp index 37fbae0e5..8c5569cc7 100644 --- a/src/Protocol/ChunkDataSerializer.cpp +++ b/src/Protocol/ChunkDataSerializer.cpp @@ -95,7 +95,7 @@ void cChunkDataSerializer::Serialize39(AString & a_Data) // Run-time check that our compile-time guess about CompressedMaxSize was enough: ASSERT(CompressedSize <= CompressedMaxSize); - compress2((Bytef*)CompressedBlockData, &CompressedSize, (const Bytef*)AllData, sizeof(AllData), Z_DEFAULT_COMPRESSION); + compress2(reinterpret_cast<Bytef*>(CompressedBlockData), &CompressedSize, reinterpret_cast<const Bytef*>(AllData), sizeof(AllData), Z_DEFAULT_COMPRESSION); // Now put all those data into a_Data: @@ -106,11 +106,11 @@ void cChunkDataSerializer::Serialize39(AString & a_Data) // Also, no endian flipping is needed because of the const values unsigned short BitMap1 = 0xffff; unsigned short BitMap2 = 0; - a_Data.append((const char *)&BitMap1, sizeof(short)); - a_Data.append((const char *)&BitMap2, sizeof(short)); + a_Data.append(reinterpret_cast<const char *>(&BitMap1), sizeof(short)); + a_Data.append(reinterpret_cast<const char *>(&BitMap2), sizeof(short)); - UInt32 CompressedSizeBE = htonl((UInt32)CompressedSize); - a_Data.append((const char *)&CompressedSizeBE, sizeof(CompressedSizeBE)); + UInt32 CompressedSizeBE = htonl(static_cast<UInt32>(CompressedSize)); + a_Data.append(reinterpret_cast<const char *>(&CompressedSizeBE), sizeof(CompressedSizeBE)); // Unlike 29, 39 doesn't have the "unused" int |