diff options
author | Max Horn | 2003-06-14 23:05:40 +0000 |
---|---|---|
committer | Max Horn | 2003-06-14 23:05:40 +0000 |
commit | f51caefbe0ff987df32bb4fd89ddcf27166c7db1 (patch) | |
tree | 30f98f3949fdbd6866cc2b6c8b083b8eccaa2222 /common | |
parent | 5c56edc26f2c1b82f97f37b60f8f75bd16c3fdb4 (diff) | |
download | scummvm-rg350-f51caefbe0ff987df32bb4fd89ddcf27166c7db1.tar.gz scummvm-rg350-f51caefbe0ff987df32bb4fd89ddcf27166c7db1.tar.bz2 scummvm-rg350-f51caefbe0ff987df32bb4fd89ddcf27166c7db1.zip |
some more cleanup
svn-id: r8488
Diffstat (limited to 'common')
-rw-r--r-- | common/scummsys.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/common/scummsys.h b/common/scummsys.h index 1f2624c413..ed790006df 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -315,12 +315,12 @@ FORCEINLINE uint16 SWAP_BYTES_16(uint16 a) { #if defined(SCUMM_LITTLE_ENDIAN) - #define PROTO_MKID(a) \ - ((a >> 24) & 0x000000FF) | \ - ((a >> 8) & 0x0000FF00) | \ - ((a << 8) & 0x00FF0000) | \ - ((a << 24) & 0xFF000000) - #define PROTO_MKID_BE(a) (a & 0xFFFFFFFFUL) + #define PROTO_MKID(a) ((uint32) \ + (((a) >> 24) & 0x000000FF) | \ + (((a) >> 8) & 0x0000FF00) | \ + (((a) << 8) & 0x00FF0000) | \ + (((a) << 24) & 0xFF000000)) + #define PROTO_MKID_BE(a) ((uint32)(a)) #if defined(INVERSE_MKID) # define MKID(a) PROTO_MKID_BE(a) @@ -386,7 +386,8 @@ FORCEINLINE uint16 SWAP_BYTES_16(uint16 a) { #if defined(SCUMM_NEED_ALIGNMENT) || defined(SCUMM_LITTLE_ENDIAN) FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) { - return (((const byte *)ptr)[0] << 8)|((const byte *)ptr)[1]; + const byte *b = (const byte *)ptr; + return (b[0] << 8) + b[1]; } FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) { const byte *b = (const byte*)ptr; |