On Friday 25 November 2011 09:08:47 Marek Lindner wrote:
[...]
+/* Returns
the biggest unsigned integer with the sizeof x */
+#define biggest_unsigned_int(x) (~(x)0)
+
The final conclusion of the IRC discussion might have escaped me but wasn't
there supposed to be a cast somewhere ?
There is a cast. The part "(x)" of "(~(x)0)" is the cast. And I
don't think
that there was a final conclusion. I am not really convinced that this should
be part of batman-adv. Just look at include/linux/kernel.h for similar
functionality (but with predefined types). Maybe this would be the correct
position for such a macro? (I don't know it... just thinking out loud).
Kind regards,
Sven