Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/fs/puffs



On Sun, Oct 05, 2014 at 02:13:15PM +0000, Alan Barrett wrote:
>  #ifdef PUFFSDEBUG
>  extern int puffsdebug; /* puffs_subr.c */
> -#define DPRINTF(x) if (puffsdebug > 0) printf x
> -#define DPRINTF_VERBOSE(x) if (puffsdebug > 1) printf x
> +#define DPRINTF(x) do { \
> +		if (puffsdebug > 0) printf x; \
> +	while (/*CONSTCOND*/0)

I think it'd be even more safe to close the block with a '}' before the
while.

> +#define DPRINTF_VERBOSE(x) do { \
> +		if (puffsdebug > 1) printf x; \
> +	while (/*CONSTCOND*/0)

Here too.

>  #else
> -#define DPRINTF(x)
> -#define DPRINTF_VERBOSE(x)
> +#define DPRINTF(x) ((void)0)
> +#define DPRINTF_VERBOSE(x) ((void)0)
>  #endif
>  
>  #define MPTOPUFFSMP(mp) ((struct puffs_mount *)((mp)->mnt_data))

(I must admit, not compile-tested) 

Regards,
Alistair


Home | Main Index | Thread Index | Old Index