arnout at mind.be
Mon May 11 19:22:28 UTC 2009
On Wednesday 06 May 2009 17:49:28 Joel Sherrill wrote:
> I am looking at warnings and wondered if someone
> could figured this one out.
> c/src/libchip/network/i82586.c:1722: warning: suggest parentheses around
> operand of '!' or change '|' to '||' or '!' to '~'
> The code is clearly questionable IMO. ;)
> *IE_CMD_CFG_PROMISC(buf) = !!promiscuous | manchester << 2;
This means (!!promiscuous) | (manchester << 2). It looks OK to me, though
adding parenthases around as I did certainly makes things clearer.
The !! is a trick to make sure you have a 1, not just any non-zero int.
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: D206 D44B 5155 DF98 550D 3F2A 2213 88AA A1C7 C933
More information about the users