aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZephaniah E. Hull <warp@aehallh.com>2006-05-15 22:47:23 +0000
committerZephaniah E. Hull <warp@aehallh.com>2006-05-15 22:47:23 +0000
commit1b03250797daa0ac98323a9f43e895dd0b5c7761 (patch)
tree5edb9adecdec96b2161141482c5f3d77f3926e8a
parentTweak credits and references. (diff)
downloadxf86-input-evdev-1b03250797daa0ac98323a9f43e895dd0b5c7761.tar.gz
xf86-input-evdev-1b03250797daa0ac98323a9f43e895dd0b5c7761.tar.bz2
xf86-input-evdev-1b03250797daa0ac98323a9f43e895dd0b5c7761.zip
Hopefully fix the bitops stuff to actually _work_.
-rw-r--r--ChangeLog5
-rw-r--r--src/evdev.h8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index da630aa..0e47942 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-15 Zephaniah E. Hull,,, <warp@aehallh.com>
+
+ * src/evdev.h:
+ Hopefully fix the bitops stuff to actually _work_.
+
2006-05-14 Zephaniah E. Hull <warp@aehallh.com>
* man/evdev.man:
diff --git a/src/evdev.h b/src/evdev.h
index 757ccc7..a399571 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -73,15 +73,15 @@
#include <xf86Xinput.h>
#ifndef BITS_PER_LONG
-#define BITS_PER_LONG (sizeof(long) * 8)
+#define BITS_PER_LONG (sizeof(unsigned long) * 8)
#endif
#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
-#define LONG(x) ((x) >> (sizeof(unsigned long) + 1))
-#define MASK(x) (1 << ((x) & (sizeof (unsigned long) * 8 - 1)))
+#define LONG(x) ((x)/BITS_PER_LONG)
+#define MASK(x) (1UL << ((x) & (BITS_PER_LONG - 1)))
#ifndef test_bit
-#define test_bit(bit, array) (array[LONG(bit)] & MASK(bit))
+#define test_bit(bit, array) (!!(array[LONG(bit)] & MASK(bit)))
#endif
#ifndef set_bit
#define set_bit(bit, array) (array[LONG(bit)] |= MASK(bit))