* 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
+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>
* config/mips/r3900.h (SUBTARGET_ASM_DEBUGGING_SPEC) :
suppressed = *format_chars == '*';
if (suppressed)
++format_chars;
- while (isdigit (*format_chars))
+ while (ISDIGIT (*format_chars))
++format_chars;
}
else if (info->format_type == strftime_format_type)
flag_chars[i] = 0;
}
}
- while (isdigit ((unsigned char) *format_chars))
+ while (ISDIGIT ((unsigned char) *format_chars))
{
wide = TRUE;
++format_chars;
}
else
{
- while (isdigit (*format_chars))
+ while (ISDIGIT (*format_chars))
{
wide = TRUE;
++format_chars;
{
precise = TRUE;
++format_chars;
- if (*format_chars != '*' && !isdigit (*format_chars))
+ if (*format_chars != '*' && !ISDIGIT (*format_chars))
warning ("`.' not followed by `*' or digit in format");
/* "...a...precision...may be indicated by an asterisk.
In this case, an int argument supplies the...precision." */
}
else
{
- while (isdigit (*format_chars))
+ while (ISDIGIT (*format_chars))
++format_chars;
}
}
case '$':
letter:
p = token_buffer;
- while (isalnum (c) || c == '_' || c == '$' || c == '@')
+ while (ISALNUM (c) || c == '_' || c == '$' || c == '@')
{
/* Make sure this char really belongs in an identifier. */
if (c == '@' && ! doing_objc_thang)
next_c = GETC ();
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';
yylval.ttype = (c == '0') ? integer_zero_node : integer_one_node;
/* Read all the digits-and-decimal-points. */
while (c == '.'
- || (isalnum (c) && c != 'l' && c != 'L'
+ || (ISALNUM (c) && c != 'l' && c != 'L'
&& c != 'u' && c != 'U'
&& c != 'i' && c != 'I' && c != 'j' && c != 'J'
&& (floatflag == NOT_FLOAT || ((c != 'f') && (c != 'F')))))
only when it is followed by a digit.
Otherwise, unread the following non-digit
and use the '.' as a structural token. */
- if (p == token_buffer + 2 && !isdigit (c))
+ if (p == token_buffer + 2 && !ISDIGIT (c))
{
if (c == '.')
{
/* It is not a decimal point.
It should be a digit (perhaps a hex digit). */
- if (isdigit (c))
+ if (ISDIGIT (c))
{
c = c - '0';
}
*p++ = c;
c = GETC();
}
- if (! isdigit (c))
+ if (! ISDIGIT (c))
error ("floating constant exponent has no digits");
- while (isdigit (c))
+ while (ISDIGIT (c))
{
if (p >= token_buffer + maxtoken - 3)
p = extend_token_buffer (p);
UNGETC (c);
*p = 0;
- if (isalnum (c) || c == '.' || c == '_' || c == '$'
+ if (ISALNUM (c) || c == '.' || c == '_' || c == '$'
|| (!flag_traditional && (c == '-' || c == '+')
&& (p[-1] == 'e' || p[-1] == 'E')))
error ("missing white space after number `%s'", token_buffer);
&& (unsigned) c >= (1 << width))
pedwarn ("escape sequence out of range for character");
#ifdef MAP_CHARACTER
- if (isprint (c))
+ if (ISPRINT (c))
c = MAP_CHARACTER (c);
#endif
}
if (*vers == 'V')
vers++;
- if (isdigit (*vers))
+ if (ISDIGIT (*vers))
{
vms_version_value = (*vers - '0') * 10000000;
}
if (*vers == '.')
{
vers++;
- if (isdigit (*vers))
+ if (ISDIGIT (*vers))
{
vms_version_value += (*vers - '0') * 100000;
}
if ((linsize >= 7) && !bcmp (ibp, "VARARGS", 7)) {
*cmdlen = 7;
ibp += 7; linsize -= 7;
- if ((linsize == 0) || ! isdigit (*ibp)) return "VARARGS";
+ if ((linsize == 0) || ! ISDIGIT (*ibp)) return "VARARGS";
/* OK, read a number */
- for (numptr = *argstart = ibp; (numptr < limit) && isdigit (*numptr);
+ for (numptr = *argstart = ibp; (numptr < limit) && ISDIGIT (*numptr);
numptr++);
*arglen = numptr - *argstart;
return "VARARGS";
* code from case '<' is repeated here) and generates a warning.
* (Note: macro expansion of `xyz' takes precedence.)
*/
- if (retried && isalpha(*(U_CHAR *) (--fbeg))) {
- while (fin != limit && (!isspace(*fin)))
+ /* Note: The argument of ISALPHA() can be evaluated twice, so do
+ the pre-decrement outside of the macro. */
+ if (retried && (--fbeg, ISALPHA(*(U_CHAR *) (fbeg)))) {
+ while (fin != limit && (!ISSPACE(*fin)))
*fend++ = *fin++;
warning ("VAX-C-style include specification found, use '#include <filename.h>' !");
vaxc_include = 1;
char *s = fname;
char *p;
#if defined (__MSDOS__) || defined (_WIN32)
- if (isalpha (s[0]) && s[1] == ':') s += 2;
+ if (ISALPHA (s[0]) && s[1] == ':') s += 2;
#endif
#ifdef VMS
if ((p = rindex (s, ':'))) s = p + 1; /* Skip device. */
char *filename;
{
#if defined (__MSDOS__) || (defined (_WIN32) && !defined (__CYGWIN32__))
- if (isalpha (filename[0]) && filename[1] == ':') filename += 2;
+ if (ISALPHA (filename[0]) && filename[1] == ':') filename += 2;
#endif
#if defined (__CYGWIN32__)
/* 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
if (filename[0] == '/') return 1;
#ifdef DIR_SEPARATOR
bp = tem.buf;
SKIP_WHITE_SPACE (bp);
- if (!isdigit (*bp)) {
+ if (!ISDIGIT (*bp)) {
error ("invalid format `#line' directive");
return 0;
}
pedwarn ("line number out of range in `#line' directive");
/* skip over the line number. */
- while (isdigit (*bp))
+ while (ISDIGIT (*bp))
bp++;
#if 0 /* #line 10"foo.c" is supposed to be allowed. */
HASHNODE *hp;
if (! traditional) {
- if (isdigit (buf[0]))
+ if (ISDIGIT (buf[0]))
pedwarn ("`#%s' argument starts with a digit", keyword->name);
else if (end != limit)
pedwarn ("garbage at end of `#%s' argument", keyword->name);
switch ((c = *src++))
{
default:
- if (isprint (c))
+ if (ISPRINT (c))
*dst++ = c;
else
{
{
int c;
while (c = getc (stream),
- c != EOF && (isalnum (c) || c == '_' || c == '$' || c == '.'))
+ c != EOF && (ISALNUM (c) || c == '_' || c == '$' || c == '.'))
obstack_1grow (&temporary_obstack, c);
if (obstack_object_size (&temporary_obstack) > 0)
{
strncpy (prefix, p, q - p);
prefix[q - p] = 0;
for (q = prefix; *q; q++)
- if (!isalnum (*q))
+ if (!ISALNUM (*q))
*q = '_';
if (debug)
fprintf (stderr, "\nwrite_c_file - output name is %s, prefix is %s\n",
name = p;
/* Find the end of the symbol name.
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++)
continue;
char *e2 = (*d2)->d_name + i2;
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;
++e2;
if (*e1)
{
/* 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;
/* It has a invalid numeric extension, must prefer the other one. */
else
else if (*e2)
{
/* 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;
/* It has a invalid numeric extension, must prefer the other one. */
else
/* Find the end of the symbol name. */
for (end = p;
- (ch2 = *end) != '\0' && ch2 != '\n' && !isspace (ch2) && ch2 != '|';
+ (ch2 = *end) != '\0' && ch2 != '\n' && !ISSPACE (ch2) && ch2 != '|';
end++)
continue;
*end = '\0';
p += strlen (section_desc);
}
- else if (isalnum (*q))
+ else if (ISALNUM (*q))
*p++ = *q;
}
switch ((c = *src++))
{
default:
- if (isprint (c))
+ if (ISPRINT (c))
CPP_PUTC_Q (pfile, c);
else
{
/* Escape these chars */
if (c == '\"' || (in_string && c == '\\'))
CPP_PUTC (pfile, '\\');
- if (isprint (c))
+ if (ISPRINT (c))
CPP_PUTC (pfile, c);
else
{
token = get_directive_token (pfile);
if (token != CPP_NUMBER
- || !isdigit(pfile->token_buffer[old_written]))
+ || !ISDIGIT(pfile->token_buffer[old_written]))
{
cpp_error (pfile, "invalid format `#line' command");
goto bad_line_directive;
case '.':
NEWLINE_FIX;
c2 = PEEKC ();
- if (isdigit(c2))
+ if (ISDIGIT(c2))
{
CPP_RESERVE(pfile, 2);
CPP_PUTC_Q (pfile, '.');
int c;
{
s->ptr = s->base;
- if (isalpha (c) || c == '_')
+ if (ISALPHA (c) || c == '_')
{
for (;;)
{
SSTRING_PUT (s, c);
c = INF_GET ();
- if (c == EOF || !(isalnum (c) || c == '_'))
+ if (c == EOF || !(ISALNUM (c) || c == '_'))
break;
}
}
c = INF_GET ();
if (c == EOF)
break;
- if (isalpha (c) || c == '_')
+ if (ISALPHA (c) || c == '_')
{
c = inf_scan_ident (&buf, c);
(void) INF_UNGET (c);
char *v = compiler_version;
/* Ignore leading non-digits. i.e. "foo-" in "foo-2.7.2". */
- while (! isdigit (*v))
+ while (! ISDIGIT (*v))
v++;
if (v > compiler_version && v[-1] != '-')
fatal ("invalid version number format");
/* Set V after the first period. */
- while (isdigit (*v))
+ while (ISDIGIT (*v))
v++;
if (*v != '.')
fatal ("invalid version number format");
v++;
- while (isdigit (*v))
+ while (ISDIGIT (*v))
v++;
if (*v != 0 && *v != ' ' && *v != '.' && *v != '-')
ptr--;
while (*ptr == ' ' || *ptr == '\t') ptr--;
- if (!isalnum (*ptr))
+ if (!ISALNUM (*ptr))
{
if (verbose)
fprintf (stderr, "%s: Can't handle this complex prototype: %s\n",
}
name_end = ptr+1;
- while (isalnum (*ptr) || *ptr == '_') --ptr;
+ while (ISALNUM (*ptr) || *ptr == '_') --ptr;
name_start = ptr+1;
while (*ptr == ' ' || *ptr == '\t') ptr--;
ptr[1] = 0;
char *cp;
for (cp = argv[i]; *cp; cp++)
{
- if (*cp == '"' || *cp == '\'' || *cp == '\\' || isspace (*cp))
+ if (*cp == '"' || *cp == '\'' || *cp == '\\' || ISSPACE (*cp))
fputc ('\\', argfile);
fputc (*cp, argfile);
}
is_id_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
temp_params[param_count++] = compiler_file_name;
for (;;)
{
- while (isspace (*params_list))
+ while (ISSPACE (*params_list))
params_list++;
if (!*params_list)
break;
param = params_list;
- while (*params_list && !isspace (*params_list))
+ while (*params_list && !ISSPACE (*params_list))
params_list++;
if (param[0] != '-')
temp_params[param_count++]
case 'c':
break; /* Don't copy these. */
case 'o':
- while (isspace (*params_list))
+ while (ISSPACE (*params_list))
params_list++;
- while (*params_list && !isspace (*params_list))
+ while (*params_list && !ISSPACE (*params_list))
params_list++;
break;
default:
forward_to_next_token_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;
return ptr;
}
next_end = start_formals - 1;
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 == ')', next_end);
check_source (--next_end > clean_read_ptr, 0);
const char *func_name_limit;
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);
for (func_name_start = func_name_limit++;
while (*end_formals != ')')
{
- if (isspace (*end_formals))
- while (isspace (*end_formals))
+ if (ISSPACE (*end_formals))
+ while (ISSPACE (*end_formals))
check_source (--end_formals > clean_read_ptr, 0);
else
check_source (--end_formals > clean_read_ptr, 0);
while (*end_formals != ')')
{
- if (isspace (*end_formals))
- while (isspace (*end_formals))
+ if (ISSPACE (*end_formals))
+ while (ISSPACE (*end_formals))
check_source (--end_formals > clean_read_ptr, 0);
else
check_source (--end_formals > clean_read_ptr, 0);
by an alphabetic character, while others *cannot* validly be followed
by such characters. */
- if ((ch == '{') || isalpha (ch))
+ if ((ch == '{') || ISALPHA (ch))
break;
/* At this point, we have found a right paren, but we know that it is
We can now just scan backwards and find the left end of the existing
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;
/* Now write out the open { which began this block, and any following
header. We will put in the added declarations just prior to that. */
scan_p++;
- while (isspace (*scan_p))
+ while (ISSPACE (*scan_p))
scan_p++;
scan_p--;
{
have_newlines |= (*scan_orig == '\n');
/* Leave identical whitespace alone. */
- if (!isspace (*scan_orig))
+ if (!ISSPACE (*scan_orig))
*((NONCONST char *)scan_orig) = ' '; /* identical - so whiteout */
}
else
scan_p += 2;
while (scan_p[1] != '/' || scan_p[0] != '*')
{
- if (!isspace (*scan_p))
+ if (!ISSPACE (*scan_p))
*scan_p = ' ';
if (++scan_p >= new_clean_text_limit)
abort ();
*scan_p = ' ';
while (scan_p[1] != '\n' || scan_p[0] == '\\')
{
- if (!isspace (*scan_p))
+ if (!ISSPACE (*scan_p))
*scan_p = ' ';
if (++scan_p >= new_clean_text_limit)
abort ();
non_whitespace_since_newline = 1;
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] = ' ';
- if (!isspace (*scan_p))
+ if (!ISSPACE (*scan_p))
*scan_p = ' ';
if (++scan_p >= new_clean_text_limit)
abort ();
non_whitespace_since_newline = 1;
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] = ' ';
- if (!isspace (*scan_p))
+ if (!ISSPACE (*scan_p))
*scan_p = ' ';
if (++scan_p >= new_clean_text_limit)
abort ();
}
- if (!isspace (*scan_p))
+ if (!ISSPACE (*scan_p))
*scan_p = ' ';
scan_p++;
break;
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);
scan_p = ahead_p - 1;
- if (isalpha (*ahead_p) || *ahead_p == '{')
+ if (ISALPHA (*ahead_p) || *ahead_p == '{')
{
const char *last_l_paren;
const int lineno = identify_lineno (ahead_p);
do
{
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);
}
while (*last_r_paren == ')');
{
const char *cp;
- for (cp = varargs_style_indicator; isalnum (*cp) || *cp == '_'; cp++)
+ for (cp = varargs_style_indicator; ISALNUM (*cp) || *cp == '_'; cp++)
continue;
if (*cp != 0)
varargs_style_indicator = savestring (varargs_style_indicator,
int neg = 0;
HOST_WIDE_INT tmp_wide;
- while (isspace(*p))
+ while (ISSPACE(*p))
p++;
if (*p == '-')
neg = 1, p++;
p++;
tmp_wide = 0;
- while (isdigit(*p))
+ while (ISDIGIT(*p))
{
HOST_WIDE_INT new_wide = tmp_wide*10 + (*p - '0');
if (new_wide < tmp_wide)
int c;
{
s->ptr = s->base;
- if (isalpha(c) || c == '_')
+ if (ISALPHA(c) || c == '_')
{
for (;;)
{
SSTRING_PUT(s, c);
c = getc (fp);
- if (c == EOF || !(isalnum(c) || c == '_'))
+ if (c == EOF || !(ISALNUM(c) || c == '_'))
break;
}
}
}
if (c == EOF)
return EOF;
- if (isdigit (c))
+ if (ISDIGIT (c))
{
do
{
SSTRING_PUT(s, c);
c = getc (fp);
- } while (c != EOF && isdigit(c));
+ } while (c != EOF && ISDIGIT(c));
ungetc (c, fp);
c = INT_TOKEN;
goto done;
}
- if (isalpha (c) || c == '_')
+ if (ISALPHA (c) || c == '_')
{
c = scan_ident (fp, s, c);
ungetc (c, fp);
for (i = 0; i < 128; i++)
{
- if (isalnum (i))
+ if (ISALNUM (i))
cost_table[i] = 16;
- else if (ispunct (i))
+ else if (ISPUNCT (i))
cost_table[i] = 8;
- else if (iscntrl (i))
+ else if (ISCNTRL (i))
cost_table[i] = -1;
}
symbol *sym;
int end;
- while (*p && isspace (*p))
+ while (*p && ISSPACE (*p))
++p;
if (! *p)
continue;
- for (q = p; *q && ! isspace (*q); ++q)
+ for (q = p; *q && ! ISSPACE (*q); ++q)
;
/* Try the first word on the line. */
while (*p)
{
++p;
- if (isalpha (*(p - 1) & 0xFF))
+ if (ISALPHA (*(p - 1) & 0xFF))
break;
}
}