Commit e9a780ec by Kaveh R. Ghazi Committed by Kaveh Ghazi

c-common.c: Convert to using ctype macros defined in system.h.

        * c-common.c: Convert to using ctype macros defined in system.h.
        * c-lex.c: Likewise.
        * cccp.c: Likewise.
        * collect2.c: Likewise.
        * rs6000.c: Likewise.
        * cpplib.c: Likewise.
        * fix-header.c: Likewise.
        * gcc.c: Likewise.
        * gen-protos.c: Likewise.
        * pexecute.c: Likewise.
        * protoize.c: Likewise.
        * rtl.c: Likewise.
        * scan.c: Likewise.
        * stmt.c: Likewise.
        * tlink.c: Likewise.
        * toplev.c: Likewise.

From-SVN: r19579
parent d4c3e60e
Wed May 6 15:37:27 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-common.c: Convert to using ctype macros defined in system.h.
* c-lex.c: Likewise.
* cccp.c: Likewise.
* collect2.c: Likewise.
* rs6000.c: Likewise.
* cpplib.c: Likewise.
* fix-header.c: Likewise.
* gcc.c: Likewise.
* gen-protos.c: Likewise.
* pexecute.c: Likewise.
* protoize.c: Likewise.
* rtl.c: Likewise.
* scan.c: Likewise.
* stmt.c: Likewise.
* tlink.c: Likewise.
* toplev.c: Likewise.
Wed May 6 14:44:14 1998 Gavin Koch <gavin@cygnus.com> Wed May 6 14:44:14 1998 Gavin Koch <gavin@cygnus.com>
* config/mips/r3900.h (SUBTARGET_ASM_DEBUGGING_SPEC) : * config/mips/r3900.h (SUBTARGET_ASM_DEBUGGING_SPEC) :
......
...@@ -1356,7 +1356,7 @@ check_format_info (info, params) ...@@ -1356,7 +1356,7 @@ check_format_info (info, params)
suppressed = *format_chars == '*'; suppressed = *format_chars == '*';
if (suppressed) if (suppressed)
++format_chars; ++format_chars;
while (isdigit (*format_chars)) while (ISDIGIT (*format_chars))
++format_chars; ++format_chars;
} }
else if (info->format_type == strftime_format_type) else if (info->format_type == strftime_format_type)
...@@ -1379,7 +1379,7 @@ check_format_info (info, params) ...@@ -1379,7 +1379,7 @@ check_format_info (info, params)
flag_chars[i] = 0; flag_chars[i] = 0;
} }
} }
while (isdigit ((unsigned char) *format_chars)) while (ISDIGIT ((unsigned char) *format_chars))
{ {
wide = TRUE; wide = TRUE;
++format_chars; ++format_chars;
...@@ -1480,7 +1480,7 @@ check_format_info (info, params) ...@@ -1480,7 +1480,7 @@ check_format_info (info, params)
} }
else else
{ {
while (isdigit (*format_chars)) while (ISDIGIT (*format_chars))
{ {
wide = TRUE; wide = TRUE;
++format_chars; ++format_chars;
...@@ -1490,7 +1490,7 @@ check_format_info (info, params) ...@@ -1490,7 +1490,7 @@ check_format_info (info, params)
{ {
precise = TRUE; precise = TRUE;
++format_chars; ++format_chars;
if (*format_chars != '*' && !isdigit (*format_chars)) if (*format_chars != '*' && !ISDIGIT (*format_chars))
warning ("`.' not followed by `*' or digit in format"); warning ("`.' not followed by `*' or digit in format");
/* "...a...precision...may be indicated by an asterisk. /* "...a...precision...may be indicated by an asterisk.
In this case, an int argument supplies the...precision." */ In this case, an int argument supplies the...precision." */
...@@ -1515,7 +1515,7 @@ check_format_info (info, params) ...@@ -1515,7 +1515,7 @@ check_format_info (info, params)
} }
else else
{ {
while (isdigit (*format_chars)) while (ISDIGIT (*format_chars))
++format_chars; ++format_chars;
} }
} }
......
...@@ -1255,7 +1255,7 @@ yylex () ...@@ -1255,7 +1255,7 @@ yylex ()
case '$': case '$':
letter: letter:
p = token_buffer; p = token_buffer;
while (isalnum (c) || c == '_' || c == '$' || c == '@') while (ISALNUM (c) || c == '_' || c == '$' || c == '@')
{ {
/* Make sure this char really belongs in an identifier. */ /* Make sure this char really belongs in an identifier. */
if (c == '@' && ! doing_objc_thang) if (c == '@' && ! doing_objc_thang)
...@@ -1367,7 +1367,7 @@ yylex () ...@@ -1367,7 +1367,7 @@ yylex ()
next_c = GETC (); next_c = GETC ();
UNGETC (next_c); /* Always undo this lookahead. */ UNGETC (next_c); /* Always undo this lookahead. */
if (!isalnum (next_c) && next_c != '.') if (!ISALNUM (next_c) && next_c != '.')
{ {
token_buffer[0] = (char)c, token_buffer[1] = '\0'; token_buffer[0] = (char)c, token_buffer[1] = '\0';
yylval.ttype = (c == '0') ? integer_zero_node : integer_one_node; yylval.ttype = (c == '0') ? integer_zero_node : integer_one_node;
...@@ -1424,7 +1424,7 @@ yylex () ...@@ -1424,7 +1424,7 @@ yylex ()
/* Read all the digits-and-decimal-points. */ /* Read all the digits-and-decimal-points. */
while (c == '.' while (c == '.'
|| (isalnum (c) && c != 'l' && c != 'L' || (ISALNUM (c) && c != 'l' && c != 'L'
&& c != 'u' && c != 'U' && c != 'u' && c != 'U'
&& c != 'i' && c != 'I' && c != 'j' && c != 'J' && c != 'i' && c != 'I' && c != 'j' && c != 'J'
&& (floatflag == NOT_FLOAT || ((c != 'f') && (c != 'F'))))) && (floatflag == NOT_FLOAT || ((c != 'f') && (c != 'F')))))
...@@ -1453,7 +1453,7 @@ yylex () ...@@ -1453,7 +1453,7 @@ yylex ()
only when it is followed by a digit. only when it is followed by a digit.
Otherwise, unread the following non-digit Otherwise, unread the following non-digit
and use the '.' as a structural token. */ and use the '.' as a structural token. */
if (p == token_buffer + 2 && !isdigit (c)) if (p == token_buffer + 2 && !ISDIGIT (c))
{ {
if (c == '.') if (c == '.')
{ {
...@@ -1477,7 +1477,7 @@ yylex () ...@@ -1477,7 +1477,7 @@ yylex ()
/* It is not a decimal point. /* It is not a decimal point.
It should be a digit (perhaps a hex digit). */ It should be a digit (perhaps a hex digit). */
if (isdigit (c)) if (ISDIGIT (c))
{ {
c = c - '0'; c = c - '0';
} }
...@@ -1559,9 +1559,9 @@ yylex () ...@@ -1559,9 +1559,9 @@ yylex ()
*p++ = c; *p++ = c;
c = GETC(); c = GETC();
} }
if (! isdigit (c)) if (! ISDIGIT (c))
error ("floating constant exponent has no digits"); error ("floating constant exponent has no digits");
while (isdigit (c)) while (ISDIGIT (c))
{ {
if (p >= token_buffer + maxtoken - 3) if (p >= token_buffer + maxtoken - 3)
p = extend_token_buffer (p); p = extend_token_buffer (p);
...@@ -1876,7 +1876,7 @@ yylex () ...@@ -1876,7 +1876,7 @@ yylex ()
UNGETC (c); UNGETC (c);
*p = 0; *p = 0;
if (isalnum (c) || c == '.' || c == '_' || c == '$' if (ISALNUM (c) || c == '.' || c == '_' || c == '$'
|| (!flag_traditional && (c == '-' || c == '+') || (!flag_traditional && (c == '-' || c == '+')
&& (p[-1] == 'e' || p[-1] == 'E'))) && (p[-1] == 'e' || p[-1] == 'E')))
error ("missing white space after number `%s'", token_buffer); error ("missing white space after number `%s'", token_buffer);
...@@ -1923,7 +1923,7 @@ yylex () ...@@ -1923,7 +1923,7 @@ yylex ()
&& (unsigned) c >= (1 << width)) && (unsigned) c >= (1 << width))
pedwarn ("escape sequence out of range for character"); pedwarn ("escape sequence out of range for character");
#ifdef MAP_CHARACTER #ifdef MAP_CHARACTER
if (isprint (c)) if (ISPRINT (c))
c = MAP_CHARACTER (c); c = MAP_CHARACTER (c);
#endif #endif
} }
......
...@@ -1750,7 +1750,7 @@ main (argc, argv) ...@@ -1750,7 +1750,7 @@ main (argc, argv)
if (*vers == 'V') if (*vers == 'V')
vers++; vers++;
if (isdigit (*vers)) if (ISDIGIT (*vers))
{ {
vms_version_value = (*vers - '0') * 10000000; vms_version_value = (*vers - '0') * 10000000;
} }
...@@ -1758,7 +1758,7 @@ main (argc, argv) ...@@ -1758,7 +1758,7 @@ main (argc, argv)
if (*vers == '.') if (*vers == '.')
{ {
vers++; vers++;
if (isdigit (*vers)) if (ISDIGIT (*vers))
{ {
vms_version_value += (*vers - '0') * 100000; vms_version_value += (*vers - '0') * 100000;
} }
...@@ -2503,10 +2503,10 @@ get_lintcmd (ibp, limit, argstart, arglen, cmdlen) ...@@ -2503,10 +2503,10 @@ get_lintcmd (ibp, limit, argstart, arglen, cmdlen)
if ((linsize >= 7) && !bcmp (ibp, "VARARGS", 7)) { if ((linsize >= 7) && !bcmp (ibp, "VARARGS", 7)) {
*cmdlen = 7; *cmdlen = 7;
ibp += 7; linsize -= 7; ibp += 7; linsize -= 7;
if ((linsize == 0) || ! isdigit (*ibp)) return "VARARGS"; if ((linsize == 0) || ! ISDIGIT (*ibp)) return "VARARGS";
/* OK, read a number */ /* OK, read a number */
for (numptr = *argstart = ibp; (numptr < limit) && isdigit (*numptr); for (numptr = *argstart = ibp; (numptr < limit) && ISDIGIT (*numptr);
numptr++); numptr++);
*arglen = numptr - *argstart; *arglen = numptr - *argstart;
return "VARARGS"; return "VARARGS";
...@@ -4378,8 +4378,10 @@ get_filename: ...@@ -4378,8 +4378,10 @@ get_filename:
* code from case '<' is repeated here) and generates a warning. * code from case '<' is repeated here) and generates a warning.
* (Note: macro expansion of `xyz' takes precedence.) * (Note: macro expansion of `xyz' takes precedence.)
*/ */
if (retried && isalpha(*(U_CHAR *) (--fbeg))) { /* Note: The argument of ISALPHA() can be evaluated twice, so do
while (fin != limit && (!isspace(*fin))) the pre-decrement outside of the macro. */
if (retried && (--fbeg, ISALPHA(*(U_CHAR *) (fbeg)))) {
while (fin != limit && (!ISSPACE(*fin)))
*fend++ = *fin++; *fend++ = *fin++;
warning ("VAX-C-style include specification found, use '#include <filename.h>' !"); warning ("VAX-C-style include specification found, use '#include <filename.h>' !");
vaxc_include = 1; vaxc_include = 1;
...@@ -4673,7 +4675,7 @@ base_name (fname) ...@@ -4673,7 +4675,7 @@ base_name (fname)
char *s = fname; char *s = fname;
char *p; char *p;
#if defined (__MSDOS__) || defined (_WIN32) #if defined (__MSDOS__) || defined (_WIN32)
if (isalpha (s[0]) && s[1] == ':') s += 2; if (ISALPHA (s[0]) && s[1] == ':') s += 2;
#endif #endif
#ifdef VMS #ifdef VMS
if ((p = rindex (s, ':'))) s = p + 1; /* Skip device. */ if ((p = rindex (s, ':'))) s = p + 1; /* Skip device. */
...@@ -4696,11 +4698,11 @@ absolute_filename (filename) ...@@ -4696,11 +4698,11 @@ absolute_filename (filename)
char *filename; char *filename;
{ {
#if defined (__MSDOS__) || (defined (_WIN32) && !defined (__CYGWIN32__)) #if defined (__MSDOS__) || (defined (_WIN32) && !defined (__CYGWIN32__))
if (isalpha (filename[0]) && filename[1] == ':') filename += 2; if (ISALPHA (filename[0]) && filename[1] == ':') filename += 2;
#endif #endif
#if defined (__CYGWIN32__) #if defined (__CYGWIN32__)
/* At present, any path that begins with a drive spec is absolute. */ /* At present, any path that begins with a drive spec is absolute. */
if (isalpha (filename[0]) && filename[1] == ':') return 1; if (ISALPHA (filename[0]) && filename[1] == ':') return 1;
#endif #endif
if (filename[0] == '/') return 1; if (filename[0] == '/') return 1;
#ifdef DIR_SEPARATOR #ifdef DIR_SEPARATOR
...@@ -6628,7 +6630,7 @@ do_line (buf, limit, op, keyword) ...@@ -6628,7 +6630,7 @@ do_line (buf, limit, op, keyword)
bp = tem.buf; bp = tem.buf;
SKIP_WHITE_SPACE (bp); SKIP_WHITE_SPACE (bp);
if (!isdigit (*bp)) { if (!ISDIGIT (*bp)) {
error ("invalid format `#line' directive"); error ("invalid format `#line' directive");
return 0; return 0;
} }
...@@ -6643,7 +6645,7 @@ do_line (buf, limit, op, keyword) ...@@ -6643,7 +6645,7 @@ do_line (buf, limit, op, keyword)
pedwarn ("line number out of range in `#line' directive"); pedwarn ("line number out of range in `#line' directive");
/* skip over the line number. */ /* skip over the line number. */
while (isdigit (*bp)) while (ISDIGIT (*bp))
bp++; bp++;
#if 0 /* #line 10"foo.c" is supposed to be allowed. */ #if 0 /* #line 10"foo.c" is supposed to be allowed. */
...@@ -7128,7 +7130,7 @@ do_xifdef (buf, limit, op, keyword) ...@@ -7128,7 +7130,7 @@ do_xifdef (buf, limit, op, keyword)
HASHNODE *hp; HASHNODE *hp;
if (! traditional) { if (! traditional) {
if (isdigit (buf[0])) if (ISDIGIT (buf[0]))
pedwarn ("`#%s' argument starts with a digit", keyword->name); pedwarn ("`#%s' argument starts with a digit", keyword->name);
else if (end != limit) else if (end != limit)
pedwarn ("garbage at end of `#%s' argument", keyword->name); pedwarn ("garbage at end of `#%s' argument", keyword->name);
...@@ -7871,7 +7873,7 @@ quote_string (dst, src, srclen) ...@@ -7871,7 +7873,7 @@ quote_string (dst, src, srclen)
switch ((c = *src++)) switch ((c = *src++))
{ {
default: default:
if (isprint (c)) if (ISPRINT (c))
*dst++ = c; *dst++ = c;
else else
{ {
......
...@@ -565,7 +565,7 @@ dump_file (name) ...@@ -565,7 +565,7 @@ dump_file (name)
{ {
int c; int c;
while (c = getc (stream), while (c = getc (stream),
c != EOF && (isalnum (c) || c == '_' || c == '$' || c == '.')) c != EOF && (ISALNUM (c) || c == '_' || c == '$' || c == '.'))
obstack_1grow (&temporary_obstack, c); obstack_1grow (&temporary_obstack, c);
if (obstack_object_size (&temporary_obstack) > 0) if (obstack_object_size (&temporary_obstack) > 0)
{ {
...@@ -1853,7 +1853,7 @@ write_c_file_stat (stream, name) ...@@ -1853,7 +1853,7 @@ write_c_file_stat (stream, name)
strncpy (prefix, p, q - p); strncpy (prefix, p, q - p);
prefix[q - p] = 0; prefix[q - p] = 0;
for (q = prefix; *q; q++) for (q = prefix; *q; q++)
if (!isalnum (*q)) if (!ISALNUM (*q))
*q = '_'; *q = '_';
if (debug) if (debug)
fprintf (stderr, "\nwrite_c_file - output name is %s, prefix is %s\n", fprintf (stderr, "\nwrite_c_file - output name is %s, prefix is %s\n",
...@@ -2169,7 +2169,7 @@ scan_prog_file (prog_name, which_pass) ...@@ -2169,7 +2169,7 @@ scan_prog_file (prog_name, which_pass)
name = p; name = p;
/* Find the end of the symbol name. /* Find the end of the symbol name.
Do not include `|', because Encore nm can tack that on the end. */ Do not include `|', because Encore nm can tack that on the end. */
for (end = p; (ch2 = *end) != '\0' && !isspace (ch2) && ch2 != '|'; for (end = p; (ch2 = *end) != '\0' && !ISSPACE (ch2) && ch2 != '|';
end++) end++)
continue; continue;
...@@ -2303,7 +2303,7 @@ libcompare (d1, d2) ...@@ -2303,7 +2303,7 @@ libcompare (d1, d2)
char *e2 = (*d2)->d_name + i2; char *e2 = (*d2)->d_name + i2;
while (*e1 && *e2 && *e1 == '.' && *e2 == '.' while (*e1 && *e2 && *e1 == '.' && *e2 == '.'
&& e1[1] && isdigit (e1[1]) && e2[1] && isdigit (e2[1])) && e1[1] && ISDIGIT (e1[1]) && e2[1] && ISDIGIT (e2[1]))
{ {
++e1; ++e1;
++e2; ++e2;
...@@ -2316,7 +2316,7 @@ libcompare (d1, d2) ...@@ -2316,7 +2316,7 @@ libcompare (d1, d2)
if (*e1) if (*e1)
{ {
/* It has a valid numeric extension, prefer this one. */ /* It has a valid numeric extension, prefer this one. */
if (*e1 == '.' && e1[1] && isdigit (e1[1])) if (*e1 == '.' && e1[1] && ISDIGIT (e1[1]))
return 1; return 1;
/* It has a invalid numeric extension, must prefer the other one. */ /* It has a invalid numeric extension, must prefer the other one. */
else else
...@@ -2325,7 +2325,7 @@ libcompare (d1, d2) ...@@ -2325,7 +2325,7 @@ libcompare (d1, d2)
else if (*e2) else if (*e2)
{ {
/* It has a valid numeric extension, prefer this one. */ /* It has a valid numeric extension, prefer this one. */
if (*e2 == '.' && e2[1] && isdigit (e2[1])) if (*e2 == '.' && e2[1] && ISDIGIT (e2[1]))
return -1; return -1;
/* It has a invalid numeric extension, must prefer the other one. */ /* It has a invalid numeric extension, must prefer the other one. */
else else
...@@ -2609,7 +2609,7 @@ scan_libraries (prog_name) ...@@ -2609,7 +2609,7 @@ scan_libraries (prog_name)
/* Find the end of the symbol name. */ /* Find the end of the symbol name. */
for (end = p; for (end = p;
(ch2 = *end) != '\0' && ch2 != '\n' && !isspace (ch2) && ch2 != '|'; (ch2 = *end) != '\0' && ch2 != '\n' && !ISSPACE (ch2) && ch2 != '|';
end++) end++)
continue; continue;
*end = '\0'; *end = '\0';
......
...@@ -4450,7 +4450,7 @@ rs6000_gen_section_name (buf, filename, section_desc) ...@@ -4450,7 +4450,7 @@ rs6000_gen_section_name (buf, filename, section_desc)
p += strlen (section_desc); p += strlen (section_desc);
} }
else if (isalnum (*q)) else if (ISALNUM (*q))
*p++ = *q; *p++ = *q;
} }
......
...@@ -463,7 +463,7 @@ quote_string (pfile, src) ...@@ -463,7 +463,7 @@ quote_string (pfile, src)
switch ((c = *src++)) switch ((c = *src++))
{ {
default: default:
if (isprint (c)) if (ISPRINT (c))
CPP_PUTC_Q (pfile, c); CPP_PUTC_Q (pfile, c);
else else
{ {
...@@ -2770,7 +2770,7 @@ macroexpand (pfile, hp) ...@@ -2770,7 +2770,7 @@ macroexpand (pfile, hp)
/* Escape these chars */ /* Escape these chars */
if (c == '\"' || (in_string && c == '\\')) if (c == '\"' || (in_string && c == '\\'))
CPP_PUTC (pfile, '\\'); CPP_PUTC (pfile, '\\');
if (isprint (c)) if (ISPRINT (c))
CPP_PUTC (pfile, c); CPP_PUTC (pfile, c);
else else
{ {
...@@ -3683,7 +3683,7 @@ do_line (pfile, keyword) ...@@ -3683,7 +3683,7 @@ do_line (pfile, keyword)
token = get_directive_token (pfile); token = get_directive_token (pfile);
if (token != CPP_NUMBER if (token != CPP_NUMBER
|| !isdigit(pfile->token_buffer[old_written])) || !ISDIGIT(pfile->token_buffer[old_written]))
{ {
cpp_error (pfile, "invalid format `#line' command"); cpp_error (pfile, "invalid format `#line' command");
goto bad_line_directive; goto bad_line_directive;
...@@ -4920,7 +4920,7 @@ cpp_get_token (pfile) ...@@ -4920,7 +4920,7 @@ cpp_get_token (pfile)
case '.': case '.':
NEWLINE_FIX; NEWLINE_FIX;
c2 = PEEKC (); c2 = PEEKC ();
if (isdigit(c2)) if (ISDIGIT(c2))
{ {
CPP_RESERVE(pfile, 2); CPP_RESERVE(pfile, 2);
CPP_PUTC_Q (pfile, '.'); CPP_PUTC_Q (pfile, '.');
......
...@@ -956,13 +956,13 @@ inf_scan_ident (s, c) ...@@ -956,13 +956,13 @@ inf_scan_ident (s, c)
int c; int c;
{ {
s->ptr = s->base; s->ptr = s->base;
if (isalpha (c) || c == '_') if (ISALPHA (c) || c == '_')
{ {
for (;;) for (;;)
{ {
SSTRING_PUT (s, c); SSTRING_PUT (s, c);
c = INF_GET (); c = INF_GET ();
if (c == EOF || !(isalnum (c) || c == '_')) if (c == EOF || !(ISALNUM (c) || c == '_'))
break; break;
} }
} }
...@@ -1273,7 +1273,7 @@ main (argc, argv) ...@@ -1273,7 +1273,7 @@ main (argc, argv)
c = INF_GET (); c = INF_GET ();
if (c == EOF) if (c == EOF)
break; break;
if (isalpha (c) || c == '_') if (ISALPHA (c) || c == '_')
{ {
c = inf_scan_ident (&buf, c); c = inf_scan_ident (&buf, c);
(void) INF_UNGET (c); (void) INF_UNGET (c);
......
...@@ -2768,21 +2768,21 @@ process_command (argc, argv) ...@@ -2768,21 +2768,21 @@ process_command (argc, argv)
char *v = compiler_version; char *v = compiler_version;
/* Ignore leading non-digits. i.e. "foo-" in "foo-2.7.2". */ /* Ignore leading non-digits. i.e. "foo-" in "foo-2.7.2". */
while (! isdigit (*v)) while (! ISDIGIT (*v))
v++; v++;
if (v > compiler_version && v[-1] != '-') if (v > compiler_version && v[-1] != '-')
fatal ("invalid version number format"); fatal ("invalid version number format");
/* Set V after the first period. */ /* Set V after the first period. */
while (isdigit (*v)) while (ISDIGIT (*v))
v++; v++;
if (*v != '.') if (*v != '.')
fatal ("invalid version number format"); fatal ("invalid version number format");
v++; v++;
while (isdigit (*v)) while (ISDIGIT (*v))
v++; v++;
if (*v != 0 && *v != ' ' && *v != '.' && *v != '-') if (*v != 0 && *v != ' ' && *v != '.' && *v != '-')
......
...@@ -109,7 +109,7 @@ parse_fn_proto (start, end, fn) ...@@ -109,7 +109,7 @@ parse_fn_proto (start, end, fn)
ptr--; ptr--;
while (*ptr == ' ' || *ptr == '\t') ptr--; while (*ptr == ' ' || *ptr == '\t') ptr--;
if (!isalnum (*ptr)) if (!ISALNUM (*ptr))
{ {
if (verbose) if (verbose)
fprintf (stderr, "%s: Can't handle this complex prototype: %s\n", fprintf (stderr, "%s: Can't handle this complex prototype: %s\n",
...@@ -118,7 +118,7 @@ parse_fn_proto (start, end, fn) ...@@ -118,7 +118,7 @@ parse_fn_proto (start, end, fn)
} }
name_end = ptr+1; name_end = ptr+1;
while (isalnum (*ptr) || *ptr == '_') --ptr; while (ISALNUM (*ptr) || *ptr == '_') --ptr;
name_start = ptr+1; name_start = ptr+1;
while (*ptr == ' ' || *ptr == '\t') ptr--; while (*ptr == ' ' || *ptr == '\t') ptr--;
ptr[1] = 0; ptr[1] = 0;
......
...@@ -165,7 +165,7 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) ...@@ -165,7 +165,7 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
char *cp; char *cp;
for (cp = argv[i]; *cp; cp++) for (cp = argv[i]; *cp; cp++)
{ {
if (*cp == '"' || *cp == '\'' || *cp == '\\' || isspace (*cp)) if (*cp == '"' || *cp == '\'' || *cp == '\\' || ISSPACE (*cp))
fputc ('\\', argfile); fputc ('\\', argfile);
fputc (*cp, argfile); fputc (*cp, argfile);
} }
......
...@@ -845,7 +845,7 @@ static int ...@@ -845,7 +845,7 @@ static int
is_id_char (ch) is_id_char (ch)
char ch; char ch;
{ {
return (isalnum (ch) || (ch == '_') || (ch == '$')); return (ISALNUM (ch) || (ch == '_') || (ch == '$'));
} }
/* Give a message indicating the proper way to invoke this program and then /* Give a message indicating the proper way to invoke this program and then
...@@ -2021,12 +2021,12 @@ munge_compile_params (params_list) ...@@ -2021,12 +2021,12 @@ munge_compile_params (params_list)
temp_params[param_count++] = compiler_file_name; temp_params[param_count++] = compiler_file_name;
for (;;) for (;;)
{ {
while (isspace (*params_list)) while (ISSPACE (*params_list))
params_list++; params_list++;
if (!*params_list) if (!*params_list)
break; break;
param = params_list; param = params_list;
while (*params_list && !isspace (*params_list)) while (*params_list && !ISSPACE (*params_list))
params_list++; params_list++;
if (param[0] != '-') if (param[0] != '-')
temp_params[param_count++] temp_params[param_count++]
...@@ -2041,9 +2041,9 @@ munge_compile_params (params_list) ...@@ -2041,9 +2041,9 @@ munge_compile_params (params_list)
case 'c': case 'c':
break; /* Don't copy these. */ break; /* Don't copy these. */
case 'o': case 'o':
while (isspace (*params_list)) while (ISSPACE (*params_list))
params_list++; params_list++;
while (*params_list && !isspace (*params_list)) while (*params_list && !ISSPACE (*params_list))
params_list++; params_list++;
break; break;
default: default:
...@@ -2974,7 +2974,7 @@ static const char * ...@@ -2974,7 +2974,7 @@ static const char *
forward_to_next_token_char (ptr) forward_to_next_token_char (ptr)
const char *ptr; const char *ptr;
{ {
for (++ptr; isspace (*ptr); check_source (++ptr < clean_text_limit, 0)) for (++ptr; ISSPACE (*ptr); check_source (++ptr < clean_text_limit, 0))
continue; continue;
return ptr; return ptr;
} }
...@@ -3342,7 +3342,7 @@ edit_formals_lists (end_formals, f_list_count, def_dec_p) ...@@ -3342,7 +3342,7 @@ edit_formals_lists (end_formals, f_list_count, def_dec_p)
next_end = start_formals - 1; next_end = start_formals - 1;
check_source (next_end > clean_read_ptr, 0); check_source (next_end > clean_read_ptr, 0);
while (isspace (*next_end)) while (ISSPACE (*next_end))
check_source (--next_end > clean_read_ptr, 0); check_source (--next_end > clean_read_ptr, 0);
check_source (*next_end == ')', next_end); check_source (*next_end == ')', next_end);
check_source (--next_end > clean_read_ptr, 0); check_source (--next_end > clean_read_ptr, 0);
...@@ -3362,7 +3362,7 @@ edit_formals_lists (end_formals, f_list_count, def_dec_p) ...@@ -3362,7 +3362,7 @@ edit_formals_lists (end_formals, f_list_count, def_dec_p)
const char *func_name_limit; const char *func_name_limit;
size_t func_name_len; size_t func_name_len;
for (func_name_limit = start_formals-1; isspace (*func_name_limit); ) for (func_name_limit = start_formals-1; ISSPACE (*func_name_limit); )
check_source (--func_name_limit > clean_read_ptr, 0); check_source (--func_name_limit > clean_read_ptr, 0);
for (func_name_start = func_name_limit++; for (func_name_start = func_name_limit++;
...@@ -3458,8 +3458,8 @@ find_rightmost_formals_list (clean_text_p) ...@@ -3458,8 +3458,8 @@ find_rightmost_formals_list (clean_text_p)
while (*end_formals != ')') while (*end_formals != ')')
{ {
if (isspace (*end_formals)) if (ISSPACE (*end_formals))
while (isspace (*end_formals)) while (ISSPACE (*end_formals))
check_source (--end_formals > clean_read_ptr, 0); check_source (--end_formals > clean_read_ptr, 0);
else else
check_source (--end_formals > clean_read_ptr, 0); check_source (--end_formals > clean_read_ptr, 0);
...@@ -3488,8 +3488,8 @@ find_rightmost_formals_list (clean_text_p) ...@@ -3488,8 +3488,8 @@ find_rightmost_formals_list (clean_text_p)
while (*end_formals != ')') while (*end_formals != ')')
{ {
if (isspace (*end_formals)) if (ISSPACE (*end_formals))
while (isspace (*end_formals)) while (ISSPACE (*end_formals))
check_source (--end_formals > clean_read_ptr, 0); check_source (--end_formals > clean_read_ptr, 0);
else else
check_source (--end_formals > clean_read_ptr, 0); check_source (--end_formals > clean_read_ptr, 0);
...@@ -3507,7 +3507,7 @@ find_rightmost_formals_list (clean_text_p) ...@@ -3507,7 +3507,7 @@ find_rightmost_formals_list (clean_text_p)
by an alphabetic character, while others *cannot* validly be followed by an alphabetic character, while others *cannot* validly be followed
by such characters. */ by such characters. */
if ((ch == '{') || isalpha (ch)) if ((ch == '{') || ISALPHA (ch))
break; break;
/* At this point, we have found a right paren, but we know that it is /* At this point, we have found a right paren, but we know that it is
...@@ -3603,7 +3603,7 @@ add_local_decl (def_dec_p, clean_text_p) ...@@ -3603,7 +3603,7 @@ add_local_decl (def_dec_p, clean_text_p)
We can now just scan backwards and find the left end of the existing We can now just scan backwards and find the left end of the existing
indentation string, and then copy it to the output buffer. */ indentation string, and then copy it to the output buffer. */
for (sp = ep; isspace (*sp) && *sp != '\n'; sp--) for (sp = ep; ISSPACE (*sp) && *sp != '\n'; sp--)
continue; continue;
/* Now write out the open { which began this block, and any following /* Now write out the open { which began this block, and any following
...@@ -3684,7 +3684,7 @@ add_global_decls (file_p, clean_text_p) ...@@ -3684,7 +3684,7 @@ add_global_decls (file_p, clean_text_p)
header. We will put in the added declarations just prior to that. */ header. We will put in the added declarations just prior to that. */
scan_p++; scan_p++;
while (isspace (*scan_p)) while (ISSPACE (*scan_p))
scan_p++; scan_p++;
scan_p--; scan_p--;
...@@ -3853,7 +3853,7 @@ edit_fn_definition (def_dec_p, clean_text_p) ...@@ -3853,7 +3853,7 @@ edit_fn_definition (def_dec_p, clean_text_p)
{ {
have_newlines |= (*scan_orig == '\n'); have_newlines |= (*scan_orig == '\n');
/* Leave identical whitespace alone. */ /* Leave identical whitespace alone. */
if (!isspace (*scan_orig)) if (!ISSPACE (*scan_orig))
*((NONCONST char *)scan_orig) = ' '; /* identical - so whiteout */ *((NONCONST char *)scan_orig) = ' '; /* identical - so whiteout */
} }
else else
...@@ -3897,7 +3897,7 @@ do_cleaning (new_clean_text_base, new_clean_text_limit) ...@@ -3897,7 +3897,7 @@ do_cleaning (new_clean_text_base, new_clean_text_limit)
scan_p += 2; scan_p += 2;
while (scan_p[1] != '/' || scan_p[0] != '*') while (scan_p[1] != '/' || scan_p[0] != '*')
{ {
if (!isspace (*scan_p)) if (!ISSPACE (*scan_p))
*scan_p = ' '; *scan_p = ' ';
if (++scan_p >= new_clean_text_limit) if (++scan_p >= new_clean_text_limit)
abort (); abort ();
...@@ -3912,7 +3912,7 @@ do_cleaning (new_clean_text_base, new_clean_text_limit) ...@@ -3912,7 +3912,7 @@ do_cleaning (new_clean_text_base, new_clean_text_limit)
*scan_p = ' '; *scan_p = ' ';
while (scan_p[1] != '\n' || scan_p[0] == '\\') while (scan_p[1] != '\n' || scan_p[0] == '\\')
{ {
if (!isspace (*scan_p)) if (!ISSPACE (*scan_p))
*scan_p = ' '; *scan_p = ' ';
if (++scan_p >= new_clean_text_limit) if (++scan_p >= new_clean_text_limit)
abort (); abort ();
...@@ -3924,9 +3924,9 @@ do_cleaning (new_clean_text_base, new_clean_text_limit) ...@@ -3924,9 +3924,9 @@ do_cleaning (new_clean_text_base, new_clean_text_limit)
non_whitespace_since_newline = 1; non_whitespace_since_newline = 1;
while (scan_p[1] != '\'' || scan_p[0] == '\\') while (scan_p[1] != '\'' || scan_p[0] == '\\')
{ {
if (scan_p[0] == '\\' && !isspace (scan_p[1])) if (scan_p[0] == '\\' && !ISSPACE (scan_p[1]))
scan_p[1] = ' '; scan_p[1] = ' ';
if (!isspace (*scan_p)) if (!ISSPACE (*scan_p))
*scan_p = ' '; *scan_p = ' ';
if (++scan_p >= new_clean_text_limit) if (++scan_p >= new_clean_text_limit)
abort (); abort ();
...@@ -3938,14 +3938,14 @@ do_cleaning (new_clean_text_base, new_clean_text_limit) ...@@ -3938,14 +3938,14 @@ do_cleaning (new_clean_text_base, new_clean_text_limit)
non_whitespace_since_newline = 1; non_whitespace_since_newline = 1;
while (scan_p[1] != '"' || scan_p[0] == '\\') while (scan_p[1] != '"' || scan_p[0] == '\\')
{ {
if (scan_p[0] == '\\' && !isspace (scan_p[1])) if (scan_p[0] == '\\' && !ISSPACE (scan_p[1]))
scan_p[1] = ' '; scan_p[1] = ' ';
if (!isspace (*scan_p)) if (!ISSPACE (*scan_p))
*scan_p = ' '; *scan_p = ' ';
if (++scan_p >= new_clean_text_limit) if (++scan_p >= new_clean_text_limit)
abort (); abort ();
} }
if (!isspace (*scan_p)) if (!ISSPACE (*scan_p))
*scan_p = ' '; *scan_p = ' ';
scan_p++; scan_p++;
break; break;
...@@ -4038,12 +4038,12 @@ scan_for_missed_items (file_p) ...@@ -4038,12 +4038,12 @@ scan_for_missed_items (file_p)
last_r_paren = scan_p; last_r_paren = scan_p;
for (ahead_p = scan_p + 1; isspace (*ahead_p); ) for (ahead_p = scan_p + 1; ISSPACE (*ahead_p); )
check_source (++ahead_p < limit, limit); check_source (++ahead_p < limit, limit);
scan_p = ahead_p - 1; scan_p = ahead_p - 1;
if (isalpha (*ahead_p) || *ahead_p == '{') if (ISALPHA (*ahead_p) || *ahead_p == '{')
{ {
const char *last_l_paren; const char *last_l_paren;
const int lineno = identify_lineno (ahead_p); const int lineno = identify_lineno (ahead_p);
...@@ -4057,7 +4057,7 @@ scan_for_missed_items (file_p) ...@@ -4057,7 +4057,7 @@ scan_for_missed_items (file_p)
do do
{ {
last_l_paren = careful_find_l_paren (last_r_paren); last_l_paren = careful_find_l_paren (last_r_paren);
for (last_r_paren = last_l_paren-1; isspace (*last_r_paren); ) for (last_r_paren = last_l_paren-1; ISSPACE (*last_r_paren); )
check_source (--last_r_paren >= backup_limit, backup_limit); check_source (--last_r_paren >= backup_limit, backup_limit);
} }
while (*last_r_paren == ')'); while (*last_r_paren == ')');
...@@ -4696,7 +4696,7 @@ main (argc, argv) ...@@ -4696,7 +4696,7 @@ main (argc, argv)
{ {
const char *cp; const char *cp;
for (cp = varargs_style_indicator; isalnum (*cp) || *cp == '_'; cp++) for (cp = varargs_style_indicator; ISALNUM (*cp) || *cp == '_'; cp++)
continue; continue;
if (*cp != 0) if (*cp != 0)
varargs_style_indicator = savestring (varargs_style_indicator, varargs_style_indicator = savestring (varargs_style_indicator,
......
...@@ -561,7 +561,7 @@ atoll(p) ...@@ -561,7 +561,7 @@ atoll(p)
int neg = 0; int neg = 0;
HOST_WIDE_INT tmp_wide; HOST_WIDE_INT tmp_wide;
while (isspace(*p)) while (ISSPACE(*p))
p++; p++;
if (*p == '-') if (*p == '-')
neg = 1, p++; neg = 1, p++;
...@@ -569,7 +569,7 @@ atoll(p) ...@@ -569,7 +569,7 @@ atoll(p)
p++; p++;
tmp_wide = 0; tmp_wide = 0;
while (isdigit(*p)) while (ISDIGIT(*p))
{ {
HOST_WIDE_INT new_wide = tmp_wide*10 + (*p - '0'); HOST_WIDE_INT new_wide = tmp_wide*10 + (*p - '0');
if (new_wide < tmp_wide) if (new_wide < tmp_wide)
......
...@@ -65,13 +65,13 @@ scan_ident (fp, s, c) ...@@ -65,13 +65,13 @@ scan_ident (fp, s, c)
int c; int c;
{ {
s->ptr = s->base; s->ptr = s->base;
if (isalpha(c) || c == '_') if (ISALPHA(c) || c == '_')
{ {
for (;;) for (;;)
{ {
SSTRING_PUT(s, c); SSTRING_PUT(s, c);
c = getc (fp); c = getc (fp);
if (c == EOF || !(isalnum(c) || c == '_')) if (c == EOF || !(ISALNUM(c) || c == '_'))
break; break;
} }
} }
...@@ -210,18 +210,18 @@ get_token (fp, s) ...@@ -210,18 +210,18 @@ get_token (fp, s)
} }
if (c == EOF) if (c == EOF)
return EOF; return EOF;
if (isdigit (c)) if (ISDIGIT (c))
{ {
do do
{ {
SSTRING_PUT(s, c); SSTRING_PUT(s, c);
c = getc (fp); c = getc (fp);
} while (c != EOF && isdigit(c)); } while (c != EOF && ISDIGIT(c));
ungetc (c, fp); ungetc (c, fp);
c = INT_TOKEN; c = INT_TOKEN;
goto done; goto done;
} }
if (isalpha (c) || c == '_') if (ISALPHA (c) || c == '_')
{ {
c = scan_ident (fp, s, c); c = scan_ident (fp, s, c);
ungetc (c, fp); ungetc (c, fp);
......
...@@ -5055,11 +5055,11 @@ estimate_case_costs (node) ...@@ -5055,11 +5055,11 @@ estimate_case_costs (node)
for (i = 0; i < 128; i++) for (i = 0; i < 128; i++)
{ {
if (isalnum (i)) if (ISALNUM (i))
cost_table[i] = 16; cost_table[i] = 16;
else if (ispunct (i)) else if (ISPUNCT (i))
cost_table[i] = 8; cost_table[i] = 8;
else if (iscntrl (i)) else if (ISCNTRL (i))
cost_table[i] = -1; cost_table[i] = -1;
} }
......
...@@ -530,13 +530,13 @@ scan_linker_output (fname) ...@@ -530,13 +530,13 @@ scan_linker_output (fname)
symbol *sym; symbol *sym;
int end; int end;
while (*p && isspace (*p)) while (*p && ISSPACE (*p))
++p; ++p;
if (! *p) if (! *p)
continue; continue;
for (q = p; *q && ! isspace (*q); ++q) for (q = p; *q && ! ISSPACE (*q); ++q)
; ;
/* Try the first word on the line. */ /* Try the first word on the line. */
......
...@@ -1344,7 +1344,7 @@ v_message_with_decl (decl, prefix, s, ap) ...@@ -1344,7 +1344,7 @@ v_message_with_decl (decl, prefix, s, ap)
while (*p) while (*p)
{ {
++p; ++p;
if (isalpha (*(p - 1) & 0xFF)) if (ISALPHA (*(p - 1) & 0xFF))
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment