|
From: Marco <M.Z...@fr...> - 2003-06-09 23:09:26
|
On Monday 09 June 2003 23:01, Daniel Caujolle-Bert wrote:
Looks good to me. Should result in much nicer and cleaner code.
May I suggest to extend the "lprintf" with the ability to print
source-name, function and line-number to ease debugging.
>
> +
> +/* Only print if LOG is defined */
> +
> +#ifdef LOG
> +
> +#ifdef __GNUC__
> +#define lprintf(fmt, args...) \
> + do { \
printf(%s[%s:%d]:", __FILE__, \
__XINE_FUNCTION__, __LINE__ ); \
> + printf(fmt, ##args); \
> + } while(0)
> +#else
> +#define lprintf(fmt, ...) \
> + do { \
printf(%s[%s:%d]:", __FILE__, \
__XINE_FUNCTION__, __LINE__ ); \
> + printf(fmt, __VA_ARGS__); \
> + } while(0)
> +#endif
> +
[...]
> -------------------------------------------------------
> Patch overview:
>
> - if (this->class->xine->verbosity >= XINE_VERBOSITY_LOG)
> - printf ("audio_alsa_out:open pause_resume=%d\n",
> this->has_pause_resume); + xprintf(this->class->xine, XINE_VERBOSITY_LOG,
> + "audio_alsa_out:open pause_resume=%d\n", this->has_pause_resume);
>
> -#ifdef LOG
> - printf ("audio_oss_out: %d bytes output\n", info.bytes);
> -#endif
> + lprintf ("audio_oss_out: %d bytes output\n", info.bytes);
Then you can trim down the lprintf lines a bit more:
+ lprintf ("%d bytes output\n", info.bytes);
cu Marco
|