summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/messagein.cpp8
-rw-r--r--src/net/eathena/messageout.cpp10
2 files changed, 9 insertions, 9 deletions
diff --git a/src/net/eathena/messagein.cpp b/src/net/eathena/messagein.cpp
index e8e9049d9..6e542b698 100644
--- a/src/net/eathena/messagein.cpp
+++ b/src/net/eathena/messagein.cpp
@@ -53,10 +53,10 @@ int16_t MessageIn::readInt16()
{
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
int16_t swap;
- memcpy(&swap, mData + mPos, sizeof(int16_t));
+ memcpy(&swap, mData + static_cast<size_t>(mPos), sizeof(int16_t));
value = SDL_Swap16(swap);
#else
- memcpy(&value, mData + mPos, sizeof(int16_t));
+ memcpy(&value, mData + static_cast<size_t>(mPos), sizeof(int16_t));
#endif
}
mPos += 2;
@@ -72,10 +72,10 @@ int32_t MessageIn::readInt32()
{
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
int32_t swap;
- memcpy(&swap, mData + mPos, sizeof(int32_t));
+ memcpy(&swap, mData + static_cast<size_t>(mPos), sizeof(int32_t));
value = SDL_Swap32(swap);
#else
- memcpy(&value, mData + mPos, sizeof(int32_t));
+ memcpy(&value, mData + static_cast<size_t>(mPos), sizeof(int32_t));
#endif
}
mPos += 4;
diff --git a/src/net/eathena/messageout.cpp b/src/net/eathena/messageout.cpp
index 07fd8093b..f797c6a95 100644
--- a/src/net/eathena/messageout.cpp
+++ b/src/net/eathena/messageout.cpp
@@ -43,7 +43,7 @@ MessageOut::MessageOut(const int16_t id):
mNetwork(EAthena::Network::instance())
{
mNetwork->fixSendBuffer();
- mData = mNetwork->mOutBuffer + mNetwork->mOutSize;
+ mData = mNetwork->mOutBuffer + static_cast<size_t>(mNetwork->mOutSize);
// +++ can be issue. call to virtual member
writeInt16(id);
@@ -61,9 +61,9 @@ void MessageOut::writeInt16(const int16_t value)
expand(2);
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
int16_t swap = SDL_Swap16(value);
- memcpy(mData + mPos, &swap, sizeof(int16_t));
+ memcpy(mData + static_cast<size_t>(mPos), &swap, sizeof(int16_t));
#else
- memcpy(mData + mPos, &value, sizeof(int16_t));
+ memcpy(mData + static_cast<size_t>(mPos), &value, sizeof(int16_t));
#endif
mPos += 2;
PacketCounters::incOutBytes(2);
@@ -75,9 +75,9 @@ void MessageOut::writeInt32(const int32_t value)
expand(4);
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
int32_t swap = SDL_Swap32(value);
- memcpy(mData + mPos, &swap, sizeof(int32_t));
+ memcpy(mData + static_cast<size_t>(mPos), &swap, sizeof(int32_t));
#else
- memcpy(mData + mPos, &value, sizeof(int32_t));
+ memcpy(mData + static_cast<size_t>(mPos), &value, sizeof(int32_t));
#endif
mPos += 4;
PacketCounters::incOutBytes(4);