diff options
author | Simon Ser <contact@emersion.fr> | 2023-07-11 17:54:08 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-07-11 20:16:17 +0200 |
commit | fe06e5f49a12174ceeb5e307bf5c3d7f623177d5 (patch) | |
tree | 40984fb21cd0cbf6be531206a86167298ab2d537 /backend/libinput | |
parent | c2c536de034cc27d3a15001cc478f5a327b8f910 (diff) |
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]'
Diffstat (limited to 'backend/libinput')
-rw-r--r-- | backend/libinput/backend.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c index 688fae5d..e95127bd 100644 --- a/backend/libinput/backend.c +++ b/backend/libinput/backend.c @@ -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, |