aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/drm.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-07-11 17:54:08 +0200
committerSimon Ser <contact@emersion.fr>2023-07-11 20:16:17 +0200
commitfe06e5f49a12174ceeb5e307bf5c3d7f623177d5 (patch)
tree40984fb21cd0cbf6be531206a86167298ab2d537 /backend/drm/drm.c
parentc2c536de034cc27d3a15001cc478f5a327b8f910 (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/drm/drm.c')
-rw-r--r--backend/drm/drm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 5f71f923..fdbab3bf 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -331,7 +331,8 @@ void finish_drm_resources(struct wlr_drm_backend *drm) {
static struct wlr_drm_connector *get_drm_connector_from_output(
struct wlr_output *wlr_output) {
assert(wlr_output_is_drm(wlr_output));
- return (struct wlr_drm_connector *)wlr_output;
+ struct wlr_drm_connector *conn = wl_container_of(wlr_output, conn, output);
+ return conn;
}
static void layer_handle_addon_destroy(struct wlr_addon *addon) {