Am 27.01.2012 21:29, schrieb Allan, Bruce W: > For a simple boolean test of whether, for example, bit 5 is set in the variable 'flags', which of the following methods is preferred over the other? > > bool result = (flags & (1 << 5)) ? true : false; > > or > > bool result = !!(flags & (1 << 5)); > > I've seen examples of both in the Linux kernel. > > Thanks, > Bruce. > -- hi Bruce, i think this is a matter of taste, but i would say personaly i would go for option one since since !! can easely be overlooked. personaly i do not like bool. re, wh -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html