evdev: improve type-safety on dispatch switches
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 30 Jan 2017 08:01:09 +0000 (18:01 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 30 Jan 2017 21:36:12 +0000 (07:36 +1000)
commit60de087e6521d2e098e129dae86cf40f7f7af354
tree0e86536b0ac2fcc1ba928036d89ed5a8a6cbe9d4
parentdc15a42d6cae4195d327253f6f05b65665eb3a93
evdev: improve type-safety on dispatch switches

Set the dispatch type on creation, then check that whenever we try to get the
dispatch struct. This avoids a potential mismatch between the backends.

Plus, use of container_of means we're not dependent on the exact layout
anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-lid.c
src/evdev-mt-touchpad-tap.c
src/evdev-mt-touchpad.c
src/evdev-mt-touchpad.h
src/evdev-tablet-pad.c
src/evdev-tablet-pad.h
src/evdev-tablet.c
src/evdev-tablet.h
src/evdev.c
src/evdev.h