From e9c60da89a9c55b81b2dedcf6ee3d1aefb4ff591 Mon Sep 17 00:00:00 2001 From: "Zephaniah E. Hull" Date: Sun, 14 May 2006 11:55:50 +0000 Subject: Tweak credits and references. Change the longs to unsigned longs in the bitfields. Cleanup our includes. Stop pulling in asm/types.h and asm/bitops.h. Conditionally define the stuff that used to come from the above, including our own test_bit, set_bit and clear_bit. Change the longs to unsigned longs in the bitfields. Change the longs to unsigned longs in the bitfields. Use the bitop defines in evdev.h properly. Change the longs to unsigned longs in the bitfields. Change the longs to unsigned longs in the bitfields. Use the bitop defines in evdev.h properly. Change the longs to unsigned longs in the bitfields. Use the bitop defines in evdev.h properly. Add HPPA/HPPA64 entries. (Thanks to Fabio M. Di Nitto ) --- src/evdev_axes.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/evdev_axes.c') diff --git a/src/evdev_axes.c b/src/evdev_axes.c index dbeb889..d1bafd9 100644 --- a/src/evdev_axes.c +++ b/src/evdev_axes.c @@ -49,14 +49,6 @@ #include -#define ArrayLength(a) (sizeof(a) / (sizeof((a)[0]))) - -#define BITS_PER_LONG (sizeof(long) * 8) -#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) -#define OFF(x) ((x)%BITS_PER_LONG) -#define LONG(x) ((x)/BITS_PER_LONG) -#define TestBit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1) - static char *rel_axis_names[] = { "X", "Y", @@ -328,7 +320,7 @@ EvdevAxisAbsNew(InputInfoPtr pInfo) real_axes = 0; for (i = 0; i < ABS_MAX; i++) - if (TestBit (i, pEvdev->bits.abs)) + if (test_bit (i, pEvdev->bits.abs)) real_axes++; if (!real_axes) @@ -344,7 +336,7 @@ EvdevAxisAbsNew(InputInfoPtr pInfo) pInfo->conversion_proc = EvdevConvert; for (i = 0, j = 0; i < ABS_MAX; i++) { - if (!TestBit (i, pEvdev->bits.abs)) + if (!test_bit (i, pEvdev->bits.abs)) continue; snprintf(option, sizeof(option), "%sAbsoluteAxisMap", abs_axis_names[i]); @@ -389,7 +381,7 @@ EvdevAxisAbsNew(InputInfoPtr pInfo) xf86Msg(X_CONFIG, "%s: Unknown Mode: %s.\n", pInfo->name, s); } - if (TestBit (ABS_X, pEvdev->bits.abs) && TestBit (ABS_Y, pEvdev->bits.abs)) + if (test_bit (ABS_X, pEvdev->bits.abs) && test_bit (ABS_Y, pEvdev->bits.abs)) k = xf86SetIntOption(pInfo->options, "AbsoluteScreen", 0); else k = xf86SetIntOption(pInfo->options, "AbsoluteScreen", -1); @@ -417,7 +409,7 @@ EvdevAxisRelNew(InputInfoPtr pInfo) real_axes = 0; for (i = 0; i < REL_MAX; i++) - if (TestBit (i, pEvdev->bits.rel)) + if (test_bit (i, pEvdev->bits.rel)) real_axes++; if (!real_axes && (!state->abs || state->abs->axes < 2)) @@ -434,7 +426,7 @@ EvdevAxisRelNew(InputInfoPtr pInfo) pInfo->conversion_proc = EvdevConvert; for (i = 0, j = 0; i < REL_MAX; i++) { - if (!TestBit (i, pEvdev->bits.rel)) + if (!test_bit (i, pEvdev->bits.rel)) continue; snprintf(option, sizeof(option), "%sRelativeAxisMap", rel_axis_names[i]); -- cgit v1.2.3