1 // SPDX-License-Identifier: GPL-2.0-only
5 * Author: Scott Wood <scottwood@freescale.com>
7 * Copyright (c) 2007 Freescale Semiconductor, Inc.
12 /* Not currently supported: leading whitespace, sign, 0x prefix, zero base */
13 unsigned long long int strtoull(const char *ptr
, char **end
, int base
)
15 unsigned long long ret
= 0;
23 if (*ptr
>= '0' && *ptr
<= '9' && *ptr
< '0' + base
)
25 else if (*ptr
>= 'A' && *ptr
< 'A' + base
- 10)
26 digit
= *ptr
- 'A' + 10;
27 else if (*ptr
>= 'a' && *ptr
< 'a' + base
- 10)
28 digit
= *ptr
- 'a' + 10;