On Jan 24 2008 15:27, Mathieu Desnoyers wrote:
quoted text >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:
quoted text >+#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[].
--
unsubscribe notice To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Messages in current thread:
Re: [patch 07/26] Add INIT_ARRAY() to kernel.h , Jan Engelhardt , (Thu Jan 24, 1:39 pm)