[Mplayer-cvslog] CVS: main mp_msg.h,1.25,1.26
Moritz Bunkus CVS
mosu at mplayerhq.hu
Wed Jan 15 12:16:59 CET 2003
Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv14644
Modified Files:
mp_msg.h
Log Message:
bunkus: Encapsulated arguments to #define in ( ... ) so that the #defines can be safely used like functions: mydef(flag ? val1 : val2)
Index: mp_msg.h
===================================================================
RCS file: /cvsroot/mplayer/main/mp_msg.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- mp_msg.h 1 Oct 2002 06:45:08 -0000 1.25
+++ mp_msg.h 15 Jan 2003 11:16:10 -0000 1.26
@@ -93,7 +93,7 @@
#ifdef TARGET_OS2
// va_start/vsnprintf seems to be broken under OS2 :(
-#define mp_msg(mod,lev, fmt, args... ) do{if(lev<=mp_msg_levels[mod]) printf( fmt, ## args );}while(0)
+#define mp_msg(mod,lev, fmt, args... ) do{if((lev)<=mp_msg_levels[mod]) printf( fmt, ## args );}while(0)
#define mp_dbg(mod,lev, args... )
#else
@@ -108,19 +108,19 @@
void mp_msg_c( int x, const char *format, ... );
#ifdef __GNUC__
-#define mp_msg(mod,lev, args... ) mp_msg_c((mod<<8)|lev, ## args )
+#define mp_msg(mod,lev, args... ) mp_msg_c(((mod)<<8)|(lev), ## args )
#ifdef MP_DEBUG
-#define mp_dbg(mod,lev, args... ) mp_msg_c((mod<<8)|lev, ## args )
+#define mp_dbg(mod,lev, args... ) mp_msg_c(((mod)<<8)|(lev), ## args )
#else
// these messages are only usefull for developers, disable them
#define mp_dbg(mod,lev, args... )
#endif
#else // not GNU C
-#define mp_msg(mod,lev, ... ) mp_msg_c((mod<<8)|lev, __VA_ARGS__)
+#define mp_msg(mod,lev, ... ) mp_msg_c(((mod)<<8)|(lev), __VA_ARGS__)
#ifdef MP_DEBUG
-#define mp_dbg(mod,lev, ... ) mp_msg_c((mod<<8)|lev, __VA_ARGS__)
+#define mp_dbg(mod,lev, ... ) mp_msg_c(((mod)<<8)|(lev), __VA_ARGS__)
#else
// these messages are only usefull for developers, disable them
#define mp_dbg(mod,lev, ... )
More information about the MPlayer-cvslog
mailing list