Browse Source

Changed if/else statement series to switch.

release/0.19
JustinAJ 11 years ago
parent
commit
bbfb132ccb
  1. 30
      Jupiter/Functions.c

30
Jupiter/Functions.c

@ -629,17 +629,22 @@ unsigned int strtoui_nospace(const char *str, int base)
if (*str == '0')
{
str++;
if (*str == 'x' || *str == 'X')
switch (*str)
{
case 'X':
case 'x':
str++;
base = 16;
}
else if (*str == 'b' || *str == 'B')
{
break;
case 'B':
case 'b':
str++;
base = 2;
break;
default:
base = 8;
break;
}
else base = 8;
}
else base = 10;
}
@ -752,19 +757,24 @@ unsigned int strtoui_nospace_s(const char *str, size_t length, int base)
{
if (--length == 0) return total;
str++;
if (*str == 'x' || *str == 'X')
switch (*str)
{
case 'X':
case 'x':
if (--length == 0) return total;
str++;
base = 16;
}
else if (*str == 'b' || *str == 'B')
{
break;
case 'B':
case 'b':
if (--length == 0) return total;
str++;
base = 2;
break;
default:
base = 8;
break;
}
else base = 8;
}
else base = 10;
}

Loading…
Cancel
Save