src/evdev.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
New commits: commit 2e9a71df5f8e8cdcdb80eec9e17501a75d5bd669 Author: Michel Dänzer <[EMAIL PROTECTED]> Date: Tue Jul 29 10:06:07 2008 +0200 xf86-input-evdev: Fix EVIOCGBIT ioctl usage on big endian platforms. With this fix, on my PowerBook HAL hotplugging correctly detects my USB mouse, and no longer thinks keyboards have random numbers of mouse buttons. :) The LONG_BITS and NBITS macro definitions are stolen from xf86-input-synaptics. Signed-off-by: Michel Dänzer <[EMAIL PROTECTED]> Signed-off-by: Peter Hutterer <[EMAIL PROTECTED]> [cherry-picked from master and fixed the trivial conflict -- jcristau] diff --git a/src/evdev.c b/src/evdev.c index f9c6fde..0cd016a 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -306,7 +306,9 @@ EvdevReadInput(InputInfoPtr pInfo) } } -#define TestBit(bit, array) (array[(bit) / 8] & (1 << ((bit) % 8))) +#define LONG_BITS (sizeof(long) * 8) +#define NBITS(x) (((x) + LONG_BITS - 1) / LONG_BITS) +#define TestBit(bit, array) (array[(bit) / LONG_BITS]) & (1 << ((bit) % LONG_BITS)) static void EvdevPtrCtrlProc(DeviceIntPtr device, PtrCtrl *ctrl) @@ -895,9 +897,9 @@ EvdevConvert(InputInfoPtr pInfo, int first, int num, int v0, int v1, int v2, static int EvdevProbe(InputInfoPtr pInfo) { - char key_bitmask[(KEY_MAX + 7) / 8]; - char rel_bitmask[(REL_MAX + 7) / 8]; - char abs_bitmask[(ABS_MAX + 7) / 8]; + long key_bitmask[NBITS(KEY_MAX)]; + long rel_bitmask[NBITS(REL_MAX)]; + long abs_bitmask[NBITS(ABS_MAX)]; int i, has_axes, has_buttons, has_keys; EvdevPtr pEvdev = pInfo->private; commit 49de32e70f833628554342ef4225a4174158b412 Author: Julien Cristau <[EMAIL PROTECTED]> Date: Sun Jul 20 11:33:37 2008 +0200 Fill up the version info Report correct versions instead of "compiled for 0.0.0, module version = 1.0.0" (cherry picked from commit 2b7edaa4ab88e192d7285d39b4834d1e535b94d0) diff --git a/src/evdev.c b/src/evdev.c index 471bb51..f9c6fde 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -42,6 +42,7 @@ #include <xf86Xinput.h> #include <exevents.h> #include <mipointer.h> +#include <xorgVersion.h> #include "evdev.h" @@ -1101,8 +1102,8 @@ static XF86ModuleVersionInfo EvdevVersionRec = MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, - 0, /* Missing from SDK: XORG_VERSION_CURRENT, */ - 1, 0, 0, + XORG_VERSION_CURRENT, + PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL, ABI_CLASS_XINPUT, ABI_XINPUT_VERSION, MOD_CLASS_XINPUT, -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]