summaryrefslogtreecommitdiff
path: root/src/net/tmwa/messagein.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-17 20:13:48 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-17 20:13:48 +0300
commitc2efedab22275302f0a10cc197424d345a021d18 (patch)
tree7488abbb3655451a3f6a1621e0708f72011af5f6 /src/net/tmwa/messagein.cpp
parent79aba82be3de5b6b571e2f59f7a34ded4b03160f (diff)
downloadplus-c2efedab22275302f0a10cc197424d345a021d18.tar.gz
plus-c2efedab22275302f0a10cc197424d345a021d18.tar.bz2
plus-c2efedab22275302f0a10cc197424d345a021d18.tar.xz
plus-c2efedab22275302f0a10cc197424d345a021d18.zip
Replace SDL int types to C++ types.
Diffstat (limited to 'src/net/tmwa/messagein.cpp')
-rw-r--r--src/net/tmwa/messagein.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/net/tmwa/messagein.cpp b/src/net/tmwa/messagein.cpp
index b8bba342f..698d7211c 100644
--- a/src/net/tmwa/messagein.cpp
+++ b/src/net/tmwa/messagein.cpp
@@ -43,17 +43,17 @@ MessageIn::MessageIn(const char *data, unsigned int length):
mId = readInt16();
}
-Sint16 MessageIn::readInt16()
+int16_t MessageIn::readInt16()
{
- Sint16 value = -1;
+ int16_t value = -1;
if (mPos + 2 <= mLength)
{
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- Sint16 swap;
- memcpy(&swap, mData + mPos, sizeof(Sint16));
+ int16_t swap;
+ memcpy(&swap, mData + mPos, sizeof(int16_t));
value = SDL_Swap16(swap);
#else
- memcpy(&value, mData + mPos, sizeof(Sint16));
+ memcpy(&value, mData + mPos, sizeof(int16_t));
#endif
}
mPos += 2;
@@ -64,15 +64,15 @@ Sint16 MessageIn::readInt16()
int MessageIn::readInt32()
{
- Sint32 value = -1;
+ int32_t value = -1;
if (mPos + 4 <= mLength)
{
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- Sint32 swap;
- memcpy(&swap, mData + mPos, sizeof(Sint32));
+ int32_t swap;
+ memcpy(&swap, mData + mPos, sizeof(int32_t));
value = SDL_Swap32(swap);
#else
- memcpy(&value, mData + mPos, sizeof(Sint32));
+ memcpy(&value, mData + mPos, sizeof(int32_t));
#endif
}
mPos += 4;