From 24ca40eea5249c279d4d89a07702802740515b19 Mon Sep 17 00:00:00 2001 From: Joost Peters Date: Sat, 25 Jul 2009 12:28:45 +0000 Subject: fix unaligned writes svn-id: r42747 --- engines/cruise/linker.cpp | 17 +++-------------- 1 file 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); } } } -- cgit v1.2.3