--- orig/xorg-x11-6.9.0.dfsg.1/xc/programs/Xserver/hw/xfree86/input/evdev/evdev.c 2005-12-29 03:35:09.000000000 +0100 +++ xorg-x11-6.9.0.dfsg.1/xc/programs/Xserver/hw/xfree86/input/evdev/evdev.c 2006-01-18 19:31:46.000000000 +0100 @@ -199,7 +199,11 @@ EvdevReadInput(InputInfoPtr pInfo) xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy); } -#define TestBit(bit, array) (array[(bit) / 8] & (1 << ((bit) % 8))) +#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 void EvdevPtrCtrlProc(DeviceIntPtr device, PtrCtrl *ctrl) @@ -565,8 +569,8 @@ EvdevConvert(InputInfoPtr pInfo, int fir static int EvdevProbe(InputInfoPtr pInfo) { - char key_bitmask[(KEY_MAX + 7) / 8]; - char rel_bitmask[(REL_MAX + 7) / 8]; + unsigned long key_bitmask[NBITS(KEY_MAX)]; + unsigned long rel_bitmask[NBITS(REL_MAX)]; int i, has_axes, has_buttons, has_keys; EvdevPtr pEvdev = pInfo->private;