lkml.org 
[lkml]   [2008]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 07/26] Add INIT_ARRAY() to kernel.h

On Jan 24 2008 15:27, Mathieu Desnoyers wrote:
>such as:
>text_poke(addr, INIT_ARRAY(unsigned char, 0xf0, len), len);
text_poke(addr, (unsigned char[]){[0 ... len-1] = val});

Well ugliness is debatable, but at least:

>+#define INIT_ARRAY(type, val, len) ((type [len]) { [0 ... (len)-1] = (val) })
#define INIT_ARRAY(type, val, len) ((type[]){[0 ... (len)-1] = (val)})

You can use type[].


\
 
 \ /
  Last update: 2008-01-24 21:49    [from the cache]
©2003-2011 Jasper Spaans