| 2804 | /****************************************************************************/ |
| 2805 | |
| 2806 | static int atoi_digit(char c, int base) |
| 2807 | { |
| 2808 | int d = -1; |
| 2809 | if (c >= '0' && c <= '9') |
| 2810 | d = c - '0'; |
| 2811 | else if (c >= 'a' && c <= 'z') |
| 2812 | d = 10 + (c - 'a'); |
| 2813 | else if (c >= 'A' && c <= 'Z') |
| 2814 | d = 10 + (c - 'A'); |
| 2815 | if (d < 0) |
| 2816 | return d; |
| 2817 | if (d >= base) |
| 2818 | return -1; |
| 2819 | return d; |
| 2820 | } |
| 2821 | |
| 2822 | static __int128 atoi_convert(const char * __restrict__ nptr, |
| 2823 | char ** __restrict__ endptr, int base, __int128 min, __int128 max) |