[PATCH 01/12] include: fix mask size calculation

Peter Hutterer peter.hutterer at who-t.net
Mon Nov 7 13:39:05 PST 2011


Same bug as inputproto-2.0.1-9-gb1149ab, if the XI2LASTEVENT was a multiple
of 8, the mask was one bit too short.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 include/inputstr.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/inputstr.h b/include/inputstr.h
index 0a21287..f482a22 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -72,7 +72,7 @@ extern _X_EXPORT int CountBits(const uint8_t *mask, int len);
  * this number here is bumped.
  */
 #define XI2LASTEVENT    17 /* XI_RawMotion */
-#define XI2MASKSIZE     ((XI2LASTEVENT + 7)/8) /* no of bits for masks */
+#define XI2MASKSIZE     ((XI2LASTEVENT >> 3) + 1) /* no of bytes for masks */
 
 /**
  * Scroll types for ::SetScrollValuator and the scroll type in the
-- 
1.7.7



More information about the xorg-devel mailing list