diff options
Diffstat (limited to 'common/scummsys.h')
-rw-r--r-- | common/scummsys.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/common/scummsys.h b/common/scummsys.h index 1ee3c00452..a7ca0b6b48 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -360,7 +360,7 @@ #define TO_BE_32(a) SWAP_BYTES(a) - uint16 FORCEINLINE TO_BE_16(uint16 a) { return (a >> 8) | (a << 8); } + FORCEINLINE uint16 TO_BE_16(uint16 a) { return (a >> 8) | (a << 8); } #elif defined(SCUMM_BIG_ENDIAN) @@ -368,42 +368,42 @@ #define MKID_BE(a) (a) //#define MKID_BE(a) SWAP_BYTES(a) - uint32 FORCEINLINE FROM_LE_32(uint32 a) { + FORCEINLINE uint32 FROM_LE_32(uint32 a) { return ((a >> 24) & 0xFF) + ((a >> 8) & 0xFF00) + (( a<< 8) & 0xFF0000) \ + ((a<<24)&0xFF000000); } - uint16 FORCEINLINE FROM_LE_16(uint16 a) { + FORCEINLINE uint16 FROM_LE_16(uint16 a) { return ((a >> 8) & 0xFF) + ((a << 8) & 0xFF00); } #define TO_LE_32 FROM_LE_32 #define TO_LE_16 FROM_LE_16 - uint32 FORCEINLINE READ_LE_UINT32(const void *ptr) { - byte *b = (byte *)ptr; + FORCEINLINE uint32 READ_LE_UINT32(const void *ptr) { + const byte *b = (const byte *)ptr; return (b[3] << 24) + (b[2] << 16) + (b[1] << 8) + (b[0]); } - uint32 FORCEINLINE READ_BE_UINT32(const void *ptr) { - return *(uint32 *)(ptr); + FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) { + return *(const uint32 *)(ptr); } - uint FORCEINLINE READ_LE_UINT16(const void *ptr) { - byte *b = (byte *)ptr; + FORCEINLINE uint READ_LE_UINT16(const void *ptr) { + const byte *b = (const byte *)ptr; return (b[1] << 8) + b[0]; } - uint FORCEINLINE READ_BE_UINT16(const void *ptr) { - return *(uint16 *)(ptr); + FORCEINLINE uint READ_BE_UINT16(const void *ptr) { + return *(const uint16 *)(ptr); } - uint FORCEINLINE READ_BE_UINT16_UNALIGNED(const void *ptr) { - return (((byte *)ptr)[0] << 8)|((byte *)ptr)[1]; + FORCEINLINE uint READ_BE_UINT16_UNALIGNED(const void *ptr) { + return (((const byte *)ptr)[0] << 8)|((const byte *)ptr)[1]; } - uint32 FORCEINLINE READ_BE_UINT32_UNALIGNED(const void *ptr) { - byte *b = (byte*)ptr; + FORCEINLINE uint32 READ_BE_UINT32_UNALIGNED(const void *ptr) { + const byte *b = (const byte*)ptr; return (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]); } |