aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2015-01-14 23:20:33 +0100
committerWillem Jan Palenstijn2015-01-14 23:20:33 +0100
commitcc045f7a83b1282ee453d0c1d90ca2372de554c8 (patch)
treee5664d470b5d00d20eb083d248764bfda099eba2
parentfb97e58886832f695c8cb217b1d8d4ee2d7958f0 (diff)
downloadscummvm-rg350-cc045f7a83b1282ee453d0c1d90ca2372de554c8.tar.gz
scummvm-rg350-cc045f7a83b1282ee453d0c1d90ca2372de554c8.tar.bz2
scummvm-rg350-cc045f7a83b1282ee453d0c1d90ca2372de554c8.zip
COMMON: Fix strict-alignment READ_UINT64
-rw-r--r--common/endian.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/endian.h b/common/endian.h
index 0c6b3db621..1c06bb91d3 100644
--- a/common/endian.h
+++ b/common/endian.h
@@ -322,7 +322,7 @@
#ifdef HAVE_INT64
inline uint64 READ_UINT64(const void *ptr) {
const uint8 *b = (const uint8 *)ptr;
- return (b[7] << 56) | (b[6] << 48) | (b[5] << 40) | (b[4] << 32) | (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | (b[0]);
+ return ((uint64)b[7] << 56) | ((uint64)b[6] << 48) | ((uint64)b[5] << 40) | ((uint64)b[4] << 32) | ((uint64)b[3] << 24) | ((uint64)b[2] << 16) | ((uint64)b[1] << 8) | ((uint64)b[0]);
}
inline void WRITE_UINT64(void *ptr, uint64 value) {
uint8 *b = (uint8 *)ptr;
@@ -362,7 +362,7 @@
#ifdef HAVE_INT64
inline uint64 READ_UINT64(const void *ptr) {
const uint8 *b = (const uint8 *)ptr;
- return (b[0] << 56) | (b[1] << 48) | (b[2] << 40) | (b[3] << 32) | (b[4] << 24) | (b[5] << 16) | (b[6] << 8) | (b[7]);
+ return ((uint64)b[0] << 56) | ((uint64)b[1] << 48) | ((uint64)b[2] << 40) | ((uint64)b[3] << 32) | ((uint64)b[4] << 24) | ((uint64)b[5] << 16) | ((uint64)b[6] << 8) | ((uint64)b[7]);
}
inline void WRITE_UINT64(void *ptr, uint64 value) {
uint8 *b = (uint8 *)ptr;