diff options
author | Joost Peters | 2009-07-25 12:28:45 +0000 |
---|---|---|
committer | Joost Peters | 2009-07-25 12:28:45 +0000 |
commit | 24ca40eea5249c279d4d89a07702802740515b19 (patch) | |
tree | 8a0b5b5007cdf4833b90b4fa9c0082a74e108f6c /engines | |
parent | a69b4d60fc22d4c007d73e19556d84e104f580a6 (diff) | |
download | scummvm-rg350-24ca40eea5249c279d4d89a07702802740515b19.tar.gz scummvm-rg350-24ca40eea5249c279d4d89a07702802740515b19.tar.bz2 scummvm-rg350-24ca40eea5249c279d4d89a07702802740515b19.zip |
fix unaligned writes
svn-id: r42747
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cruise/linker.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/engines/cruise/linker.cpp b/engines/cruise/linker.cpp index bb6f682e1e..bfd5689e2f 100644 --- a/engines/cruise/linker.cpp +++ b/engines/cruise/linker.cpp @@ -23,6 +23,7 @@ * */ +#include "common/endian.h" #include "cruise/cruise_main.h" namespace Cruise { @@ -192,9 +193,7 @@ int updateScriptImport(int ovlIdx) { *(ptr + 1) = 0; *(ptr + 2) = out2; // update the overlay number - *(int16 *)(ptr + 4) = ptrDest2->idx; - - bigEndianShortToNative((int16 *)(ptr + 4)); + WRITE_BE_UINT16(ptr + 4, ptrDest2->idx); } else { int var_4 = ptrDest2->var4; @@ -213,17 +212,7 @@ int updateScriptImport(int ovlIdx) { *(ptrData + temp) = param2; *(ptrData + temp + 1) = out2; - *(int16 *)(ptrData + temp + 2) = ptrDest2->idx; - - bigEndianShortToNative - ( - (int16 - *) - (ptrData - + - temp - + - 2)); + WRITE_BE_UINT16(ptrData + temp + 2, ptrDest2->idx); } } } |