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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user