From 160c2db32d0b9ee5316a44179a6af4f4722e3d0a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 18 Sep 2013 16:04:44 +1000 Subject: [PATCH] dmx: provide enough space for axis mappings relmap/absmap is used as a evdev-axis-to-x-axis mapping. ABS_X maps to axis 0, ABS_Y to 1, etc. skipping over non-existing axes so that the third bit set in the ABS_* range is axis 2, and so on. This requires us to actually have enough space to have all the ABS_*/REL_* range. Signed-off-by: Peter Hutterer Reviewed-by: Alan Coopersmith --- hw/dmx/input/usb-private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/dmx/input/usb-private.h b/hw/dmx/input/usb-private.h index 096607a34..2ecfdf636 100644 --- a/hw/dmx/input/usb-private.h +++ b/hw/dmx/input/usb-private.h @@ -102,8 +102,8 @@ typedef struct _myPrivate { int fd; /**< File descriptor */ unsigned char mask[EV_MAX / 8 + 1]; /**< Mask */ int numRel, numAbs, numLeds; /**< Counts */ - int relmap[DMX_MAX_AXES]; /**< Relative axis map */ - int absmap[DMX_MAX_AXES]; /**< Absolute axis map */ + int relmap[REL_CNT]; /**< Relative axis map */ + int absmap[ABS_CNT]; /**< Absolute axis map */ CARD32 kbdState[NUM_STATE_ENTRIES]; /**< Keyboard state */ DeviceIntPtr pKeyboard; /** Keyboard device */