|
From: Tim-Philipp M. <t....@ze...> - 2010-02-26 13:13:08
|
On Fri, 2010-02-26 at 14:05 +0200, Felipe Contreras wrote: > > +#ifndef DIM /* XXX is there a better alternative available? */ > > +# define DIM(x) (sizeof(x)/sizeof((x)[0])) > > +#endif > > Let's call it ARRAY_SIZE (just like in the kernel). Maybe there's > something in GLib for that (can't recall though), but I like > ARRAY_SIZE :) GLib macro is G_N_ELEMENTS, fwiw. Cheers -Tim |