From aa3985a298d7770ef780324adea3ba0fe75b4e09 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 23 Aug 2020 09:37:51 +0200 Subject: Don't use "case X ... Y:", if possible/where it makes sense --- osc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'osc.c') diff --git a/osc.c b/osc.c index 20ceda8e..dcfaf524 100644 --- a/osc.c +++ b/osc.c @@ -339,9 +339,15 @@ static uint8_t nibble2hex(char c) { switch (c) { - case '0' ... '9': return c - '0'; - case 'a' ... 'f': return c - 'a' + 10; - case 'A' ... 'F': return c - 'A' + 10; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + return c - '0'; + + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + return c - 'a' + 10; + + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + return c - 'A' + 10; } assert(false); -- cgit v1.3