summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/events.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/events.h b/include/events.h
index b09116741..7bc83a6d7 100644
--- a/include/events.h
+++ b/include/events.h
@@ -62,6 +62,10 @@ enum {
ET_Internal = 0xFF /* First byte */
} EventType;
+#define CHECKEVENT(ev) if (ev && ((InternalEvent*)(ev))->u.any.header != 0xFF) \
+ FatalError("Wrong event type %d.\n", \
+ ((InternalEvent*)(ev))->u.any.header);
+
/**
* Used for ALL input device events internal in the server until
* copied into the matching protocol event.