[Scummvm-cvs-logs] SF.net SVN: scummvm:[42750] scummvm/branches/branch-1-0-0/engines/cruise/ linker.cpp

joostp at users.sourceforge.net joostp at users.sourceforge.net
Sat Jul 25 14:53:00 CEST 2009


Revision: 42750
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42750&view=rev
Author:   joostp
Date:     2009-07-25 12:53:00 +0000 (Sat, 25 Jul 2009)

Log Message:
-----------
fix unaligned writes

Modified Paths:
--------------
    scummvm/branches/branch-1-0-0/engines/cruise/linker.cpp

Modified: scummvm/branches/branch-1-0-0/engines/cruise/linker.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/cruise/linker.cpp	2009-07-25 12:44:16 UTC (rev 42749)
+++ scummvm/branches/branch-1-0-0/engines/cruise/linker.cpp	2009-07-25 12:53:00 UTC (rev 42750)
@@ -23,6 +23,7 @@
  *
  */
 
+#include "common/endian.h"
 #include "cruise/cruise_main.h"
 
 namespace Cruise {
@@ -192,9 +193,7 @@
 										*(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 @@
 										*(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);
 									}
 								}
 							}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list