lkml.org 
[lkml]   [2008]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [patch 07/26] Add INIT_ARRAY() to kernel.h (update 2)
From
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.


\
 
 \ /
  Last update: 2008-01-24 23:53    [W:0.053 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site