[Scummvm-cvs-logs] CVS: scummvm/common util.h,1.5,1.6
Max Horn
fingolfin at users.sourceforge.net
Tue Oct 22 16:37:02 CEST 2002
Update of /cvsroot/scummvm/scummvm/common
In directory usw-pr-cvs1:/tmp/cvs-serv30234/common
Modified Files:
util.h
Log Message:
inline function instead of macro for SWAP, to make -Wshadow more useful
Index: util.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- util.h 19 Sep 2002 17:03:24 -0000 1.5
+++ util.h 22 Oct 2002 23:36:28 -0000 1.6
@@ -35,7 +35,7 @@
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
-#define SWAP(a,b) do{int tmp=a; a=b; b=tmp; } while(0)
+static inline void SWAP(int &a, int &b) { int tmp=a; a=b; b=tmp; }
#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
#if USE_555_FORMAT
More information about the Scummvm-git-logs
mailing list