diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2002-05-11 14:50:18 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2002-05-11 14:50:18 +0000 |
commit | fd2907fec23831499b7c324f008df85d6f38db97 (patch) | |
tree | 898da677f1a4587abfa4266531772a1cc96a5289 /libc/stdio/scanf.c | |
parent | fd15708e6476164990e7b364dc5b2aa1600f8e89 (diff) |
Adjust preprocessor logic to initialize QUAL_CHARS correctly for Erik's alpha
port. Also, explicitly use the macro versions of isdigit and isspace in the
printf and scanf code.
Diffstat (limited to 'libc/stdio/scanf.c')
-rw-r--r-- | libc/stdio/scanf.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c index 96286d926..7506268b3 100644 --- a/libc/stdio/scanf.c +++ b/libc/stdio/scanf.c @@ -165,7 +165,7 @@ static int valid_digit(char c, char base) if (base == 16) { return isxdigit(c); } else { - return (isdigit(c) && (c < '0' + base)); + return (__isdigit(c) && (c < '0' + base)); } } @@ -321,7 +321,7 @@ va_list ap; store = 0; ++fmt; } - for (i = 0 ; isdigit(*fmt) ; sc.width = i) { + for (i = 0 ; __isdigit(*fmt) ; sc.width = i) { i = (i * 10) + (*fmt++ - '0'); /* Get specified width. */ } for (i = 0 ; i < sizeof(qual) ; i++) { /* Optional qualifier. */ @@ -348,7 +348,7 @@ va_list ap; if (p-spec > 3) { /* skip white space if not c or [ */ do { i = scan_getc_nw(&sc); - } while (isspace(i)); + } while (__isspace(i)); scan_ungetc(&sc); } if (p-spec < 5) { /* [,c,s - string conversions */ @@ -360,7 +360,7 @@ va_list ap; } } for (i=0 ; i<= UCHAR_MAX ; i++) { - scanset[i] = ((*p == 's') ? (isspace(i) == 0) : 0); + scanset[i] = ((*p == 's') ? (__isspace(i) == 0) : 0); } if (*p == '[') { /* need to build a scanset */ if (*++fmt == '^') { @@ -588,10 +588,10 @@ va_list ap; } /* Unrecognized specifier! */ goto RETURN_cnt; - } if (isspace(*fmt)) { /* Consume all whitespace. */ + } if (__isspace(*fmt)) { /* Consume all whitespace. */ do { i = scan_getc_nw(&sc); - } while (isspace(i)); + } while (__isspace(i)); } else { /* Match the current fmt char. */ matchchar: if (scan_getc_nw(&sc) != *fmt) { @@ -660,7 +660,7 @@ int __strtold(long double *ld, struct scan_cookie *sc) since_decimal = INT_MIN; LOOP: - while (isdigit(c)) { /* Process string of digits. */ + while (__isdigit(c)) { /* Process string of digits. */ ++since_decimal; if (num_digits < 0) { /* First time through? */ ++num_digits; /* We've now seen a digit. */ @@ -707,7 +707,7 @@ int __strtold(long double *ld, struct scan_cookie *sc) num_digits = 0; exponent_temp = 0; - while (isdigit(c)) { /* Process string of digits. */ + while (__isdigit(c)) { /* Process string of digits. */ if (exponent_temp < MAX_ALLOWED_EXP) { /* overflow check */ exponent_temp = exponent_temp * 10 + (c - '0'); } |