From 6c1a00b6d73e4374d1ec354366cade34d0f66e4d Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 20 Sep 2021 18:20:12 +0200 Subject: scene: drop default case in wlr_scene_node_at This allows the compiler to error out if we haven't enumerated all of the cases. This is useful to avoid a missing implementation when adding a new node type. --- wlr_scene.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wlr_scene.c b/wlr_scene.c index 5d57504..31e0fd9 100644 --- a/wlr_scene.c +++ b/wlr_scene.c @@ -446,6 +446,9 @@ struct wlr_scene_node *wlr_scene_node_at(struct wlr_scene_node *node, } switch (node->type) { + case WLR_SCENE_NODE_ROOT: + case WLR_SCENE_NODE_TREE: + break; case WLR_SCENE_NODE_SURFACE:; struct wlr_scene_surface *scene_surface = wlr_scene_surface_from_node(node); if (wlr_surface_point_accepts_input(scene_surface->surface, lx, ly)) { @@ -470,8 +473,6 @@ struct wlr_scene_node *wlr_scene_node_at(struct wlr_scene_node *node, return &rect->node; } break; - default: - break; } return NULL; -- cgit v1.2.3