diff options
author | Bernd Wachter <bwachter-tmw@lart.info> | 2009-11-26 17:50:45 +0100 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-11-26 11:17:58 -0700 |
commit | edf478e1eb7987e35d56df2777fbeb389dc915ec (patch) | |
tree | 6280ef3dbea8fddb2af2e2039c76ce59b0749353 /src/net/ea/messageout.cpp | |
parent | fcc940800c047322aea40da5a24d9d5c0fbd051e (diff) | |
download | mana-edf478e1eb7987e35d56df2777fbeb389dc915ec.tar.gz mana-edf478e1eb7987e35d56df2777fbeb389dc915ec.tar.bz2 mana-edf478e1eb7987e35d56df2777fbeb389dc915ec.tar.xz mana-edf478e1eb7987e35d56df2777fbeb389dc915ec.zip |
Fix memory alignment on little endian systems
Diffstat (limited to 'src/net/ea/messageout.cpp')
-rw-r--r-- | src/net/ea/messageout.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net/ea/messageout.cpp b/src/net/ea/messageout.cpp index 9493ee80..81fa917a 100644 --- a/src/net/ea/messageout.cpp +++ b/src/net/ea/messageout.cpp @@ -51,7 +51,7 @@ void MessageOut::writeInt16(Sint16 value) Sint16 swap=SDL_Swap16(value); memcpy(mData + mPos, &swap, sizeof(Sint16)); #else - (*(Sint16 *)(mData + mPos)) = value; + memcpy(mData + mPos, &value, sizeof(Sint16)); #endif mPos += 2; } @@ -63,7 +63,7 @@ void MessageOut::writeInt32(Sint32 value) Sint32 swap=SDL_Swap32(value); memcpy(mData + mPos, &swap, sizeof(Sint32)); #else - (*(Sint32 *)(mData + mPos)) = value; + memcpy(mData + mPos, &value, sizeof(Sint32)); #endif mPos += 4; } |