mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-22 01:40:17 -05:00
Don't use "case X ... Y:", if possible/where it makes sense
This commit is contained in:
parent
e32c0d9bf6
commit
aa3985a298
2 changed files with 25 additions and 7 deletions
12
osc.c
12
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue