From 91a8db0d7ef3187b52d6f7e7906b28ae8ce03ae0 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 4 Feb 2014 22:41:54 +0100 Subject: Protocol 1.7: Fixed a signed / unsigned comparison warning. --- src/Protocol/Protocol17x.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Protocol/Protocol17x.cpp') diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 8168e8314..52c0099ed 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -99,7 +99,7 @@ void cProtocol172::DataReceived(const char * a_Data, int a_Size) Byte Decrypted[512]; while (a_Size > 0) { - int NumBytes = (a_Size > sizeof(Decrypted)) ? sizeof(Decrypted) : a_Size; + int NumBytes = (a_Size > (int)sizeof(Decrypted)) ? (int)sizeof(Decrypted) : a_Size; m_Decryptor.ProcessData(Decrypted, (Byte *)a_Data, NumBytes); AddReceivedData((const char *)Decrypted, NumBytes); a_Size -= NumBytes; @@ -1836,7 +1836,7 @@ void cProtocol172::SendData(const char * a_Data, int a_Size) Byte Encrypted[8192]; // Larger buffer, we may be sending lots of data (chunks) while (a_Size > 0) { - int NumBytes = (a_Size > sizeof(Encrypted)) ? sizeof(Encrypted) : a_Size; + int NumBytes = (a_Size > (int)sizeof(Encrypted)) ? (int)sizeof(Encrypted) : a_Size; m_Encryptor.ProcessData(Encrypted, (Byte *)a_Data, NumBytes); m_Client->SendData((const char *)Encrypted, NumBytes); a_Size -= NumBytes; -- cgit v1.2.3 From 9e98c9691d2ce48fa8b74b120db8a1bb991ceb71 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 5 Feb 2014 13:54:47 +0100 Subject: Improved the signedness conversion. --- src/Protocol/Protocol17x.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Protocol/Protocol17x.cpp') diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 52c0099ed..57da48e49 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -99,7 +99,7 @@ void cProtocol172::DataReceived(const char * a_Data, int a_Size) Byte Decrypted[512]; while (a_Size > 0) { - int NumBytes = (a_Size > (int)sizeof(Decrypted)) ? (int)sizeof(Decrypted) : a_Size; + size_t NumBytes = (a_Size > sizeof(Decrypted)) ? sizeof(Decrypted) : a_Size; m_Decryptor.ProcessData(Decrypted, (Byte *)a_Data, NumBytes); AddReceivedData((const char *)Decrypted, NumBytes); a_Size -= NumBytes; @@ -1836,7 +1836,7 @@ void cProtocol172::SendData(const char * a_Data, int a_Size) Byte Encrypted[8192]; // Larger buffer, we may be sending lots of data (chunks) while (a_Size > 0) { - int NumBytes = (a_Size > (int)sizeof(Encrypted)) ? (int)sizeof(Encrypted) : a_Size; + size_t NumBytes = ((size_t)a_Size > sizeof(Encrypted)) ? sizeof(Encrypted) : (size_t)a_Size; m_Encryptor.ProcessData(Encrypted, (Byte *)a_Data, NumBytes); m_Client->SendData((const char *)Encrypted, NumBytes); a_Size -= NumBytes; -- cgit v1.2.3