[lvm-devel] Re: LVM2 ./WHATS_NEW_DM libdm/libdm-deptree.c

Dave Wysochanski dwysocha at redhat.com
Thu Dec 11 16:35:23 UTC 2008


> +/* simplify string emiting code */
> +#define EMIT_PARAMS(p, str...)\
> +	do {\
> +		const size_t bufsize = paramsize - (size_t)p;\
> +		int w;\
> +		\
> +		if ((w = snprintf(params + p, bufsize, str)) < 0\
> +		    || ((size_t)w >= bufsize)) {\
> +			stack; /* Out of space */\
> +			return -1;\
> +		}\
> +		p += w;\
> +	} while (0)
> +

Do we have to do a macro here?  Macros like this are harder to debug...




More information about the lvm-devel mailing list