From: Rusty Russell Date: Fri, 3 Dec 2010 12:23:52 +0000 (+1030) Subject: array: fix type introduced in handling !HAVE_TYPEOF X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=117cc6cdab716e87dc286fb1f32a62f820bc90be;ds=sidebyside array: fix type introduced in handling !HAVE_TYPEOF Commit da72623aec30 added a typo; ccanlint caught it, but doesn't consider test compile failing to be fatal (it should!). --- diff --git a/ccan/array/array.h b/ccan/array/array.h index 35248409..fb470135 100644 --- a/ccan/array/array.h +++ b/ccan/array/array.h @@ -102,7 +102,7 @@ #define array_appends_t(array, type, ...) do {type __src[] = {__VA_ARGS__}; array_append_items(array, __src, sizeof(__src)/sizeof(*__src));} while(0) #if HAVE_TYPEOF==1 -#define array_appends(array, ...) array_appends_t(array, typeof((*(array).item)), __VA_ARGS__)) +#define array_appends(array, ...) array_appends_t(array, typeof((*(array).item)), __VA_ARGS__) #define array_prepends(array, ...) do {typeof((*(array).item)) __src[] = {__VA_ARGS__}; array_prepend_items(array, __src, sizeof(__src)/sizeof(*__src));} while(0) #define array_for(var, array, ...) array_for_t(var, array, typeof(*(array).item), __VA_ARGS__) #define array_rof(var, array, ...) do {typeof(*(array).item) *var=(void*)(array).item; size_t _i=(array).size, _r=0; var += _i; for (;_i--;_r++) { var--; __VA_ARGS__ ;} } while(0)