diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-06-15 20:00:41 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-06-18 10:17:08 +0930 |
commit | d21155a3e9b51df946766926bc6155c8972c4439 (patch) | |
tree | e0273dd5288f36aedeacd5a4ebfb9116e5080902 /include/inputstr.h | |
parent | 2b9c829bdebd16910bdf48b9d64862e3d34f5b7f (diff) |
input: fix up usage of button->down, used to be a bitmask, is now an array.
device->button->down used to be a 32-byte bitmask with one bit for each
button. This has changed into a 256-byte array, with one byte assigned for
each button. Some of the callers were still using this array as a bitmask
however, this is fixed with this patch.
Thanks to Keith Packard for pointing this out. See also:
http://lists.freedesktop.org/archives/xorg/2008-June/036202.html
Diffstat (limited to 'include/inputstr.h')
-rw-r--r-- | include/inputstr.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/inputstr.h b/include/inputstr.h index 7209b2cb3..11fe031a0 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -57,6 +57,9 @@ SOFTWARE. #include "privates.h" #define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))) +/* If byte[i] in src is non-zero, set bit i in dst, otherwise set bit to 0 */ +#define SetBitIf(dst, src, i) \ + (src[i]) ? (dst[i/8] |= (1 << (i % 8))) : (dst[i/8] &= ~(1 << (i % 8))); #define SameClient(obj,client) \ (CLIENT_BITS((obj)->resource) == (client)->clientAsMask) |