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') if (*str == '0')
{ {
str++; str++;
if (*str == 'x' || *str == 'X') switch (*str)
{ {
case 'X':
case 'x':
str++; str++;
base = 16; base = 16;
} break;
else if (*str == 'b' || *str == 'B') case 'B':
{ case 'b':
str++; str++;
base = 2; base = 2;
break;
default:
base = 8;
break;
} }
else base = 8;
} }
else base = 10; 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; if (--length == 0) return total;
str++; str++;
if (*str == 'x' || *str == 'X') switch (*str)
{ {
case 'X':
case 'x':
if (--length == 0) return total; if (--length == 0) return total;
str++; str++;
base = 16; base = 16;
} break;
else if (*str == 'b' || *str == 'B') case 'B':
{ case 'b':
if (--length == 0) return total; if (--length == 0) return total;
str++; str++;
base = 2; base = 2;
break;
default:
base = 8;
break;
} }
else base = 8;
} }
else base = 10; else base = 10;
} }

Loading…
Cancel
Save