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/headless/output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'backend/headless/output.c') diff --git a/backend/headless/output.c b/backend/headless/output.c index db7b707f..9cac54d1 100644 --- a/backend/headless/output.c +++ b/backend/headless/output.c @@ -17,7 +17,8 @@ static size_t last_output_num = 0; static struct wlr_headless_output *headless_output_from_output( struct wlr_output *wlr_output) { assert(wlr_output_is_headless(wlr_output)); - return (struct wlr_headless_output *)wlr_output; + struct wlr_headless_output *output = wl_container_of(wlr_output, output, wlr_output); + return output; } static bool output_set_custom_mode(struct wlr_headless_output *output, -- cgit v1.2.3