[Scummvm-cvs-logs] CVS: scummvm-new/common scummsys.h,1.1.1.1,1.2

Max Horn fingolfin at users.sourceforge.net
Sat Aug 24 16:22:17 CEST 2002


Update of /cvsroot/scummvm/scummvm-new/common
In directory usw-pr-cvs1:/tmp/cvs-serv5396/common

Modified Files:
	scummsys.h 
Log Message:
endian fixes; cleanup

Index: scummsys.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/common/scummsys.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- scummsys.h	21 Aug 2002 16:07:22 -0000	1.1.1.1
+++ scummsys.h	24 Aug 2002 23:21:55 -0000	1.2
@@ -237,6 +237,8 @@
 #endif
 
 
+#define SWAP_BYTES(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000))
+
 #if defined(SCUMM_LITTLE_ENDIAN)
 
 //#if defined(SCUMM_NEED_ALIGNMENT)
@@ -244,7 +246,7 @@
 //#endif
 
 
-#define PROTO_MKID(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000))
+#define PROTO_MKID(a) SWAP_BYTES(a)
 #define PROTO_MKID_BE(a) (a & 0xffffffff)
 
 #if defined(INVERSE_MKID)
@@ -297,7 +299,7 @@
 #define TO_LE_32(__a__) __a__
 #define TO_LE_16(__a__) __a__
 
-#define TO_BE_32(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000))
+#define TO_BE_32(a) SWAP_BYTES(a)
 
 uint16 FORCEINLINE TO_BE_16(uint16 a) { return (a>>8) | (a<<8); }
 
@@ -305,7 +307,7 @@
 
 #define MKID(a) (a)
 #define MKID_BE(a) (a)
-//#define MKID_BE(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000))
+//#define MKID_BE(a) SWAP_BYTES(a)
 
 uint32 FORCEINLINE FROM_LE_32(uint32 a) {
 	return ((a>>24)&0xFF) + ((a>>8)&0xFF00) + ((a<<8)&0xFF0000) + ((a<<24)&0xFF000000);





More information about the Scummvm-git-logs mailing list