summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-02-16 16:34:05 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-03-20 15:17:53 +1000
commit6fe4c28bf4f3a9f7c341b9403213470e9ded5cb3 (patch)
treeee3f4e4e6daa1e06759455930c9b197cd88c94ab /mi
parent836864b65794dc0954a01245e418e714cead8125 (diff)
Add agressive event type checking.
Best to FatalError if a wrong event comes in. At least that forces me to fix it really quickly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'mi')
-rw-r--r--mi/mieq.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mi/mieq.c b/mi/mieq.c
index 084660263..efec55a63 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -162,6 +162,8 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e)
pthread_mutex_lock(&miEventQueueMutex);
#endif
+ CHECKEVENT(e);
+
/* avoid merging events from different devices */
if (e->u.any.type == ET_Motion)
isMotion = pDev->id;
@@ -285,6 +287,8 @@ static void
FixUpEventForMaster(DeviceIntPtr mdev, DeviceIntPtr sdev,
InternalEvent* original, InternalEvent *master)
{
+ CHECKEVENT(original);
+ CHECKEVENT(master);
/* Ensure chained button mappings, i.e. that the detail field is the
* value of the mapped button on the SD, not the physical button */
if (original->u.any.type == ET_ButtonPress ||
@@ -312,6 +316,8 @@ CopyGetMasterEvent(DeviceIntPtr mdev, DeviceIntPtr sdev,
int len = original->u.any.length;
InternalEvent *mevent;
+ CHECKEVENT(original);
+
if (master->evlen < len)
SetMinimumEventSize(master, 1, len);
@@ -337,6 +343,8 @@ mieqProcessDeviceEvent(DeviceIntPtr dev,
int x = 0, y = 0;
DeviceIntPtr master;
+ CHECKEVENT(event);
+
/* Custom event handler */
handler = miEventQueue.handlers[event->u.any.type];