diff options
author | marha <marha@users.sourceforge.net> | 2011-12-05 07:42:31 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-12-05 07:42:31 +0100 |
commit | 528f5bd58a139174170c4130c67dca30193c9057 (patch) | |
tree | 550c818095dbc607deaddf166c77116ccd91ef54 /mesalib/src/mesa/main/bitset.h | |
parent | 2cfebffb491807a465a8e5f7daca582d8aefb829 (diff) | |
download | vcxsrv-528f5bd58a139174170c4130c67dca30193c9057.tar.gz vcxsrv-528f5bd58a139174170c4130c67dca30193c9057.tar.bz2 vcxsrv-528f5bd58a139174170c4130c67dca30193c9057.zip |
xserver xkeyboard-config mesa git update 5 dec 2011
Diffstat (limited to 'mesalib/src/mesa/main/bitset.h')
-rw-r--r-- | mesalib/src/mesa/main/bitset.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/mesalib/src/mesa/main/bitset.h b/mesalib/src/mesa/main/bitset.h index 7a0704b14..c27b4c474 100644 --- a/mesalib/src/mesa/main/bitset.h +++ b/mesalib/src/mesa/main/bitset.h @@ -129,17 +129,32 @@ __bitset_ffs(const BITSET_WORD *x, int n) /* bit range operations */ -#define BITSET64_TEST_RANGE(x, b, e) \ +#define BITSET64_TEST_SUBRANGE(x, b, e) \ (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ ((x)[BITSET64_BITWORD(b)] & BITSET64_RANGE(b, e)) : \ (assert (!"BITSET64_TEST_RANGE: bit range crosses word boundary"), 0)) -#define BITSET64_SET_RANGE(x, b, e) \ +#define BITSET64_TEST_RANGE(x, b, e) \ + (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ + (BITSET64_TEST_SUBRANGE(x, b, e)) : \ + (BITSET64_TEST_SUBRANGE(x, b, BITSET64_WORDBITS - 1) | \ + BITSET64_TEST_SUBRANGE(x, BITSET64_WORDBITS, e))) +#define BITSET64_SET_SUBRANGE(x, b, e) \ (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ ((x)[BITSET64_BITWORD(b)] |= BITSET64_RANGE(b, e)) : \ (assert (!"BITSET64_SET_RANGE: bit range crosses word boundary"), 0)) -#define BITSET64_CLEAR_RANGE(x, b, e) \ +#define BITSET64_SET_RANGE(x, b, e) \ + (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ + (BITSET64_SET_SUBRANGE(x, b, e)) : \ + (BITSET64_SET_SUBRANGE(x, b, BITSET64_WORDBITS - 1) | \ + BITSET64_SET_SUBRANGE(x, BITSET64_WORDBITS, e))) +#define BITSET64_CLEAR_SUBRANGE(x, b, e) \ (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ ((x)[BITSET64_BITWORD(b)] &= ~BITSET64_RANGE(b, e)) : \ (assert (!"BITSET64_CLEAR_RANGE: bit range crosses word boundary"), 0)) +#define BITSET64_CLEAR_RANGE(x, b, e) \ + (BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \ + (BITSET64_CLEAR_SUBRANGE(x, b, e)) : \ + (BITSET64_CLEAR_SUBRANGE(x, b, BITSET64_WORDBITS - 1) | \ + BITSET64_CLEAR_SUBRANGE(x, BITSET64_WORDBITS, e))) #endif |