Use wl_container_of() instead of casts

This slightly improves type safety.

The culprits were found with:

    git grep -E '\([a-z0-9_ ]+ \*\)\W?[a-z]'
This commit is contained in:
Simon Ser 2023-07-11 17:54:08 +02:00
parent c2c536de03
commit fe06e5f49a
29 changed files with 85 additions and 55 deletions

View file

@ -11,7 +11,8 @@
static struct wlr_libinput_backend *get_libinput_backend_from_backend(
struct wlr_backend *wlr_backend) {
assert(wlr_backend_is_libinput(wlr_backend));
return (struct wlr_libinput_backend *)wlr_backend;
struct wlr_libinput_backend *backend = wl_container_of(wlr_backend, backend, backend);
return backend;
}
static int libinput_open_restricted(const char *path,