aboutsummaryrefslogtreecommitdiff
path: root/src/server/authserver/Server/AuthSocket.cpp
diff options
context:
space:
mode:
authorQAston <qaston@gmail.com>2014-01-30 23:43:10 +0100
committerQAston <qaston@gmail.com>2014-01-30 23:43:37 +0100
commit9495194bf2c13d8e2ae097cf07b86240d3d8dc96 (patch)
treea47c7db00887122dcfc27a04deeaafff739c2a02 /src/server/authserver/Server/AuthSocket.cpp
parent856e0933b5ba2b0dfc2a7cd8049f9c35677c0114 (diff)
Fix warnings introduced on littleendian in 2134cb610d45727a0623741f7416a360882133fa
This fix prevents possible issues on bigendian machines. Don't use c style casts ppl, it's evul.
Diffstat (limited to 'src/server/authserver/Server/AuthSocket.cpp')
-rw-r--r--src/server/authserver/Server/AuthSocket.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp
index 8a2a6c67496..c7bb600024a 100644
--- a/src/server/authserver/Server/AuthSocket.cpp
+++ b/src/server/authserver/Server/AuthSocket.cpp
@@ -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);