aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMarcus Comstedt2003-05-04 17:21:31 +0000
committerMarcus Comstedt2003-05-04 17:21:31 +0000
commit83db6265202e077f8a7007ab604e7d5829b8cc11 (patch)
treed8a7fb47e0dd1adf4632308dfd5f96820a4e1143 /scumm
parent7a10ab0cc2033cd9d350d0e7ceabfcd41c348b76 (diff)
downloadscummvm-rg350-83db6265202e077f8a7007ab604e7d5829b8cc11.tar.gz
scummvm-rg350-83db6265202e077f8a7007ab604e7d5829b8cc11.tar.bz2
scummvm-rg350-83db6265202e077f8a7007ab604e7d5829b8cc11.zip
GCC believes that if we cast a pointer to <type *>, then we are guaranteeing
that the pointer has proper alignment for <type>, and that it can replace the memcpy() with a direct assignment. This totally defies the purpose of the memcpy(), which is there precisely because the memory is unaligned. Avoid problems by not making the cast. svn-id: r7322
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v6.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index 307043b469..b0a98e3c0e 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -425,14 +425,14 @@ void Scumm::writeArray(int array, int idx, int base, int value) {
} else if (_features & GF_AFTER_V8) {
#if defined(SCUMM_NEED_ALIGNMENT)
uint32 tmp = TO_LE_32(value);
- memcpy(&((uint32 *)ah->data)[base], &tmp, 4);
+ memcpy(&((char *)ah->data)[base*sizeof(uint32)], &tmp, 4);
#else
((uint32 *)ah->data)[base] = TO_LE_32(value);
#endif
} else {
#if defined(SCUMM_NEED_ALIGNMENT)
uint16 tmp = TO_LE_16(value);
- memcpy(&((uint16 *)ah->data)[base], &tmp, 2);
+ memcpy(&((char *)ah->data)[base*sizeof(uint16)], &tmp, 2);
#else
((uint16 *)ah->data)[base] = TO_LE_16(value);
#endif