Lines Matching refs:cp
114 static unsigned int simple_guess_base(const char *cp)
116 if (cp[0] == '0') {
117 if (TOLOWER(cp[1]) == 'x' && isxdigit(cp[2]))
128 * @cp: The start of the string
133 unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base)
138 base = simple_guess_base(cp);
140 if (base == 16 && cp[0] == '0' && TOLOWER(cp[1]) == 'x')
141 cp += 2;
143 while (isxdigit(*cp)) {
146 value = isdigit(*cp) ? *cp - '0' : TOLOWER(*cp) - 'a' + 10;
150 cp++;
153 *endp = (char *)cp;
158 long simple_strtol(const char *cp, char **endp, unsigned int base)
160 if (*cp == '-')
161 return -simple_strtoull(cp + 1, endp, base);
163 return simple_strtoull(cp, endp, base);