What the deal with the "!!" operator? I read it as a double logical negation. A NOOP, does it have some useful side effect?
On Wed, Nov 24, 2010 at 10:30 AM, walter harms <[email protected]> wrote: > > > Am 24.11.2010 07:25, schrieb Keith Packard: >> On Wed, 24 Nov 2010 14:40:11 +1000, Peter Hutterer >> <[email protected]> wrote: >> >>> -#define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))) >>> +#define BitIsOn(ptr, bit) !!(((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & >>> 7))) >> > > bit is checked to be less than 8 with "(bit) & 7" but only in the second > statement. > the linux kernel specifies them as inline code. maybe this is the way to go > here also. > > re, > wh > > _______________________________________________ > [email protected]: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel > _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
