Lines Matching refs:base
30 * Like atol, with specified base. Would use stdlib, but
35 myatol(char *s, int base)
40 if (base == 0)
41 base = 10;
42 if (base != 10 && base != 16)
49 result = result * base + (ch - '0');
52 /* Allow leading 0x..., and switch to base 16 */
53 base = 16;
55 else if (base == 16 && ch >= 'a' && ch <= 'f') {
56 result = result * base + (ch - 'a' + 10);
58 else if (base == 16 && ch >= 'A' && ch <= 'F') {
59 result = result * base + (ch - 'A' + 10);