[Scummvm-cvs-logs] SF.net SVN: scummvm:[44025] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Sep 11 10:39:10 CEST 2009


Revision: 44025
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44025&view=rev
Author:   fingolfin
Date:     2009-09-11 08:39:09 +0000 (Fri, 11 Sep 2009)

Log Message:
-----------
Don't abuse FORCEINLINE

Modified Paths:
--------------
    scummvm/trunk/engines/m4/m4.h
    scummvm/trunk/tools/create_kyradat/util.h
    scummvm/trunk/tools/create_teenagent/util.h

Modified: scummvm/trunk/engines/m4/m4.h
===================================================================
--- scummvm/trunk/engines/m4/m4.h	2009-09-10 11:39:22 UTC (rev 44024)
+++ scummvm/trunk/engines/m4/m4.h	2009-09-11 08:39:09 UTC (rev 44025)
@@ -99,11 +99,11 @@
 
 #define GAME_FRAME_DELAY 50
 
-FORCEINLINE void str_lower(char *s) { while (*s) { *s = tolower(*s); s++; } }
-FORCEINLINE void str_upper(char *s) { while (*s) { *s = toupper(*s); s++; } }
+inline void str_lower(char *s) { while (*s) { *s = tolower(*s); s++; } }
+inline void str_upper(char *s) { while (*s) { *s = toupper(*s); s++; } }
 
-FORCEINLINE long FixedMul(long a, long b) { return (long)(((float)a * (float)b) / 65536.0); }
-FORCEINLINE long FixedDiv(long a, long b) { return (long)(((float)a / (float)b) * 65536.0); }
+inline long FixedMul(long a, long b) { return (long)(((float)a * (float)b) / 65536.0); }
+inline long FixedDiv(long a, long b) { return (long)(((float)a / (float)b) * 65536.0); }
 
 class M4Engine : public Engine {
 private:

Modified: scummvm/trunk/tools/create_kyradat/util.h
===================================================================
--- scummvm/trunk/tools/create_kyradat/util.h	2009-09-10 11:39:22 UTC (rev 44024)
+++ scummvm/trunk/tools/create_kyradat/util.h	2009-09-11 08:39:09 UTC (rev 44025)
@@ -156,22 +156,20 @@
 	return ((a >> 8) & 0xFF) | ((a << 8) & 0xFF00);
 }
 
-#define FORCEINLINE static inline
-
-FORCEINLINE uint16 READ_LE_UINT16(const void *ptr) {
+static inline uint16 READ_LE_UINT16(const void *ptr) {
 	const byte *b = (const byte *)ptr;
 	return (b[1] << 8) + b[0];
 }
-FORCEINLINE uint32 READ_LE_UINT32(const void *ptr) {
+static inline uint32 READ_LE_UINT32(const void *ptr) {
 	const byte *b = (const byte *)ptr;
 	return (b[3] << 24) + (b[2] << 16) + (b[1] << 8) + (b[0]);
 }
-FORCEINLINE void WRITE_LE_UINT16(void *ptr, uint16 value) {
+static inline void WRITE_LE_UINT16(void *ptr, uint16 value) {
 	byte *b = (byte *)ptr;
 	b[0] = (byte)(value >> 0);
 	b[1] = (byte)(value >> 8);
 }
-FORCEINLINE void WRITE_LE_UINT32(void *ptr, uint32 value) {
+static inline void WRITE_LE_UINT32(void *ptr, uint32 value) {
 	byte *b = (byte *)ptr;
 	b[0] = (byte)(value >>  0);
 	b[1] = (byte)(value >>  8);
@@ -179,20 +177,20 @@
 	b[3] = (byte)(value >> 24);
 }
 
-FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
+static inline uint16 READ_BE_UINT16(const void *ptr) {
 	const byte *b = (const byte *)ptr;
 	return (b[0] << 8) + b[1];
 }
-FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) {
+static inline uint32 READ_BE_UINT32(const void *ptr) {
 	const byte *b = (const byte*)ptr;
 	return (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]);
 }
-FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
+static inline void WRITE_BE_UINT16(void *ptr, uint16 value) {
 	byte *b = (byte *)ptr;
 	b[0] = (byte)(value >> 8);
 	b[1] = (byte)(value >> 0);
 }
-FORCEINLINE void WRITE_BE_UINT32(void *ptr, uint32 value) {
+static inline void WRITE_BE_UINT32(void *ptr, uint32 value) {
 	byte *b = (byte *)ptr;
 	b[0] = (byte)(value >> 24);
 	b[1] = (byte)(value >> 16);

Modified: scummvm/trunk/tools/create_teenagent/util.h
===================================================================
--- scummvm/trunk/tools/create_teenagent/util.h	2009-09-10 11:39:22 UTC (rev 44024)
+++ scummvm/trunk/tools/create_teenagent/util.h	2009-09-11 08:39:09 UTC (rev 44025)
@@ -156,22 +156,20 @@
 	return ((a >> 8) & 0xFF) | ((a << 8) & 0xFF00);
 }
 
-#define FORCEINLINE static inline
-
-FORCEINLINE uint16 READ_LE_UINT16(const void *ptr) {
+static inline uint16 READ_LE_UINT16(const void *ptr) {
 	const byte *b = (const byte *)ptr;
 	return (b[1] << 8) + b[0];
 }
-FORCEINLINE uint32 READ_LE_UINT32(const void *ptr) {
+static inline uint32 READ_LE_UINT32(const void *ptr) {
 	const byte *b = (const byte *)ptr;
 	return (b[3] << 24) + (b[2] << 16) + (b[1] << 8) + (b[0]);
 }
-FORCEINLINE void WRITE_LE_UINT16(void *ptr, uint16 value) {
+static inline void WRITE_LE_UINT16(void *ptr, uint16 value) {
 	byte *b = (byte *)ptr;
 	b[0] = (byte)(value >> 0);
 	b[1] = (byte)(value >> 8);
 }
-FORCEINLINE void WRITE_LE_UINT32(void *ptr, uint32 value) {
+static inline void WRITE_LE_UINT32(void *ptr, uint32 value) {
 	byte *b = (byte *)ptr;
 	b[0] = (byte)(value >>  0);
 	b[1] = (byte)(value >>  8);
@@ -179,20 +177,20 @@
 	b[3] = (byte)(value >> 24);
 }
 
-FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
+static inline uint16 READ_BE_UINT16(const void *ptr) {
 	const byte *b = (const byte *)ptr;
 	return (b[0] << 8) + b[1];
 }
-FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) {
+static inline uint32 READ_BE_UINT32(const void *ptr) {
 	const byte *b = (const byte*)ptr;
 	return (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]);
 }
-FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
+static inline void WRITE_BE_UINT16(void *ptr, uint16 value) {
 	byte *b = (byte *)ptr;
 	b[0] = (byte)(value >> 8);
 	b[1] = (byte)(value >> 0);
 }
-FORCEINLINE void WRITE_BE_UINT32(void *ptr, uint32 value) {
+static inline void WRITE_BE_UINT32(void *ptr, uint32 value) {
 	byte *b = (byte *)ptr;
 	b[0] = (byte)(value >> 24);
 	b[1] = (byte)(value >> 16);


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