Lines Matching refs:cp
52 static unsigned int simple_guess_base(const char *cp)
54 if (cp[0] == '0') {
55 if (TOLOWER(cp[1]) == 'x' && isxdigit(cp[2]))
66 * @cp: The start of the string
71 unsigned long long simple_strtoull(const char *cp, char **endp,
77 base = simple_guess_base(cp);
79 if (base == 16 && cp[0] == '0' && TOLOWER(cp[1]) == 'x')
80 cp += 2;
82 while (isxdigit(*cp)) {
85 value = isdigit(*cp) ? *cp - '0' : TOLOWER(*cp) - 'a' + 10;
89 cp++;
92 *endp = (char *)cp;
97 long simple_strtol(const char *cp, char **endp, unsigned int base)
99 if (*cp == '-')
100 return -simple_strtoull(cp + 1, endp, base);
102 return simple_strtoull(cp, endp, base);