summaryrefslogtreecommitdiff
path: root/XI2.h
diff options
context:
space:
mode:
authorAlexandre Julliard <julliard@winehq.org>2011-04-12 22:39:25 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2011-04-14 12:34:31 +1000
commitb1149ab782619eaeadf70affd94239184e082d03 (patch)
tree73cb8bf0735bf24ca39af97104a6d914e179c5e8 /XI2.h
parentab930a51047f48c7befd4316a9b116f37075697f (diff)
XI2.h: Fix off-by-one error in the XIMaskLen definition.
The previous definition would give the wrong result for events that are a multiple of 8. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'XI2.h')
-rw-r--r--XI2.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/XI2.h b/XI2.h
index 6ba1377..3c39946 100644
--- a/XI2.h
+++ b/XI2.h
@@ -127,7 +127,7 @@
#define XISetMask(ptr, event) (((unsigned char*)(ptr))[(event)>>3] |= (1 << ((event) & 7)))
#define XIClearMask(ptr, event) (((unsigned char*)(ptr))[(event)>>3] &= ~(1 << ((event) & 7)))
#define XIMaskIsSet(ptr, event) (((unsigned char*)(ptr))[(event)>>3] & (1 << ((event) & 7)))
-#define XIMaskLen(event) (((event + 7) >> 3))
+#define XIMaskLen(event) (((event) >> 3) + 1)
/* Fake device ID's for event selection */
#define XIAllDevices 0