mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-06-07 08:14:48 +00:00
rewrite radix detection loop as while
This commit is contained in:
parent
0729d88cc8
commit
b59a6c0557
@ -15,10 +15,8 @@ I64 Str2I64(U8 *st, I64 radix=10, U8 **_end_ptr=NULL)
|
|||||||
st++;
|
st++;
|
||||||
if (*st == '+' || *st == '-')
|
if (*st == '+' || *st == '-')
|
||||||
neg = *st++ == '-';
|
neg = *st++ == '-';
|
||||||
while (TRUE)
|
while (*st == '0')
|
||||||
switch (*st)
|
|
||||||
{
|
{
|
||||||
case '0':
|
|
||||||
st++;
|
st++;
|
||||||
ch = ToUpper(*st);
|
ch = ToUpper(*st);
|
||||||
if (ch >= 'B' && (radix <= 10 || ch > 'A' + radix - 11))
|
if (ch >= 'B' && (radix <= 10 || ch > 'A' + radix - 11))
|
||||||
@ -29,10 +27,7 @@ I64 Str2I64(U8 *st, I64 radix=10, U8 **_end_ptr=NULL)
|
|||||||
case 'D': radix = 10; st++; break;
|
case 'D': radix = 10; st++; break;
|
||||||
case 'X': radix = 16; st++; break;
|
case 'X': radix = 16; st++; break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
goto ai_cont;
|
|
||||||
}
|
}
|
||||||
ai_cont:
|
|
||||||
while (ch = ToUpper(*st++))
|
while (ch = ToUpper(*st++))
|
||||||
{
|
{
|
||||||
if (radix > 10)
|
if (radix > 10)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user