4 * Author: Scott Wood <scottwood@freescale.com>
6 * Copyright (c) 2007 Freescale Semiconductor, Inc.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
15 /* Not currently supported: leading whitespace, sign, 0x prefix, zero base */
16 unsigned long long int strtoull(const char *ptr
, char **end
, int base
)
18 unsigned long long ret
= 0;
26 if (*ptr
>= '0' && *ptr
<= '9' && *ptr
< '0' + base
)
28 else if (*ptr
>= 'A' && *ptr
< 'A' + base
- 10)
29 digit
= *ptr
- 'A' + 10;
30 else if (*ptr
>= 'a' && *ptr
< 'a' + base
- 10)
31 digit
= *ptr
- 'a' + 10;