Don't use "case X ... Y:", if possible/where it makes sense

This commit is contained in:
Daniel Eklöf 2020-08-23 09:37:51 +02:00
parent e32c0d9bf6
commit aa3985a298
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 25 additions and 7 deletions

12
osc.c
View file

@ -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);