diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-09-23 22:01:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-09-23 22:01:44 +0300 |
commit | 3c404128c4669a1f4f190e20a89553677717fc50 (patch) | |
tree | 2db4e5031089c800c4e00fd6244e578f44a7c910 /src/net/tmwa/messagein.cpp | |
parent | 89b267d6d73bbc59f7c313b8a22b97fbb27f99a8 (diff) | |
download | plus-3c404128c4669a1f4f190e20a89553677717fc50.tar.gz plus-3c404128c4669a1f4f190e20a89553677717fc50.tar.bz2 plus-3c404128c4669a1f4f190e20a89553677717fc50.tar.xz plus-3c404128c4669a1f4f190e20a89553677717fc50.zip |
Add missing comments into defines.
Diffstat (limited to 'src/net/tmwa/messagein.cpp')
-rw-r--r-- | src/net/tmwa/messagein.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/net/tmwa/messagein.cpp b/src/net/tmwa/messagein.cpp index ffea1ee4e..219466187 100644 --- a/src/net/tmwa/messagein.cpp +++ b/src/net/tmwa/messagein.cpp @@ -35,7 +35,7 @@ #ifndef SDL_BYTEORDER #error missing SDL_endian.h -#endif +#endif // SDL_BYTEORDER namespace TmwAthena { @@ -64,9 +64,10 @@ uint16_t MessageIn::readId() const int16_t swap; memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(int16_t)); value = SDL_Swap16(swap); -#else +#else // SDL_BYTEORDER == SDL_BIG_ENDIAN + memcpy(&value, mData + CAST_SIZE(mPos), sizeof(int16_t)); -#endif +#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN } return value; } @@ -80,9 +81,10 @@ int16_t MessageIn::readInt16(const char *const str) int16_t swap; memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(int16_t)); value = SDL_Swap16(swap); -#else +#else // SDL_BYTEORDER == SDL_BIG_ENDIAN + memcpy(&value, mData + CAST_SIZE(mPos), sizeof(int16_t)); -#endif +#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN } DEBUGLOG2("readInt16: " + toStringPrint(CAST_U32( CAST_U16(value))), @@ -101,9 +103,10 @@ uint16_t MessageIn::readUInt16(const char *const str) uint16_t swap; memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(uint16_t)); value = SDL_Swap16(swap); -#else +#else // SDL_BYTEORDER == SDL_BIG_ENDIAN + memcpy(&value, mData + CAST_SIZE(mPos), sizeof(uint16_t)); -#endif +#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN } DEBUGLOG2("readUInt16: " + toStringPrint(CAST_U32( CAST_U16(value))), @@ -122,9 +125,10 @@ int32_t MessageIn::readInt32(const char *const str) int32_t swap; memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(int32_t)); value = SDL_Swap32(swap); -#else +#else // SDL_BYTEORDER == SDL_BIG_ENDIAN + memcpy(&value, mData + CAST_SIZE(mPos), sizeof(int32_t)); -#endif +#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN } DEBUGLOG2("readInt32: " + toStringPrint(CAST_U32(value)), mPos, str); @@ -147,9 +151,10 @@ int64_t MessageIn::readInt64(const char *const str) int64_t swap; memcpy(&swap, mData + CAST_SIZE(mPos), sizeof(int64_t)); value = SDL_Swap64(swap); -#else +#else // SDL_BYTEORDER == SDL_BIG_ENDIAN + memcpy(&value, mData + CAST_SIZE(mPos), sizeof(int64_t)); -#endif +#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN } DEBUGLOG2("readInt64: " + toStringPrint(CAST_U32(value)), mPos, str); |