# define _STDLIB_H 1
#endif
-/**
- * ISDIGIT differs from isdigit, as follows:
- * - Its arg may be any int or unsigned int; it need not be an unsigned char
- * or EOF.
- * - It's typically faster.
- * POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
- * isdigit unless it's important to use the locale's definition
- * of "digit" even when the host does not conform to POSIX.
- */
-#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
-
/**
* Shift A right by B bits portably, by dividing A by 2**B and
* truncating towards minus infinity. A and B should be free of side
while (c = *pc->input, c_isspace (c))
pc->input++;
- if (ISDIGIT (c) || c == '-' || c == '+') {
+ if (c_isdigit (c) || c == '-' || c == '+') {
char const *p;
int sign;
unsigned long int value;
sign = c == '-' ? -1 : 1;
while (c = *++pc->input, c_isspace (c))
continue;
- if (! ISDIGIT (c))
+ if (! c_isdigit (c))
/* skip the '-' sign */
continue;
} else
return '?';
value = value1;
c = *++p;
- if (! ISDIGIT (c))
+ if (! c_isdigit (c))
break;
if (ULONG_MAX / 10 < value)
return '?';
}
- if ((c == '.' || c == ',') && ISDIGIT (p[1])) {
+ if ((c == '.' || c == ',') && c_isdigit (p[1])) {
time_t s;
int ns;
int digits;
for (digits = 2;
digits <= LOG10_BILLION; digits++) {
ns *= 10;
- if (ISDIGIT (*p))
+ if (c_isdigit (*p))
ns += *p++ - '0';
}
* -Infinity.
*/
if (sign < 0)
- for (; ISDIGIT (*p); p++)
+ for (; c_isdigit (*p); p++)
if (*p != '0') {
ns++;
break;
}
- while (ISDIGIT (*p))
+ while (c_isdigit (*p))
p++;
/* Adjust to the timespec convention, which is