diff options
author | Simon Ser <contact@emersion.fr> | 2021-09-20 18:20:12 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-09-22 10:45:39 -0600 |
commit | b25759cd20262f59e6144b00e9bc9d132549cc94 (patch) | |
tree | 5bc9cbf74a7b40adb7df3b129eaf781d8cdb441f | |
parent | 30d3c768174c40fc914d1057403c50072cbef3e4 (diff) |
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.
-rw-r--r-- | types/scene/wlr_scene.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 5d57504a..31e0fd98 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/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; |