summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatt Helsley <matt.helsley@gmail.com>2009-01-11 18:04:40 -0800
committerPeter Hutterer <peter.hutterer@who-t.net>2009-01-13 11:36:13 +1000
commit760f1c6bb184e3b48ca6a6bfe8942d306f378148 (patch)
treede09486ce631f31919580b34d82a92d9dff1baaa /src
parent2db04ba3c35e4976b34d92f8f7c6c2c9ec09f3ab (diff)
rename NBITS to NLONGS to reflect its actual meaning
NBITS really convers the number of bits passed as its argument into a number of longs. This is somewhat atypical of many function-like-macro names. Rename it to NLONGS. Signed-off-by: Matt Helsley <matt.helsley@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry-picked from commit d3fd42d8644310abcae23bbf534f8c445296bcb7) Not really required, but it makes cherry-picking 4dfd86b2201b2b19761a1abb3c580cecf0060224 easier.
Diffstat (limited to 'src')
-rw-r--r--src/evdev.c16
-rw-r--r--src/evdev.h14
2 files changed, 16 insertions, 14 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 2c73c67..e48edd9 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1202,11 +1202,11 @@ EvdevCacheCompare(InputInfoPtr pInfo, BOOL compare)
int i;
char name[1024] = {0};
- long bitmask[NBITS(EV_MAX)] = {0};
- long key_bitmask[NBITS(KEY_MAX)] = {0};
- long rel_bitmask[NBITS(REL_MAX)] = {0};
- long abs_bitmask[NBITS(ABS_MAX)] = {0};
- long led_bitmask[NBITS(LED_MAX)] = {0};
+ long bitmask[NLONGS(EV_MAX)] = {0};
+ long key_bitmask[NLONGS(KEY_MAX)] = {0};
+ long rel_bitmask[NLONGS(REL_MAX)] = {0};
+ long abs_bitmask[NLONGS(ABS_MAX)] = {0};
+ long led_bitmask[NLONGS(LED_MAX)] = {0};
struct input_absinfo absinfo[ABS_MAX];
if (ioctl(pInfo->fd,
@@ -1302,9 +1302,9 @@ error:
static int
EvdevProbe(InputInfoPtr pInfo)
{
- long key_bitmask[NBITS(KEY_MAX)] = {0};
- long rel_bitmask[NBITS(REL_MAX)] = {0};
- long abs_bitmask[NBITS(ABS_MAX)] = {0};
+ long key_bitmask[NLONGS(KEY_MAX)] = {0};
+ long rel_bitmask[NLONGS(REL_MAX)] = {0};
+ long abs_bitmask[NLONGS(ABS_MAX)] = {0};
int i, has_axes, has_keys, num_buttons;
int kernel24 = 0;
EvdevPtr pEvdev = pInfo->private;
diff --git a/src/evdev.h b/src/evdev.h
index af88741..107dc77 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -47,7 +47,9 @@
#endif
#define LONG_BITS (sizeof(long) * 8)
-#define NBITS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
+
+/* Number of longs needed to hold the given number of bits */
+#define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
/* axis specific data for wheel emulation */
typedef struct {
@@ -120,11 +122,11 @@ typedef struct {
/* Cached info from device. */
char name[1024];
- long bitmask[NBITS(EV_MAX)];
- long key_bitmask[NBITS(KEY_MAX)];
- long rel_bitmask[NBITS(REL_MAX)];
- long abs_bitmask[NBITS(ABS_MAX)];
- long led_bitmask[NBITS(LED_MAX)];
+ long bitmask[NLONGS(EV_MAX)];
+ long key_bitmask[NLONGS(KEY_MAX)];
+ long rel_bitmask[NLONGS(REL_MAX)];
+ long abs_bitmask[NLONGS(ABS_MAX)];
+ long led_bitmask[NLONGS(LED_MAX)];
struct input_absinfo absinfo[ABS_MAX];
/* minor/major number */