From 804805d35a87c2acc9425d1762ad26b1ba2ec9ac Mon Sep 17 00:00:00 2001 From: Samuel Barney Date: Wed, 29 Jul 2015 09:04:03 -0600 Subject: Silenced and fixed many warning messages across multiple files. --- src/ByteBuffer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/ByteBuffer.cpp') diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp index f50e3845b..7557a80db 100644 --- a/src/ByteBuffer.cpp +++ b/src/ByteBuffer.cpp @@ -210,7 +210,7 @@ bool cByteBuffer::Write(const void * a_Bytes, size_t a_Count) } ASSERT(m_BufferSize >= m_WritePos); size_t TillEnd = m_BufferSize - m_WritePos; - const char * Bytes = (const char *)a_Bytes; + const char * Bytes = reinterpret_cast(a_Bytes); if (TillEnd <= a_Count) { // Need to wrap around the ringbuffer end @@ -548,7 +548,7 @@ bool cByteBuffer::ReadVarUTF8String(AString & a_Value) { LOGWARNING("%s: String too large: %u (%u KiB)", __FUNCTION__, Size, Size / 1024); } - return ReadString(a_Value, (size_t)Size); + return ReadString(a_Value, static_cast(Size)); } @@ -589,9 +589,9 @@ bool cByteBuffer::ReadPosition64(int & a_BlockX, int & a_BlockY, int & a_BlockZ) UInt32 BlockZRaw = (Value & 0x03ffffff); // Bottom 26 bits // If the highest bit in the number's range is set, convert the number into negative: - a_BlockX = ((BlockXRaw & 0x02000000) == 0) ? BlockXRaw : -(0x04000000 - (int)BlockXRaw); - a_BlockY = ((BlockYRaw & 0x0800) == 0) ? BlockYRaw : -(0x0800 - (int)BlockYRaw); - a_BlockZ = ((BlockZRaw & 0x02000000) == 0) ? BlockZRaw : -(0x04000000 - (int)BlockZRaw); + a_BlockX = ((BlockXRaw & 0x02000000) == 0) ? static_cast(BlockXRaw) : -(0x04000000 - static_cast(BlockXRaw)); + a_BlockY = ((BlockYRaw & 0x0800) == 0) ? static_cast(BlockYRaw) : -(0x0800 - static_cast(BlockYRaw)); + a_BlockZ = ((BlockZRaw & 0x02000000) == 0) ? static_cast(BlockZRaw) : -(0x04000000 - static_cast(BlockZRaw)); return true; } @@ -839,7 +839,7 @@ bool cByteBuffer::ReadBuf(void * a_Buffer, size_t a_Count) CHECK_THREAD CheckValid(); NEEDBYTES(a_Count); - char * Dst = (char *)a_Buffer; // So that we can do byte math + char * Dst = reinterpret_cast(a_Buffer); // So that we can do byte math ASSERT(m_BufferSize >= m_ReadPos); size_t BytesToEndOfBuffer = m_BufferSize - m_ReadPos; if (BytesToEndOfBuffer <= a_Count) @@ -872,7 +872,7 @@ bool cByteBuffer::WriteBuf(const void * a_Buffer, size_t a_Count) CHECK_THREAD CheckValid(); PUTBYTES(a_Count); - char * Src = (char *)a_Buffer; // So that we can do byte math + char * Src = reinterpret_cast(const_cast(a_Buffer)); // So that we can do byte math ASSERT(m_BufferSize >= m_ReadPos); size_t BytesToEndOfBuffer = m_BufferSize - m_WritePos; if (BytesToEndOfBuffer <= a_Count) -- cgit v1.2.3