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/Protocol/ProtocolRecognizer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Protocol/ProtocolRecognizer.cpp') diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp index 574875831..42c2eee0a 100644 --- a/src/Protocol/ProtocolRecognizer.cpp +++ b/src/Protocol/ProtocolRecognizer.cpp @@ -258,11 +258,11 @@ void cProtocolRecognizer::SendDisconnect(const AString & a_Reason) { // This is used when the client sends a server-ping, respond with the default packet: static const int Packet = 0xff; // PACKET_DISCONNECT - SendData((const char *)&Packet, 1); // WriteByte() + SendData(reinterpret_cast(&Packet), 1); // WriteByte() AString UTF16 = UTF8ToRawBEUTF16(a_Reason.c_str(), a_Reason.length()); - static const u_short Size = htons((u_short)(UTF16.size() / 2)); - SendData((const char *)&Size, 2); // WriteShort() + static const u_short Size = htons(static_cast(UTF16.size() / 2)); + SendData(reinterpret_cast(&Size), 2); // WriteShort() SendData(UTF16.data(), UTF16.size()); // WriteString() } } @@ -440,7 +440,7 @@ void cProtocolRecognizer::SendInventorySlot(char a_WindowID, short a_SlotNum, co -void cProtocolRecognizer::SendKeepAlive(int a_PingID) +void cProtocolRecognizer::SendKeepAlive(UInt32 a_PingID) { ASSERT(m_Protocol != nullptr); m_Protocol->SendKeepAlive(a_PingID); @@ -986,13 +986,13 @@ bool cProtocolRecognizer::TryRecognizeProtocol(void) // Lengthed protocol, try if it has the entire initial handshake packet: UInt32 PacketLen; - UInt32 ReadSoFar = (UInt32)m_Buffer.GetReadableSpace(); + UInt32 ReadSoFar = static_cast(m_Buffer.GetReadableSpace()); if (!m_Buffer.ReadVarInt(PacketLen)) { // Not enough bytes for the packet length, keep waiting return false; } - ReadSoFar -= (UInt32)m_Buffer.GetReadableSpace(); + ReadSoFar -= static_cast(m_Buffer.GetReadableSpace()); if (!m_Buffer.CanReadBytes(PacketLen)) { // Not enough bytes for the packet, keep waiting -- cgit v1.2.3