mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-06-07 00:04:48 +00:00
Merge pull request #116 from mknos/str2i64_oct
Str2I64() octal prefix 0o
This commit is contained in:
commit
9334f5f512
@ -1,5 +1,5 @@
|
|||||||
I64 Str2I64(U8 *st, I64 radix=10, U8 **_end_ptr=NULL)
|
I64 Str2I64(U8 *st, I64 radix=10, U8 **_end_ptr=NULL)
|
||||||
{//String to I64. Similar to strtoul().
|
{//String to I64. Similar to strtol().
|
||||||
//Allows radix change with "0x20" "0b1010" "0d123" "0o18".
|
//Allows radix change with "0x20" "0b1010" "0d123" "0o18".
|
||||||
//Be careful of Str2I64("0b101", 16)-->0xB101.
|
//Be careful of Str2I64("0b101", 16)-->0xB101.
|
||||||
Bool neg = FALSE;
|
Bool neg = FALSE;
|
||||||
@ -32,6 +32,7 @@ I64 Str2I64(U8 *st, I64 radix=10, U8 **_end_ptr=NULL)
|
|||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case 'B': radix = 2; st++; break;
|
case 'B': radix = 2; st++; break;
|
||||||
|
case 'O': radix = 8; st++; break;
|
||||||
case 'D': radix = 10; st++; break;
|
case 'D': radix = 10; st++; break;
|
||||||
case 'X': radix = 16; st++; break;
|
case 'X': radix = 16; st++; break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user