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/multi | |
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/multi')
-rw-r--r-- | backend/multi/backend.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/multi/backend.c b/backend/multi/backend.c index 49792ff9..1ee21c14 100644 --- a/backend/multi/backend.c +++ b/backend/multi/backend.c @@ -21,7 +21,8 @@ struct subbackend_state { static struct wlr_multi_backend *multi_backend_from_backend( struct wlr_backend *wlr_backend) { assert(wlr_backend_is_multi(wlr_backend)); - return (struct wlr_multi_backend *)wlr_backend; + struct wlr_multi_backend *backend = wl_container_of(wlr_backend, backend, backend); + return backend; } static bool multi_backend_start(struct wlr_backend *wlr_backend) { |