[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



> +/* 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...


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]