diff options
author | Mattes D <github@xoft.cz> | 2015-03-22 19:46:08 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-03-22 19:46:08 +0100 |
commit | c6268483934eb2bfdcb76ae621a0be40f76209f5 (patch) | |
tree | 9cf896200c8eaf94ca0f6c90bee3bf9c37dbce5b /src/ByteBuffer.cpp | |
parent | ProtoProxy: Fixed connection and logging. (diff) | |
download | cuberite-c6268483934eb2bfdcb76ae621a0be40f76209f5.tar cuberite-c6268483934eb2bfdcb76ae621a0be40f76209f5.tar.gz cuberite-c6268483934eb2bfdcb76ae621a0be40f76209f5.tar.bz2 cuberite-c6268483934eb2bfdcb76ae621a0be40f76209f5.tar.lz cuberite-c6268483934eb2bfdcb76ae621a0be40f76209f5.tar.xz cuberite-c6268483934eb2bfdcb76ae621a0be40f76209f5.tar.zst cuberite-c6268483934eb2bfdcb76ae621a0be40f76209f5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ByteBuffer.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp index 325b12dd1..a1d2a3db7 100644 --- a/src/ByteBuffer.cpp +++ b/src/ByteBuffer.cpp @@ -762,10 +762,10 @@ bool cByteBuffer::WriteLEInt32(Int32 a_Value) CHECK_THREAD CheckValid(); #ifdef IS_LITTLE_ENDIAN - return WriteBuf((const char *)&a_Value, 4); + return WriteBuf(reinterpret_cast<const char *>(&a_Value), 4); #else int Value = ((a_Value >> 24) & 0xff) | ((a_Value >> 16) & 0xff00) | ((a_Value >> 8) & 0xff0000) | (a_Value & 0xff000000); - return WriteBuf((const char *)&Value, 4); + return WriteBuf(reinterpret_cast<const char *>(&Value), 4); #endif } @@ -773,11 +773,15 @@ bool cByteBuffer::WriteLEInt32(Int32 a_Value) -bool cByteBuffer::WritePosition(Int32 a_BlockX, Int32 a_BlockY, Int32 a_BlockZ) +bool cByteBuffer::WritePosition64(Int32 a_BlockX, Int32 a_BlockY, Int32 a_BlockZ) { CHECK_THREAD CheckValid(); - return WriteBEInt64(((Int64)a_BlockX & 0x3FFFFFF) << 38 | ((Int64)a_BlockY & 0xFFF) << 26 | ((Int64)a_BlockZ & 0x3FFFFFF)); + return WriteBEInt64( + (static_cast<Int64>(a_BlockX & 0x3FFFFFF) << 38) | + (static_cast<Int64>(a_BlockY & 0xFFF) << 26) | + (static_cast<Int64>(a_BlockZ & 0x3FFFFFF)) + ); } |