From 98246e21ebf86db15cc848644bcd3e2827c5a2ca Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 21 Jan 2025 09:28:03 -0500 Subject: Add PUGL_KEY_NONE This isn't a strict enumeration anyway, so a sentinel value does no harm, and using it avoids warnings about testing an enum with no zero value. --- src/x11.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/x11.c') diff --git a/src/x11.c b/src/x11.c index f09e8e5..1d3b7f0 100644 --- a/src/x11.c +++ b/src/x11.c @@ -814,13 +814,13 @@ keyInRange(const KeySym xSym, const PuglKey puglMin) { return (xSym >= xMin && xSym <= xMax) ? (PuglKey)(puglMin + (xSym - xMin)) - : (PuglKey)0; + : PUGL_KEY_NONE; } static PuglKey keySymToSpecial(const KeySym sym) { - PuglKey key = (PuglKey)0; + PuglKey key = PUGL_KEY_NONE; if ((key = keyInRange(sym, XK_F1, XK_F12, PUGL_KEY_F1)) || (key = keyInRange(sym, XK_Page_Up, XK_End, PUGL_KEY_PAGE_UP)) || (key = keyInRange(sym, XK_Home, XK_Down, PUGL_KEY_HOME)) || @@ -853,7 +853,7 @@ keySymToSpecial(const KeySym sym) } // clang-format on - return (PuglKey)0; + return PUGL_KEY_NONE; } static int -- cgit v1.2.1