2.4.21-rc1 pointless IDE noise reduction
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
Quoted 7 lines · Chuck Ebbert
Those double exclamation points should be hidden in macros. :)
Not any more. They've been canonized! :)