From: Andrew J. Hesford Date: Sat, 16 Dec 2023 02:21:06 +0000 (-0500) Subject: fix: fall-through to default cursor in cursor_get_from_edge() X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=7eae03117ef805bc86b07e1ff705c2cc195d7964;p=proto%2Flabwc.git fix: fall-through to default cursor in cursor_get_from_edge() When assertions are disabled, providing an unexpected input to cursor_get_from_edge will cause the non-void function to terminate without a return value. This may be effectively unreachable in practice. However, returning a default cursor as a fall-through case will both silence a compiler warning and prevent catastrophy should the function ever be called with a permitted value. --- diff --git a/src/input/cursor.c b/src/input/cursor.c index cb3f67bc..22680461 100644 --- a/src/input/cursor.c +++ b/src/input/cursor.c @@ -91,6 +91,8 @@ cursor_get_from_edge(uint32_t resize_edges) "Failed to resolve wlroots edge %u to cursor name", resize_edges); assert(false); } + + return LAB_CURSOR_DEFAULT; } static enum lab_cursors