From fe06e5f49a12174ceeb5e307bf5c3d7f623177d5 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 11 Jul 2023 17:54:08 +0200 Subject: 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]' --- backend/multi/backend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'backend/multi') 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) { -- cgit v1.2.3