Messages in this thread | | | Date | Fri, 25 Jan 2008 01:50:40 +0300 | Subject | Re: [patch 07/26] Add INIT_ARRAY() to kernel.h (update 2) | From | Alexey Dobriyan <> |
| |
On Thu, Jan 24, 2008 at 05:10:54PM -0500, Mathieu Desnoyers wrote: > Array initializers in the body of a function causes unbalanced brackets which > syntax highlighting editors such as vim have problems with. Fix this by creating > the INIT_ARRAY() macro. > > It is used to declare arguments passed as function parameters such as: > text_poke(addr, INIT_ARRAY(unsigned char, 0xf0, len), len);
> +#define INIT_ARRAY(type, val, len) ((type[]) {[0 ... (len)-1] = (val)})
While we are at useless macro territory, let's name it MAKE_ARRAY because it's exactly what it does.
| |