Fix warnings introduced on littleendian in 2134cb610d

This fix prevents possible issues on bigendian machines. Don't use c style casts ppl, it's evul.
This commit is contained in:
QAston committed 2014-01-30 23:43:37 +01:00
1 parent 856e0933b5
commit 9495194bf2
2 files changed
+10 -6

No files matched your search

+6 -6
View File
@@ -321,7 +321,7 @@ bool AuthSocket::_HandleLogonChallenge()
socket().recv((char *)&buf[0], 4);
EndianConvert(*((uint16*)(buf[0])));
EndianConvertPtr<uint16>(&buf[0]);
uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size;
TC_LOG_DEBUG("server.authserver", "[AuthChallenge] got header, body is %#04x bytes", remaining);
@@ -341,11 +341,11 @@ bool AuthSocket::_HandleLogonChallenge()
// BigEndian code, nop in little endian case
// size already converted
EndianConvert(*((uint32*)(&ch->gamename[0])));
EndianConvertPtr<uint32>(&ch->gamename[0]);
EndianConvert(ch->build);
EndianConvert(*((uint32*)(&ch->platform[0])));
EndianConvert(*((uint32*)(&ch->os[0])));
EndianConvert(*((uint32*)(&ch->country[0])));
EndianConvertPtr<uint32>(&ch->platform[0]);
EndianConvertPtr<uint32>(&ch->os[0]);
EndianConvertPtr<uint32>(&ch->country[0]);
EndianConvert(ch->timezone_bias);
EndianConvert(ch->ip);
@@ -779,7 +779,7 @@ bool AuthSocket::_HandleReconnectChallenge()
socket().recv((char *)&buf[0], 4);
EndianConvert(*((uint16*)(buf[0])));
EndianConvertPtr<uint16>(&buf[0]);
uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size;
TC_LOG_DEBUG("server.authserver", "[ReconnectChallenge] got header, body is %#04x bytes", remaining);