Use named initializers for the various dispatch interfaces

Better for self-documentation than comments and makes it more obvious if we
initialize something wrongly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2017-09-19 13:28:58 +10:00
parent 4c531f7e99
commit 6c7dd36398
4 changed files with 40 additions and 40 deletions

View file

@ -2251,16 +2251,16 @@ tp_interface_toggle_touch(struct evdev_dispatch *dispatch,
}
static struct evdev_dispatch_interface tp_interface = {
tp_interface_process,
tp_interface_suspend,
tp_interface_remove,
tp_interface_destroy,
tp_interface_device_added,
tp_interface_device_removed,
tp_interface_device_removed, /* device_suspended, treat as remove */
tp_interface_device_added, /* device_resumed, treat as add */
NULL, /* post_added */
tp_interface_toggle_touch,
.process = tp_interface_process,
.suspend = tp_interface_suspend,
.remove = tp_interface_remove,
.destroy = tp_interface_destroy,
.device_added = tp_interface_device_added,
.device_removed = tp_interface_device_removed,
.device_suspended = tp_interface_device_removed, /* treat as remove */
.device_resumed = tp_interface_device_added, /* treat as add */
.post_added = NULL,
.toggle_touch = tp_interface_toggle_touch,
};
static void

View file

@ -504,16 +504,16 @@ pad_destroy(struct evdev_dispatch *dispatch)
}
static struct evdev_dispatch_interface pad_interface = {
pad_process,
pad_suspend, /* suspend */
NULL, /* remove */
pad_destroy,
NULL, /* device_added */
NULL, /* device_removed */
NULL, /* device_suspended */
NULL, /* device_resumed */
NULL, /* post_added */
NULL, /* toggle_touch */
.process = pad_process,
.suspend = pad_suspend,
.remove = NULL,
.destroy = pad_destroy,
.device_added = NULL,
.device_removed = NULL,
.device_suspended = NULL,
.device_resumed = NULL,
.post_added = NULL,
.toggle_touch = NULL,
};
static void

View file

@ -1872,16 +1872,16 @@ tablet_check_initial_proximity(struct evdev_device *device,
}
static struct evdev_dispatch_interface tablet_interface = {
tablet_process,
tablet_suspend,
NULL, /* remove */
tablet_destroy,
tablet_device_added,
tablet_device_removed,
NULL, /* device_suspended */
NULL, /* device_resumed */
tablet_check_initial_proximity,
NULL, /* toggle_touch */
.process = tablet_process,
.suspend = tablet_suspend,
.remove = NULL,
.destroy = tablet_destroy,
.device_added = tablet_device_added,
.device_removed = tablet_device_removed,
.device_suspended = NULL,
.device_resumed = NULL,
.post_added = tablet_check_initial_proximity,
.toggle_touch = NULL,
};
static void

View file

@ -1764,16 +1764,16 @@ fallback_interface_device_removed(struct evdev_device *device,
}
struct evdev_dispatch_interface fallback_interface = {
fallback_process,
fallback_suspend,
fallback_remove,
fallback_destroy,
fallback_interface_device_added,
fallback_interface_device_removed,
fallback_interface_device_removed, /* device_suspended, treat as remove */
fallback_interface_device_added, /* device_resumed, treat as add */
fallback_sync_initial_state, /* post_added */
fallback_toggle_touch,
.process = fallback_process,
.suspend = fallback_suspend,
.remove = fallback_remove,
.destroy = fallback_destroy,
.device_added = fallback_interface_device_added,
.device_removed = fallback_interface_device_removed,
.device_suspended = fallback_interface_device_removed, /* treat as remove */
.device_resumed = fallback_interface_device_added, /* treat as add */
.post_added = fallback_sync_initial_state,
.toggle_touch = fallback_toggle_touch,
};
static uint32_t