Skip to contentSkip to conversation

2.4.21-rc1 pointless IDE noise reduction

PATCH Chuck Ebbert 2 participants 2 messages Apr 24, 2003 – Apr 25, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · Timothy Miller

Two alternatives:

(a) !!(x & 0x400)

(b) (x & 0x400) >> 10

I like either of these:

   #define FOO_BITS 0x400
   #define test_mask(t,m) ( !!((t) & (m)) )
   ...
   return test_mask(x, FOO_BITS);

or

   return (x & FOO_BITS) != 0;

Those double exclamation points should be hidden in macros. :)

------
Chuck

#1 lore raw
Quoted 7 lines · Chuck Ebbert

Those double exclamation points should be hidden in macros. :)

Not any more. They've been canonized! :)

Quoted 2 lines