summaryrefslogtreecommitdiffstats
path: root/src/Protocol/ChunkDataSerializer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Protocol/ChunkDataSerializer.cpp')
-rw-r--r--src/Protocol/ChunkDataSerializer.cpp10
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