[Scummvm-cvs-logs] SF.net SVN: scummvm: [26649] scummvm/trunk/common/endian.h
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sat Apr 28 12:40:01 CEST 2007
Revision: 26649
http://scummvm.svn.sourceforge.net/scummvm/?rev=26649&view=rev
Author: fingolfin
Date: 2007-04-28 03:40:00 -0700 (Sat, 28 Apr 2007)
Log Message:
-----------
Double-invert the logic on some big/little endian checks (the idea is that we want to fallback to safe code unless we definitely know no endian/alignment issues are in the way; this way it will work even if the endianess is unknown)
Modified Paths:
--------------
scummvm/trunk/common/endian.h
Modified: scummvm/trunk/common/endian.h
===================================================================
--- scummvm/trunk/common/endian.h 2007-04-28 10:12:02 UTC (rev 26648)
+++ scummvm/trunk/common/endian.h 2007-04-28 10:40:00 UTC (rev 26649)
@@ -131,7 +131,7 @@
#endif
-#if defined(SCUMM_NEED_ALIGNMENT) || defined(SCUMM_BIG_ENDIAN)
+#if defined(SCUMM_NEED_ALIGNMENT) || !defined(SCUMM_LITTLE_ENDIAN)
FORCEINLINE uint16 READ_LE_UINT16(const void *ptr) {
const byte *b = (const byte *)ptr;
return (b[1] << 8) + b[0];
@@ -168,7 +168,7 @@
#endif
-#if defined(SCUMM_NEED_ALIGNMENT) || defined(SCUMM_LITTLE_ENDIAN)
+#if defined(SCUMM_NEED_ALIGNMENT) || !defined(SCUMM_BIG_ENDIAN)
FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
const byte *b = (const byte *)ptr;
return (b[0] << 8) + b[1];
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