44 unsigned long long strtoull(
const char* __restrict nptr,
char** __restrict endptr,
int base)
47 unsigned long long acc;
49 unsigned long long cutoff;
59 }
while(
isspace((
unsigned char)c));
75 if((base == 0 || base == 16) && c ==
'0' && (*s ==
'x' || *s ==
'X'))
84 base = c ==
'0' ? 8 : 10;
88 if(base < 2 || base > 36)
95 cutoff =
ULLONG_MAX / (
unsigned long long)base;
96 cutlim = (int)(
ULLONG_MAX % (
unsigned long long)base);
99 if(c >=
'0' && c <=
'9')
105 else if(c >=
'A' && c <=
'Z')
111 else if(c >=
'a' && c <=
'z')
129 if(any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
138 acc *= (
unsigned long)base;
139 acc += (
unsigned long)c;
160 *endptr = (
char*)(uintptr_t)(any ? s - 1 : nptr);
unsigned long long strtoull(const char *__restrict nptr, char **__restrict endptr, int base)
Interprets an unsigned long long value in a byte string pointed to by str.
int isspace(int ch)
Checks if the given character is a whitespace character.