[MPlayer-cvslog] r33443 - trunk/mp_msg.h

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun May 8 12:54:36 CEST 2011


On Sun, May 08, 2011 at 12:48:39PM +0200, reimar wrote:
> Author: reimar
> Date: Sun May  8 12:48:39 2011
> New Revision: 33443
> 
> Log:
> Change mp_dbg so that syntax is checked also when it is disabled.
> This also avoids many false "unused variable" warnings.
> 
> Modified:
>    trunk/mp_msg.h
> 
> Modified: trunk/mp_msg.h
> ==============================================================================
> --- trunk/mp_msg.h	Sun May  8 12:46:41 2011	(r33442)
> +++ trunk/mp_msg.h	Sun May  8 12:48:39 2011	(r33443)
> @@ -148,14 +148,16 @@ void mp_msg(int mod, int lev, const char
>  #   ifdef MP_DEBUG
>  #      define mp_dbg(mod,lev, args... ) mp_msg(mod, lev, ## args )
>  #   else
> -#      define mp_dbg(mod,lev, args... ) /* only useful for developers */
> +       // only useful for developers, disable but check syntax
> +#      define mp_dbg(mod,lev, args... ) do { if (0) mp_msg(mod, lev, ## args ); } while (0)
>  #   endif
>  #else // not GNU C
>  void mp_msg(int mod, int lev, const char *format, ... );
>  #   ifdef MP_DEBUG
>  #      define mp_dbg(mod,lev, ... ) mp_msg(mod, lev, __VA_ARGS__)
>  #   else
> -#      define mp_dbg(mod,lev, ... ) /* only useful for developers */
> +       // only useful for developers, disable but check syntax
> +#      define mp_dbg(mod,lev, ... ) do { if (0) mp_msg(mod, lev, __VA_ARGS__); } while (0)
>  #   endif
>  #endif /* __GNUC__ */

Hopefully that's a solution for the debug messages everyone is happy with.


More information about the MPlayer-cvslog mailing list