This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: ctype.h replacement
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch: ctype.h replacement
- From: "Zack Weinberg" <zackw at stanford dot edu>
- Date: Mon, 27 Nov 2000 09:44:28 -0800
It's been reported that in order to do message translation safely, we
have to use setlocale(LC_ALL), which will change the behavior of the
<ctype.h> macros to be Not What We Want. So here is a patch which
implements a clone of <ctype.h> in libiberty. All the C99 classes are
present, plus four extra ones that cpplib wants. This enables the
removal of a surprising amount of gunk in system.h, cpplib, and
tradcpp.
I've validated the table against glibc's ctype.h in the "C" locale.
The S/390 people need to write table variants for EBCDIC; I tried to
do that but gave up when I discovered how many different character
encodings are called "EBCDIC."
Note that the downcasing of all the ISXXX macros was done by a script
and I haven't read through that part of the patch very thoroughly.
Bootstrapped i686-linux. OK to apply?
zw
include:
* safe-ctype.h: New file.
libiberty:
* safe-ctype.c: New file.
* Makefile.in (CFILES): Add safe-ctype.c.
(REQUIRED_OFILES): Add safe-ctype.o.
gcc:
* cpphash.h: Remove IS* macros. Define only is_* macros not
defined by safe-ctype.h. Don't declare _cpp_IStable.
* cppinit.c: Remove _cpp_IStable initializer and related gunk.
* tradcpp.c: Remove initialize_char_syntax and is_idchar,
is_idstart, is_hor_space, is_space tables. Use safe-ctype.h
macros instead.
* tradcpp.h: Define is_idchar and is_idstart in terms of
safe-ctype.h macros.
* tradcif.y: is_idchar/is_idstart are now macros, not arrays.
* system.h: Include ctype.h or safe-ctype.h depending on
whether or not GENERATOR_FILE is defined. Remove
IN_CTYPE_DOMAIN and all ISXXX, TOXXX macros.
* c-common.c, c-lex.c, c-parse.in, collect2.c, cppexp.c,
cppfiles.c, cpplib.c, cppmacro.c, defaults.h, diagnostic.c,
doprint.c, dwarf2out.c, final.c, fix-header.c, fold-const.c,
gcc.c, gen-protos.c, genattr.c, genattrtab.c, genemit.c,
genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c,
genrecog.c, gensupport.c, mips-tfile.c, mkdeps.c, optabs.c,
protoize.c, recog.c, rtl.c, scan.c, stmt.c, tlink.c, tree.c,
alpha.c, c4x.c, i370.h, mips.c, pj.c, rs6000.c, v850.c,
fixinc/fixincl.c, fixinc/server.c:
Downcase ISXXX and TOXXX macros.
* fixinc/fixlib.h: Define GENERATOR_FILE.
gcc/ch:
* lex.c: Downcase ISXXX and TOXXX macros.
gcc/cp:
* error.c, lex.c, method.c, spew.c, xref.c: Downcase ISXXX and
TOXXX macros.
gcc/f:
* bad.c, expr.c, fini.c, implic.c, intrin.c, lex.c, lex.h,
proj.c, src.c, src.h, stb.c, target.c, top.c: Downcase ISXXX
and TOXXX macros.
* intrin.c: Don't use IN_CTYPE_DOMAIN.
gcc/java:
* class.c, jcf-dump.c, typeck.c: Downcase ISXXX and TOXXX macros.
* jvgenmain.c: Change isascii to isprint.
===================================================================
Index: gcc/c-common.c
--- gcc/c-common.c 2000/11/27 05:00:05 1.195
+++ gcc/c-common.c 2000/11/27 17:27:40
@@ -2696,7 +2696,7 @@ check_format_info_main (status, res, inf
because 0 is a flag. */
int non_zero_width_char = FALSE;
int found_width = FALSE;
- while (ISDIGIT (*format_chars))
+ while (isdigit (*format_chars))
{
found_width = TRUE;
if (*format_chars != '0')
@@ -2775,7 +2775,7 @@ check_format_info_main (status, res, inf
}
else
{
- while (ISDIGIT (*format_chars))
+ while (isdigit (*format_chars))
++format_chars;
}
}
@@ -2872,7 +2872,7 @@ check_format_info_main (status, res, inf
++fci;
if (fci->format_chars == 0)
{
- if (ISGRAPH(format_char))
+ if (isgraph(format_char))
status_warning (status, "unknown conversion type character `%c' in format",
format_char);
else
===================================================================
Index: gcc/c-lex.c
--- gcc/c-lex.c 2000/11/27 08:00:03 1.118
+++ gcc/c-lex.c 2000/11/27 17:27:41
@@ -361,7 +361,7 @@ read_ucs (p, limit, cptr, length)
}
c = *p++;
- if (! ISXDIGIT (c))
+ if (! isxdigit (c))
{
error ("non hex digit '%c' in universal-character-name", c);
p--;
@@ -442,7 +442,7 @@ readescape (p, limit, cptr)
while (p < limit)
{
c = *p++;
- if (! ISXDIGIT (c))
+ if (! isxdigit (c))
{
p--;
break;
@@ -543,7 +543,7 @@ readescape (p, limit, cptr)
return p;
}
- if (ISGRAPH (c))
+ if (isgraph (c))
pedwarn ("unknown escape sequence '\\%c'", c);
else
pedwarn ("unknown escape sequence: '\\' followed by char 0x%x", c);
@@ -969,7 +969,7 @@ c_lex (value)
/* Issue this error here, where we can get at tok.val.c. */
case CPP_OTHER:
- if (ISGRAPH (tok.val.c))
+ if (isgraph (tok.val.c))
error ("stray '%c' in program", tok.val.c);
else
error ("stray '\\%#o' in program", tok.val.c);
@@ -1060,8 +1060,8 @@ lex_number (str, len)
base = 16;
p = str + 2;
}
- /* The ISDIGIT check is so we are not confused by a suffix on 0. */
- else if (str[0] == '0' && ISDIGIT (str[1]))
+ /* The isdigit check is so we are not confused by a suffix on 0. */
+ else if (str[0] == '0' && isdigit (str[1]))
{
base = 8;
p = str + 1;
@@ -1096,7 +1096,7 @@ lex_number (str, len)
/* It is not a decimal point.
It should be a digit (perhaps a hex digit). */
- if (ISDIGIT (c))
+ if (isdigit (c))
{
n = c - '0';
}
@@ -1183,11 +1183,11 @@ lex_number (str, len)
if (p < str + len && (c == '+' || c == '-'))
c = *p++;
/* Exponent is decimal, even if string is a hex float. */
- if (! ISDIGIT (c))
+ if (! isdigit (c))
ERROR ("floating constant exponent has no digits");
- while (p < str + len && ISDIGIT (c))
+ while (p < str + len && isdigit (c))
c = *p++;
- if (! ISDIGIT (c))
+ if (! isdigit (c))
p--;
}
@@ -1639,7 +1639,7 @@ lex_charconst (str, len, wide)
pedwarn ("escape sequence out of range for character");
}
#ifdef MAP_CHARACTER
- if (ISPRINT (c))
+ if (isprint (c))
c = MAP_CHARACTER (c);
#endif
===================================================================
Index: gcc/c-parse.in
--- gcc/c-parse.in 2000/11/26 10:48:49 1.73
+++ gcc/c-parse.in 2000/11/27 17:27:41
@@ -3152,7 +3152,7 @@ yyerror (msgid)
{
unsigned int val = TREE_INT_CST_LOW (yylval.ttype);
const char *ell = (last_token == CPP_CHAR) ? "" : "L";
- if (val <= UCHAR_MAX && ISGRAPH (val))
+ if (val <= UCHAR_MAX && isgraph (val))
error ("%s before %s'%c'", string, ell, val);
else
error ("%s before %s'\\x%x'", string, ell, val);
===================================================================
Index: gcc/collect2.c
--- gcc/collect2.c 2000/11/13 21:22:10 1.102
+++ gcc/collect2.c 2000/11/27 17:27:42
@@ -524,7 +524,7 @@ dump_file (name)
{
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)
{
@@ -1868,7 +1868,7 @@ write_c_file_stat (stream, name)
strncpy (prefix, p, q - p);
prefix[q - p] = 0;
for (r = prefix; *r; r++)
- if (!ISALNUM ((unsigned char)*r))
+ if (!isalnum ((unsigned char)*r))
*r = '_';
if (debug)
notice ("\nwrite_c_file - output name is %s, prefix is %s\n",
@@ -2172,7 +2172,7 @@ scan_prog_file (prog_name, which_pass)
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;
@@ -2312,7 +2312,7 @@ libcompare (d1, d2)
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;
@@ -2325,7 +2325,7 @@ libcompare (d1, d2)
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
@@ -2334,7 +2334,7 @@ libcompare (d1, d2)
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
@@ -2612,7 +2612,7 @@ scan_libraries (prog_name)
/* 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';
===================================================================
Index: gcc/cppexp.c
--- gcc/cppexp.c 2000/11/26 17:31:09 1.81
+++ gcc/cppexp.c 2000/11/27 17:27:42
@@ -398,7 +398,7 @@ lex (pfile, skip_evaluation, token)
SYNTAX_ERROR ("floating point numbers are not valid in #if");
case CPP_OTHER:
- if (ISGRAPH (token->val.c))
+ if (isgraph (token->val.c))
SYNTAX_ERROR2 ("invalid character '%c' in #if", token->val.c);
else
SYNTAX_ERROR2 ("invalid character '\\%03o' in #if", token->val.c);
===================================================================
Index: gcc/cppfiles.c
--- gcc/cppfiles.c 2000/11/27 08:00:03 1.86
+++ gcc/cppfiles.c 2000/11/27 17:27:42
@@ -1051,7 +1051,7 @@ _cpp_simplify_pathname (path)
if (*from == '\\') *from = '/';
/* Skip over leading drive letter if present. */
- if (ISALPHA (path[0]) && path[1] == ':')
+ if (isalpha (path[0]) && path[1] == ':')
from = to = &path[2];
else
from = to = path;
===================================================================
Index: gcc/cpphash.h
--- gcc/cpphash.h 2000/11/27 08:00:03 1.82
+++ gcc/cpphash.h 2000/11/27 17:27:42
@@ -150,39 +150,28 @@ struct cpp_buffer
unsigned char was_skipping;
};
-/* Character classes.
+/* Character classes. Based on the more primitive macros in safe-ctype.h.
If the definition of `numchar' looks odd to you, please look up the
definition of a pp-number in the C standard [section 6.4.8 of C99].
In the unlikely event that characters other than \r and \n enter
the set is_vspace, the macro handle_newline() in cpplex.c must be
updated. */
-#define ISidnum 0x01 /* a-zA-Z0-9_ */
-#define ISidstart 0x02 /* _a-zA-Z */
-#define ISnumstart 0x04 /* 0-9 */
-#define IShspace 0x08 /* ' ' \t */
-#define ISvspace 0x10 /* \r \n */
-#define ISspace 0x20 /* ' ' \t \r \n \f \v \0 */
-
#define _dollar_ok(x) ((x) == '$' && CPP_OPTION (pfile, dollars_in_ident))
-#define is_idchar(x) ((_cpp_IStable[x] & ISidnum) || _dollar_ok(x))
-#define is_idstart(x) ((_cpp_IStable[x] & ISidstart) || _dollar_ok(x))
-#define is_numchar(x) (_cpp_IStable[x] & ISidnum)
-#define is_numstart(x) (_cpp_IStable[x] & ISnumstart)
-#define is_hspace(x) (_cpp_IStable[x] & IShspace)
-#define is_vspace(x) (_cpp_IStable[x] & ISvspace)
-#define is_nvspace(x) ((_cpp_IStable[x] & (ISspace | ISvspace)) == ISspace)
-#define is_space(x) (_cpp_IStable[x] & ISspace)
+#define is_idchar(x) (isidnum(x) || _dollar_ok(x))
+#define is_numchar(x) isidnum(x)
+#define is_idstart(x) (isidst(x) || _dollar_ok(x))
+#define is_numstart(x) isdigit(x)
+#define is_hspace(x) isblank(x)
+/* is_vspace, is_nvspace, and is_space are defined by safe-ctype.h */
-/* These tables are constant if they can be initialized at compile time,
+/* This table is constant if it can be initialized at compile time,
which is the case if cpp was compiled with GCC >=2.7, or another
compiler that supports C99. */
#if HAVE_DESIGNATED_INITIALIZERS
-extern const unsigned char _cpp_IStable[UCHAR_MAX + 1];
extern const unsigned char _cpp_trigraph_map[UCHAR_MAX + 1];
#else
-extern unsigned char _cpp_IStable[UCHAR_MAX + 1];
extern unsigned char _cpp_trigraph_map[UCHAR_MAX + 1];
#endif
===================================================================
Index: gcc/cppinit.c
--- gcc/cppinit.c 2000/11/26 17:31:09 1.119
+++ gcc/cppinit.c 2000/11/27 17:27:42
@@ -124,9 +124,6 @@ enum { QUOTE = 0, BRACKET, SYSTEM, AFTER
runtime. */
#if HAVE_DESIGNATED_INITIALIZERS
-#define init_IStable() /* Nothing. */
-#define ISTABLE __extension__ const U_CHAR _cpp_IStable[UCHAR_MAX + 1] = {
-
#define init_trigraph_map() /* Nothing. */
#define TRIGRAPH_MAP \
__extension__ const U_CHAR _cpp_trigraph_map[UCHAR_MAX + 1] = {
@@ -136,10 +133,6 @@ __extension__ const U_CHAR _cpp_trigraph
#else
-#define ISTABLE unsigned char _cpp_IStable[UCHAR_MAX + 1] = { 0 }; \
- static void init_IStable PARAMS ((void)) { \
- unsigned char *x = _cpp_IStable;
-
#define TRIGRAPH_MAP U_CHAR _cpp_trigraph_map[UCHAR_MAX + 1] = { 0 }; \
static void init_trigraph_map PARAMS ((void)) { \
unsigned char *x = _cpp_trigraph_map;
@@ -149,45 +142,13 @@ __extension__ const U_CHAR _cpp_trigraph
#endif
-#define A(x) s(x, ISidnum|ISidstart)
-#define N(x) s(x, ISidnum|ISnumstart)
-#define H(x) s(x, IShspace|ISspace)
-#define V(x) s(x, ISvspace|ISspace)
-#define S(x) s(x, ISspace)
-
-ISTABLE
- A('_')
-
- A('a') A('b') A('c') A('d') A('e') A('f') A('g') A('h') A('i')
- A('j') A('k') A('l') A('m') A('n') A('o') A('p') A('q') A('r')
- A('s') A('t') A('u') A('v') A('w') A('x') A('y') A('z')
-
- A('A') A('B') A('C') A('D') A('E') A('F') A('G') A('H') A('I')
- A('J') A('K') A('L') A('M') A('N') A('O') A('P') A('Q') A('R')
- A('S') A('T') A('U') A('V') A('W') A('X') A('Y') A('Z')
-
- N('1') N('2') N('3') N('4') N('5') N('6') N('7') N('8') N('9') N('0')
-
- H(' ') H('\t')
-
- V('\n') V('\r')
-
- S('\0') S('\v') S('\f')
-END
-
TRIGRAPH_MAP
s('=', '#') s(')', ']') s('!', '|')
s('(', '[') s('\'', '^') s('>', '}')
s('/', '\\') s('<', '{') s('-', '~')
END
-#undef A
-#undef N
-#undef H
-#undef V
-#undef S
#undef s
-#undef ISTABLE
#undef END
#undef TRIGRAPH_MAP
@@ -417,7 +378,6 @@ cpp_init ()
anything if we were compiled with a compiler that supports C99
designated initializers. */
init_trigraph_map ();
- init_IStable ();
cpp_init_completed = 1;
}
===================================================================
Index: gcc/cpplib.c
--- gcc/cpplib.c 2000/11/27 08:00:03 1.223
+++ gcc/cpplib.c 2000/11/27 17:27:42
@@ -701,7 +701,7 @@ strtoul_for_line (str, len, nump)
while (len--)
{
c = *str++;
- if (!ISDIGIT (c))
+ if (!isdigit (c))
return 1;
reg *= 10;
reg += c - '0';
===================================================================
Index: gcc/cppmacro.c
--- gcc/cppmacro.c 2000/11/26 19:30:27 1.30
+++ gcc/cppmacro.c 2000/11/27 17:27:42
@@ -278,7 +278,7 @@ quote_string (dest, src, len)
}
else
{
- if (ISPRINT (c))
+ if (isprint (c))
*dest++ = c;
else
{
===================================================================
Index: gcc/defaults.h
--- gcc/defaults.h 2000/11/17 01:52:43 1.26
+++ gcc/defaults.h 2000/11/27 17:27:42
@@ -84,7 +84,7 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNA
register int c = p[i]; \
if (c == '\"' || c == '\\') \
putc ('\\', asm_out_file); \
- if (ISPRINT(c)) \
+ if (isprint(c)) \
putc (c, asm_out_file); \
else \
{ \
@@ -94,7 +94,7 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNA
The Vax assembler fails to stop reading the escape \
after three digits, so this is the only way we \
can get it to parse the data properly. */ \
- if (i < thissize - 1 && ISDIGIT(p[i + 1])) \
+ if (i < thissize - 1 && isdigit(p[i + 1])) \
fprintf (asm_out_file, "\"\n\t.ascii \""); \
} \
} \
===================================================================
Index: gcc/diagnostic.c
--- gcc/diagnostic.c 2000/11/17 06:05:14 1.44
+++ gcc/diagnostic.c 2000/11/27 17:27:43
@@ -945,7 +945,7 @@ format_with_decl (buffer, decl)
while (*p)
{
++p;
- if (ISALPHA (*(p - 1) & 0xFF))
+ if (isalpha (*(p - 1) & 0xFF))
break;
}
}
===================================================================
Index: gcc/doprint.c
--- gcc/doprint.c 2000/01/14 00:46:57 1.9
+++ gcc/doprint.c 2000/11/27 17:27:43
@@ -86,7 +86,7 @@ _doprnt (format, ap, stream)
if (*ptr == '*')
COPY_VA_INT;
else
- while (ISDIGIT(*ptr)) /* Handle explicit numeric value. */
+ while (isdigit(*ptr)) /* Handle explicit numeric value. */
*sptr++ = *ptr++;
if (*ptr == '.')
@@ -95,7 +95,7 @@ _doprnt (format, ap, stream)
if (*ptr == '*')
COPY_VA_INT;
else
- while (ISDIGIT(*ptr)) /* Handle explicit numeric value. */
+ while (isdigit(*ptr)) /* Handle explicit numeric value. */
*sptr++ = *ptr++;
}
while (strchr ("hlL", *ptr))
===================================================================
Index: gcc/dwarf2out.c
--- gcc/dwarf2out.c 2000/11/26 19:12:18 1.223
+++ gcc/dwarf2out.c 2000/11/27 17:27:44
@@ -541,7 +541,7 @@ static void def_cfa_1 PARAMS ((const
register int c = p[i]; \
if (c == '\"' || c == '\\') \
putc ('\\', FILE); \
- if (ISPRINT(c)) \
+ if (isprint(c)) \
putc (c, FILE); \
else \
{ \
===================================================================
Index: gcc/final.c
--- gcc/final.c 2000/11/23 06:37:23 1.149
+++ gcc/final.c 2000/11/27 17:27:44
@@ -3523,7 +3523,7 @@ output_asm_insn (template, operands)
Letters `acln' are implemented directly.
Other letters are passed to `output_operand' so that
the PRINT_OPERAND macro can define them. */
- else if (ISLOWER (*p) || ISUPPER (*p))
+ else if (islower (*p) || isupper (*p))
{
int letter = *p++;
c = atoi (p);
===================================================================
Index: gcc/fix-header.c
--- gcc/fix-header.c 2000/11/27 08:00:04 1.53
+++ gcc/fix-header.c 2000/11/27 17:27:44
@@ -934,13 +934,13 @@ inf_scan_ident (s, c)
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;
}
}
@@ -1251,7 +1251,7 @@ main (argc, argv)
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);
===================================================================
Index: gcc/fold-const.c
--- gcc/fold-const.c 2000/11/26 15:04:25 1.142
+++ gcc/fold-const.c 2000/11/27 17:27:44
@@ -1146,7 +1146,7 @@ real_hex_to_f (s, mode)
/* Value of exponent.
The exponent field is a decimal integer. */
- while (ISDIGIT (*p))
+ while (isdigit (*p))
{
k = (*p++ & CHARMASK) - '0';
expon = 10 * expon + k;
===================================================================
Index: gcc/gcc.c
--- gcc/gcc.c 2000/11/25 19:28:42 1.182
+++ gcc/gcc.c 2000/11/27 17:27:45
@@ -1327,7 +1327,7 @@ set_spec (name, spec)
}
old_spec = *(sl->ptr_spec);
- *(sl->ptr_spec) = ((spec[0] == '+' && ISSPACE ((unsigned char)spec[1]))
+ *(sl->ptr_spec) = ((spec[0] == '+' && isspace ((unsigned char)spec[1]))
? concat (old_spec, spec + 1, NULL_PTR)
: xstrdup (spec));
@@ -1571,12 +1571,12 @@ read_specs (filename, main_p)
while (*p1 == ' ' || *p1 == '\t')
p1++;
- if (! ISALPHA ((unsigned char) *p1))
+ if (! isalpha ((unsigned char) *p1))
fatal ("specs %%rename syntax malformed after %ld characters",
(long) (p1 - buffer));
p2 = p1;
- while (*p2 && !ISSPACE ((unsigned char) *p2))
+ while (*p2 && !isspace ((unsigned char) *p2))
p2++;
if (*p2 != ' ' && *p2 != '\t')
@@ -1588,13 +1588,13 @@ read_specs (filename, main_p)
while (*p2 == ' ' || *p2 == '\t')
p2++;
- if (! ISALPHA ((unsigned char) *p2))
+ if (! isalpha ((unsigned char) *p2))
fatal ("specs %%rename syntax malformed after %ld characters",
(long) (p2 - buffer));
/* Get new spec name. */
p3 = p2;
- while (*p3 && !ISSPACE ((unsigned char) *p3))
+ while (*p3 && !isspace ((unsigned char) *p3))
p3++;
if (p3 != p - 1)
@@ -3242,7 +3242,7 @@ process_command (argc, argv)
|| (len > 7
&& (IS_DIR_SEPARATOR (value[len - 8]))))
&& strncmp (value + len - 7, "stage", 5) == 0
- && ISDIGIT (value[len - 2])
+ && isdigit (value[len - 2])
&& (IS_DIR_SEPARATOR (value[len - 1])))
{
if (len == 7)
@@ -3299,21 +3299,21 @@ process_command (argc, argv)
const 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 != '-')
@@ -4098,14 +4098,14 @@ do_spec_1 (spec, inswitch, soft_matched_
const char *suffix = p;
char *saved_suffix = NULL;
- while (*p == '.' || ISALPHA ((unsigned char) *p))
+ while (*p == '.' || isalpha ((unsigned char) *p))
p++;
suffix_length = p - suffix;
if (p[0] == '%' && p[1] == 'O')
{
p += 2;
/* We don't support extra suffix characters after %O. */
- if (*p == '.' || ISALPHA ((unsigned char) *p))
+ if (*p == '.' || isalpha ((unsigned char) *p))
abort ();
if (suffix_length == 0)
suffix = OBJECT_SUFFIX;
@@ -4400,7 +4400,7 @@ do_spec_1 (spec, inswitch, soft_matched_
if (*y != '_'
|| (*(y + 1) != '_'
- && ! ISUPPER ((unsigned char) *(y + 1))))
+ && ! isupper ((unsigned char) *(y + 1))))
{
/* Stick __ at front of macro name. */
if (*y != '_')
@@ -4448,7 +4448,7 @@ do_spec_1 (spec, inswitch, soft_matched_
if (*y != '_'
|| (*(y + 1) != '_'
- && ! ISUPPER ((unsigned char) *(y + 1))))
+ && ! isupper ((unsigned char) *(y + 1))))
{
/* Stick -D__ at front of macro name. */
*x++ = '-';
@@ -4633,7 +4633,7 @@ do_spec_1 (spec, inswitch, soft_matched_
([^0-9]*-)?[0-9]+[.][0-9]+([.][0-9]+)?([- ].*)? */
/* 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] != '-')
abort ();
@@ -4642,7 +4642,7 @@ do_spec_1 (spec, inswitch, soft_matched_
if (c1 >= '2')
{
/* Set V after the first period. */
- while (ISDIGIT (*v))
+ while (isdigit (*v))
v++;
if (*v != '.')
abort ();
@@ -4654,7 +4654,7 @@ do_spec_1 (spec, inswitch, soft_matched_
if (c1 == '3')
{
/* Set V after the second period. */
- while (ISDIGIT (*v))
+ while (isdigit (*v))
v++;
if ((*v != 0) && (*v != ' ') && (*v != '.') && (*v != '-'))
abort ();
@@ -4664,7 +4664,7 @@ do_spec_1 (spec, inswitch, soft_matched_
/* Set Q at the next period or at the end. */
q = v;
- while (ISDIGIT (*q))
+ while (isdigit (*q))
q++;
if (*q != 0 && q > v && *q != ' ' && *q != '.' && *q != '-')
abort ();
===================================================================
Index: gcc/gen-protos.c
--- gcc/gen-protos.c 2000/02/27 00:10:14 1.17
+++ gcc/gen-protos.c 2000/11/27 17:27:45
@@ -100,7 +100,7 @@ parse_fn_proto (start, end, fn)
ptr--;
while (*ptr == ' ' || *ptr == '\t') ptr--;
- if (!ISALNUM ((unsigned char)*ptr))
+ if (!isalnum ((unsigned char)*ptr))
{
if (verbose)
fprintf (stderr, "%s: Can't handle this complex prototype: %s\n",
@@ -109,7 +109,7 @@ parse_fn_proto (start, end, fn)
}
name_end = ptr+1;
- while (ISALNUM ((unsigned char)*ptr) || *ptr == '_') --ptr;
+ while (isalnum ((unsigned char)*ptr) || *ptr == '_') --ptr;
name_start = ptr+1;
while (*ptr == ' ' || *ptr == '\t') ptr--;
ptr[1] = 0;
===================================================================
Index: gcc/genattr.c
--- gcc/genattr.c 2000/11/10 16:01:14 1.38
+++ gcc/genattr.c 2000/11/27 17:27:45
@@ -79,7 +79,7 @@ write_upcase (str)
const char *str;
{
for (; *str; str++)
- putchar (TOUPPER(*str));
+ putchar (toupper(*str));
}
static void
@@ -110,7 +110,7 @@ gen_attr (attr)
printf ("_");
}
else
- putchar (TOUPPER(*p));
+ putchar (toupper(*p));
}
printf ("};\n");
===================================================================
Index: gcc/genattrtab.c
--- gcc/genattrtab.c 2000/11/10 16:01:14 1.86
+++ gcc/genattrtab.c 2000/11/27 17:27:45
@@ -1414,7 +1414,7 @@ convert_const_symbol_ref (exp, attr)
strcat (p, "_");
strcat (p, XSTR (av->value, 0));
for (; *p != '\0'; p++)
- *p = TOUPPER (*p);
+ *p = toupper (*p);
value = attr_rtx (SYMBOL_REF, string);
RTX_UNCHANGING_P (value) = 1;
@@ -2874,7 +2874,7 @@ evaluate_eq_attr (exp, value, insn_code,
strcat (string, "_");
strcat (string, XSTR (exp, 1));
for (p = string; *p; p++)
- *p = TOUPPER (*p);
+ *p = toupper (*p);
newexp = attr_rtx (EQ, value,
attr_rtx (SYMBOL_REF,
@@ -5392,8 +5392,8 @@ write_upcase (str)
{
while (*str)
{
- /* The argument of TOUPPER should not have side effects. */
- putchar (TOUPPER(*str));
+ /* The argument of toupper should not have side effects. */
+ putchar (toupper(*str));
str++;
}
}
===================================================================
Index: gcc/genemit.c
--- gcc/genemit.c 2000/05/28 02:17:58 1.58
+++ gcc/genemit.c 2000/11/27 17:27:45
@@ -131,7 +131,7 @@ print_code (code)
{
register const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++)
- putchar (TOUPPER(*p1));
+ putchar (toupper(*p1));
}
static void
===================================================================
Index: gcc/genextract.c
--- gcc/genextract.c 2000/05/18 22:05:14 1.43
+++ gcc/genextract.c 2000/11/27 17:27:45
@@ -319,9 +319,9 @@ print_path (path)
for (i = len - 1; i >=0 ; i--)
{
- if (ISLOWER(path[i]))
+ if (islower(path[i]))
printf ("XVECEXP (");
- else if (ISDIGIT(path[i]))
+ else if (isdigit(path[i]))
printf ("XEXP (");
else
abort ();
@@ -331,9 +331,9 @@ print_path (path)
for (i = 0; i < len; i++)
{
- if (ISLOWER(path[i]))
+ if (islower(path[i]))
printf (", 0, %d)", path[i] - 'a');
- else if (ISDIGIT(path[i]))
+ else if (isdigit(path[i]))
printf (", %d)", path[i] - '0');
else
abort ();
===================================================================
Index: gcc/genflags.c
--- gcc/genflags.c 2000/05/27 22:34:05 1.35
+++ gcc/genflags.c 2000/11/27 17:27:45
@@ -116,7 +116,7 @@ gen_macro (name, real, expect)
/* #define GEN_CALL(A, B, C, D) gen_call((A), (B)) */
fputs ("#define GEN_", stdout);
for (i = 0; name[i]; i++)
- putchar (TOUPPER (name[i]));
+ putchar (toupper (name[i]));
putchar('(');
for (i = 0; i < expect - 1; i++)
===================================================================
Index: gcc/genopinit.c
--- gcc/genopinit.c 2000/10/18 21:33:39 1.42
+++ gcc/genopinit.c 2000/11/27 17:27:45
@@ -215,7 +215,7 @@ gen_insn (insn)
for (i = ((int) MAX_MACHINE_MODE) - 1; i >= 0; i--)
{
for (p = GET_MODE_NAME(i), q = np; *p; p++, q++)
- if (TOLOWER (*p) != *q)
+ if (tolower (*p) != *q)
break;
if (*p == 0
@@ -276,11 +276,11 @@ gen_insn (insn)
break;
case 'a':
for (np = GET_MODE_NAME(m1); *np; np++)
- putchar (TOLOWER (*np));
+ putchar (tolower (*np));
break;
case 'b':
for (np = GET_MODE_NAME(m2); *np; np++)
- putchar (TOLOWER (*np));
+ putchar (tolower (*np));
break;
case 'A':
printf ("(int) %smode", GET_MODE_NAME(m1));
@@ -294,7 +294,7 @@ gen_insn (insn)
case 'C':
printf ("(int) ");
for (np = GET_RTX_NAME(op); *np; np++)
- putchar (TOUPPER (*np));
+ putchar (toupper (*np));
break;
}
}
===================================================================
Index: gcc/genoutput.c
--- gcc/genoutput.c 2000/09/10 14:01:56 1.56
+++ gcc/genoutput.c 2000/11/27 17:27:45
@@ -994,7 +994,7 @@ strip_whitespace (s)
p = q = xmalloc (strlen (s) + 1);
while ((ch = *s++) != '\0')
- if (! ISSPACE (ch))
+ if (! isspace (ch))
*p++ = ch;
*p = '\0';
===================================================================
Index: gcc/genpeep.c
--- gcc/genpeep.c 2000/08/01 03:16:19 1.45
+++ gcc/genpeep.c 2000/11/27 17:27:45
@@ -366,7 +366,7 @@ print_code (code)
{
register const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++)
- putchar (TOUPPER(*p1));
+ putchar (toupper(*p1));
}
extern int main PARAMS ((int, char **));
===================================================================
Index: gcc/genrecog.c
--- gcc/genrecog.c 2000/10/17 14:27:53 1.87
+++ gcc/genrecog.c 2000/11/27 17:27:45
@@ -1620,7 +1620,7 @@ print_code (code)
{
register const char *p;
for (p = GET_RTX_NAME (code); *p; p++)
- putchar (TOUPPER (*p));
+ putchar (toupper (*p));
}
/* Emit code to cross an afterward link -- change state and branch. */
===================================================================
Index: gcc/gensupport.c
--- gcc/gensupport.c 2000/11/22 01:22:01 1.12
+++ gcc/gensupport.c 2000/11/27 17:27:45
@@ -595,10 +595,10 @@ shift_output_template (new, old, disp)
if (c == '%')
{
c = *old++;
- if (ISDIGIT ((unsigned char) c))
+ if (isdigit ((unsigned char) c))
c += disp;
- else if (ISUPPER ((unsigned char) c)
- || ISLOWER ((unsigned char) c))
+ else if (isupper ((unsigned char) c)
+ || islower ((unsigned char) c))
{
*new++ = c;
c = *old++ + disp;
@@ -642,7 +642,7 @@ alter_output_for_insn (ce_elem, insn_ele
{
do
*p++ = *insn_out++;
- while (ISSPACE ((unsigned char) *insn_out));
+ while (isspace ((unsigned char) *insn_out));
if (*insn_out != '#')
{
===================================================================
Index: gcc/mips-tfile.c
--- gcc/mips-tfile.c 2000/08/24 20:31:33 1.34
+++ gcc/mips-tfile.c 2000/11/27 17:27:45
@@ -694,7 +694,7 @@ main ()
#endif
#define IS_ASM_IDENT(ch) \
- (ISALNUM (ch) || (ch) == '_' || (ch) == '.' || (ch) == '$')
+ (isalnum (ch) || (ch) == '_' || (ch) == '.' || (ch) == '$')
/* Redefinition of storage classes as an enumeration for better
@@ -2790,7 +2790,7 @@ parse_begin (start)
return;
}
- for (end_p1 = start; (ch = *end_p1) != '\0' && !ISSPACE (ch); end_p1++)
+ for (end_p1 = start; (ch = *end_p1) != '\0' && !isspace (ch); end_p1++)
;
hash_ptr = hash_string (start,
@@ -2842,7 +2842,7 @@ parse_bend (start)
return;
}
- for (end_p1 = start; (ch = *end_p1) != '\0' && !ISSPACE (ch); end_p1++)
+ for (end_p1 = start; (ch = *end_p1) != '\0' && !isspace (ch); end_p1++)
;
hash_ptr = hash_string (start,
@@ -2953,7 +2953,7 @@ parse_def (name_start)
(ch = *dir_end_p1) != ' ' && ch != '\t';
dir_end_p1++)
{
- if (ch == '\0' || ISSPACE (ch))
+ if (ch == '\0' || isspace (ch))
{
error_line = __LINE__;
saber_stop ();
@@ -2969,7 +2969,7 @@ parse_def (name_start)
while (ch == ' ' || ch == '\t')
ch = *++arg_start;
- if (ISDIGIT (ch) || ch == '-' || ch == '+')
+ if (isdigit (ch) || ch == '-' || ch == '+')
{
int ch2;
arg_number = strtol (arg_start, (char **) &arg_end_p1, 0);
@@ -2977,7 +2977,7 @@ parse_def (name_start)
arg_was_number++;
}
- else if (ch == '\0' || ISSPACE (ch))
+ else if (ch == '\0' || isspace (ch))
{
error_line = __LINE__;
saber_stop ();
@@ -3025,7 +3025,7 @@ parse_def (name_start)
ch = *++arg_start;
arg_was_number = 0;
- if (ISDIGIT (ch) || ch == '-' || ch == '+')
+ if (isdigit (ch) || ch == '-' || ch == '+')
{
int ch2;
arg_number = strtol (arg_start, (char **) &arg_end_p1, 0);
@@ -3099,7 +3099,7 @@ parse_def (name_start)
ch = *++arg_start;
arg_was_number = 0;
- if (ISDIGIT (ch) || ch == '-' || ch == '+')
+ if (isdigit (ch) || ch == '-' || ch == '+')
{
int ch2;
arg_number = strtol (arg_start, (char **) &arg_end_p1, 0);
@@ -3478,7 +3478,7 @@ parse_end (start)
}
/* Get the function name, skipping whitespace. */
- for (start_func = start; ISSPACE ((unsigned char)*start_func); start_func++)
+ for (start_func = start; isspace ((unsigned char)*start_func); start_func++)
;
ch = *start_func;
@@ -3538,7 +3538,7 @@ parse_ent (start)
return;
}
- for (start_func = start; ISSPACE ((unsigned char)*start_func); start_func++)
+ for (start_func = start; isspace ((unsigned char)*start_func); start_func++)
;
ch = *start_func;
@@ -3648,7 +3648,7 @@ parse_stabs_common (string_start, string
mark_stabs ("");
/* Read code from stabs. */
- if (!ISDIGIT (*rest))
+ if (!isdigit (*rest))
{
error ("Invalid .stabs/.stabn directive, code is non-numeric");
return;
@@ -3668,7 +3668,7 @@ parse_stabs_common (string_start, string
shash_t *shash_ptr;
/* Skip ,0, */
- if (p[0] != ',' || p[1] != '0' || p[2] != ',' || !ISDIGIT (p[3]))
+ if (p[0] != ',' || p[1] != '0' || p[2] != ',' || !isdigit (p[3]))
{
error ("Invalid line number .stabs/.stabn directive");
return;
@@ -3676,7 +3676,7 @@ parse_stabs_common (string_start, string
code = strtol (p+3, &p, 0);
ch = *++p;
- if (p[-1] != ',' || ISDIGIT (ch) || !IS_ASM_IDENT (ch))
+ if (p[-1] != ',' || isdigit (ch) || !IS_ASM_IDENT (ch))
{
error ("Invalid line number .stabs/.stabn directive");
return;
@@ -3718,11 +3718,11 @@ parse_stabs_common (string_start, string
/* Skip ,<num>,<num>, */
if (*p++ != ',')
goto failure;
- for (; ISDIGIT (*p); p++)
+ for (; isdigit (*p); p++)
;
if (*p++ != ',')
goto failure;
- for (; ISDIGIT (*p); p++)
+ for (; isdigit (*p); p++)
;
if (*p++ != ',')
goto failure;
@@ -3734,7 +3734,7 @@ parse_stabs_common (string_start, string
return;
}
- if (ISDIGIT (ch) || ch == '-')
+ if (isdigit (ch) || ch == '-')
{
st = st_Nil;
sc = sc_Nil;
@@ -3802,7 +3802,7 @@ parse_stabs_common (string_start, string
ch = *end_p1++;
if (ch != '\n')
{
- if (((!ISDIGIT (*end_p1)) && (*end_p1 != '-'))
+ if (((!isdigit (*end_p1)) && (*end_p1 != '-'))
|| ((ch != '+') && (ch != '-')))
{
error ("Invalid .stabs/.stabn directive, badly formed value");
@@ -3878,16 +3878,16 @@ parse_input __proto((void))
while ((p = read_line ()) != (char *) 0)
{
/* Skip leading blanks */
- while (ISSPACE ((unsigned char)*p))
+ while (isspace ((unsigned char)*p))
p++;
/* See if it's a directive we handle. If so, dispatch handler. */
for (i = 0; i < ARRAY_SIZE (pseudo_ops); i++)
if (memcmp (p, pseudo_ops[i].name, pseudo_ops[i].len) == 0
- && ISSPACE ((unsigned char)(p[pseudo_ops[i].len])))
+ && isspace ((unsigned char)(p[pseudo_ops[i].len])))
{
p += pseudo_ops[i].len; /* skip to first argument */
- while (ISSPACE ((unsigned char)*p))
+ while (isspace ((unsigned char)*p))
p++;
(*pseudo_ops[i].func)( p );
===================================================================
Index: gcc/mkdeps.c
--- gcc/mkdeps.c 2000/11/17 04:16:54 1.7
+++ gcc/mkdeps.c 2000/11/27 17:27:45
@@ -115,7 +115,7 @@ base_name (fname)
const char *s = fname;
const char *p;
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- if (ISALPHA (s[0]) && s[1] == ':') s += 2;
+ if (isalpha (s[0]) && s[1] == ':') s += 2;
if ((p = strrchr (s, '\\'))) s = p + 1;
#elif defined VMS
if ((p = strrchr (s, ':'))) s = p + 1; /* Skip device. */
===================================================================
Index: gcc/optabs.c
--- gcc/optabs.c 2000/11/17 06:05:15 1.86
+++ gcc/optabs.c 2000/11/27 17:27:46
@@ -4476,7 +4476,7 @@ init_libfuncs (optable, first_mode, last
for (q = opname; *q; )
*p++ = *q++;
for (q = mname; *q; q++)
- *p++ = TOLOWER (*q);
+ *p++ = tolower (*q);
*p++ = suffix;
*p = '\0';
===================================================================
Index: gcc/protoize.c
--- gcc/protoize.c 2000/11/19 13:15:50 1.55
+++ gcc/protoize.c 2000/11/27 17:27:46
@@ -36,7 +36,7 @@ Boston, MA 02111-1307, USA. */
/* Macro to see if the path elements match. */
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
-#define IS_SAME_PATH_CHAR(a,b) (TOUPPER (a) == TOUPPER (b))
+#define IS_SAME_PATH_CHAR(a,b) (toupper (a) == toupper (b))
#else
#define IS_SAME_PATH_CHAR(a,b) ((a) == (b))
#endif
@@ -721,7 +721,7 @@ static int
is_id_char (ch)
int ch;
{
- return (ISALNUM (ch) || (ch == '_') || (ch == '$'));
+ return (isalnum (ch) || (ch == '_') || (ch == '$'));
}
/* Give a message indicating the proper way to invoke this program and then
@@ -1957,12 +1957,12 @@ munge_compile_params (params_list)
temp_params[param_count++] = compiler_file_name;
for (;;)
{
- while (ISSPACE ((const unsigned char)*params_list))
+ while (isspace ((const unsigned char)*params_list))
params_list++;
if (!*params_list)
break;
param = params_list;
- while (*params_list && !ISSPACE ((const unsigned char)*params_list))
+ while (*params_list && !isspace ((const unsigned char)*params_list))
params_list++;
if (param[0] != '-')
temp_params[param_count++]
@@ -1977,10 +1977,10 @@ munge_compile_params (params_list)
case 'c':
break; /* Don't copy these. */
case 'o':
- while (ISSPACE ((const unsigned char)*params_list))
+ while (isspace ((const unsigned char)*params_list))
params_list++;
while (*params_list
- && !ISSPACE ((const unsigned char)*params_list))
+ && !isspace ((const unsigned char)*params_list))
params_list++;
break;
default:
@@ -2930,7 +2930,7 @@ static const char *
forward_to_next_token_char (ptr)
const char *ptr;
{
- for (++ptr; ISSPACE ((const unsigned char)*ptr);
+ for (++ptr; isspace ((const unsigned char)*ptr);
check_source (++ptr < clean_text_limit, 0))
continue;
return ptr;
@@ -3299,7 +3299,7 @@ edit_formals_lists (end_formals, f_list_
next_end = start_formals - 1;
check_source (next_end > clean_read_ptr, 0);
- while (ISSPACE ((const unsigned char)*next_end))
+ while (isspace ((const unsigned char)*next_end))
check_source (--next_end > clean_read_ptr, 0);
check_source (*next_end == ')', next_end);
check_source (--next_end > clean_read_ptr, 0);
@@ -3320,7 +3320,7 @@ edit_formals_lists (end_formals, f_list_
size_t func_name_len;
for (func_name_limit = start_formals-1;
- ISSPACE ((const unsigned char)*func_name_limit); )
+ isspace ((const unsigned char)*func_name_limit); )
check_source (--func_name_limit > clean_read_ptr, 0);
for (func_name_start = func_name_limit++;
@@ -3416,8 +3416,8 @@ find_rightmost_formals_list (clean_text_
while (*end_formals != ')')
{
- if (ISSPACE ((unsigned char)*end_formals))
- while (ISSPACE ((unsigned char)*end_formals))
+ if (isspace ((unsigned char)*end_formals))
+ while (isspace ((unsigned char)*end_formals))
check_source (--end_formals > clean_read_ptr, 0);
else
check_source (--end_formals > clean_read_ptr, 0);
@@ -3446,8 +3446,8 @@ find_rightmost_formals_list (clean_text_
while (*end_formals != ')')
{
- if (ISSPACE ((const unsigned char)*end_formals))
- while (ISSPACE ((const unsigned char)*end_formals))
+ if (isspace ((const unsigned char)*end_formals))
+ while (isspace ((const unsigned char)*end_formals))
check_source (--end_formals > clean_read_ptr, 0);
else
check_source (--end_formals > clean_read_ptr, 0);
@@ -3465,7 +3465,7 @@ find_rightmost_formals_list (clean_text_
by an alphabetic character, while others *cannot* validly be followed
by such characters. */
- if ((ch == '{') || ISALPHA ((unsigned char)ch))
+ if ((ch == '{') || isalpha ((unsigned char)ch))
break;
/* At this point, we have found a right paren, but we know that it is
@@ -3560,7 +3560,7 @@ add_local_decl (def_dec_p, clean_text_p)
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 ((const unsigned char)*sp) && *sp != '\n'; sp--)
+ for (sp = ep; isspace ((const unsigned char)*sp) && *sp != '\n'; sp--)
continue;
/* Now write out the open { which began this block, and any following
@@ -3641,7 +3641,7 @@ add_global_decls (file_p, clean_text_p)
header. We will put in the added declarations just prior to that. */
scan_p++;
- while (ISSPACE ((const unsigned char)*scan_p))
+ while (isspace ((const unsigned char)*scan_p))
scan_p++;
scan_p--;
@@ -3810,7 +3810,7 @@ edit_fn_definition (def_dec_p, clean_tex
{
have_newlines |= (*scan_orig == '\n');
/* Leave identical whitespace alone. */
- if (!ISSPACE ((const unsigned char)*scan_orig))
+ if (!isspace ((const unsigned char)*scan_orig))
*((NONCONST char *)scan_orig) = ' '; /* identical - so whiteout */
}
else
@@ -3854,7 +3854,7 @@ do_cleaning (new_clean_text_base, new_cl
scan_p += 2;
while (scan_p[1] != '/' || scan_p[0] != '*')
{
- if (!ISSPACE ((const unsigned char)*scan_p))
+ if (!isspace ((const unsigned char)*scan_p))
*scan_p = ' ';
if (++scan_p >= new_clean_text_limit)
abort ();
@@ -3869,7 +3869,7 @@ do_cleaning (new_clean_text_base, new_cl
*scan_p = ' ';
while (scan_p[1] != '\n' || scan_p[0] == '\\')
{
- if (!ISSPACE ((const unsigned char)*scan_p))
+ if (!isspace ((const unsigned char)*scan_p))
*scan_p = ' ';
if (++scan_p >= new_clean_text_limit)
abort ();
@@ -3882,9 +3882,9 @@ do_cleaning (new_clean_text_base, new_cl
while (scan_p[1] != '\'' || scan_p[0] == '\\')
{
if (scan_p[0] == '\\'
- && !ISSPACE ((const unsigned char)scan_p[1]))
+ && !isspace ((const unsigned char)scan_p[1]))
scan_p[1] = ' ';
- if (!ISSPACE ((const unsigned char)*scan_p))
+ if (!isspace ((const unsigned char)*scan_p))
*scan_p = ' ';
if (++scan_p >= new_clean_text_limit)
abort ();
@@ -3897,14 +3897,14 @@ do_cleaning (new_clean_text_base, new_cl
while (scan_p[1] != '"' || scan_p[0] == '\\')
{
if (scan_p[0] == '\\'
- && !ISSPACE ((const unsigned char)scan_p[1]))
+ && !isspace ((const unsigned char)scan_p[1]))
scan_p[1] = ' ';
- if (!ISSPACE ((const unsigned char)*scan_p))
+ if (!isspace ((const unsigned char)*scan_p))
*scan_p = ' ';
if (++scan_p >= new_clean_text_limit)
abort ();
}
- if (!ISSPACE ((const unsigned char)*scan_p))
+ if (!isspace ((const unsigned char)*scan_p))
*scan_p = ' ';
scan_p++;
break;
@@ -3997,12 +3997,12 @@ scan_for_missed_items (file_p)
last_r_paren = scan_p;
- for (ahead_p = scan_p + 1; ISSPACE ((const unsigned char)*ahead_p); )
+ for (ahead_p = scan_p + 1; isspace ((const unsigned char)*ahead_p); )
check_source (++ahead_p < limit, limit);
scan_p = ahead_p - 1;
- if (ISALPHA ((const unsigned char)*ahead_p) || *ahead_p == '{')
+ if (isalpha ((const unsigned char)*ahead_p) || *ahead_p == '{')
{
const char *last_l_paren;
const int lineno = identify_lineno (ahead_p);
@@ -4017,7 +4017,7 @@ scan_for_missed_items (file_p)
{
last_l_paren = careful_find_l_paren (last_r_paren);
for (last_r_paren = last_l_paren-1;
- ISSPACE ((const unsigned char)*last_r_paren); )
+ isspace ((const unsigned char)*last_r_paren); )
check_source (--last_r_paren >= backup_limit, backup_limit);
}
while (*last_r_paren == ')');
@@ -4704,7 +4704,7 @@ main (argc, argv)
const char *cp;
for (cp = varargs_style_indicator;
- ISALNUM ((const unsigned char)*cp) || *cp == '_'; cp++)
+ isalnum ((const unsigned char)*cp) || *cp == '_'; cp++)
continue;
if (*cp != 0)
varargs_style_indicator = savestring (varargs_style_indicator,
===================================================================
Index: gcc/recog.c
--- gcc/recog.c 2000/11/10 00:07:52 1.85
+++ gcc/recog.c 2000/11/27 17:27:47
@@ -158,7 +158,7 @@ check_asm_operands (x)
const char *c = constraints[i];
if (c[0] == '%')
c++;
- if (ISDIGIT ((unsigned char)c[0]) && c[1] == '\0')
+ if (isdigit ((unsigned char)c[0]) && c[1] == '\0')
c = constraints[c[0] - '0'];
if (! asm_operand_ok (operands[i], c))
===================================================================
Index: gcc/rtl.c
--- gcc/rtl.c 2000/11/22 01:22:02 1.84
+++ gcc/rtl.c 2000/11/27 17:27:47
@@ -866,7 +866,7 @@ atoll(p)
int neg = 0;
HOST_WIDE_INT tmp_wide;
- while (ISSPACE(*p))
+ while (isspace(*p))
p++;
if (*p == '-')
neg = 1, p++;
@@ -874,7 +874,7 @@ atoll(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)
===================================================================
Index: gcc/scan.c
--- gcc/scan.c 2000/02/08 21:27:02 1.9
+++ gcc/scan.c 2000/11/27 17:27:47
@@ -62,13 +62,13 @@ scan_ident (fp, s, c)
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;
}
}
@@ -207,18 +207,18 @@ get_token (fp, s)
}
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);
===================================================================
Index: gcc/stmt.c
--- gcc/stmt.c 2000/11/17 17:31:08 1.178
+++ gcc/stmt.c 2000/11/27 17:27:47
@@ -1506,7 +1506,7 @@ expand_asm_operands (string, outputs, in
break;
default:
- if (! ISALPHA (constraint[j]))
+ if (! isalpha (constraint[j]))
{
error ("invalid punctuation `%c' in constraint",
constraint[j]);
@@ -1703,7 +1703,7 @@ expand_asm_operands (string, outputs, in
break;
default:
- if (! ISALPHA (constraint[j]))
+ if (! isalpha (constraint[j]))
{
error ("invalid punctuation `%c' in constraint",
constraint[j]);
@@ -5758,11 +5758,11 @@ estimate_case_costs (node)
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;
}
===================================================================
Index: gcc/system.h
--- gcc/system.h 2000/11/21 03:02:08 1.82
+++ gcc/system.h 2000/11/27 17:27:48
@@ -75,89 +75,15 @@ extern int fputs_unlocked PARAMS ((const
# endif
#endif
-#include <ctype.h>
-
-/* Jim Meyering writes:
-
- "... Some ctype macros are valid only for character codes that
- isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
- using /bin/cc or gcc but without giving an ansi option). So, all
- ctype uses should be through macros like ISPRINT... If
- STDC_HEADERS is defined, then autoconf has verified that the ctype
- macros don't need to be guarded with references to isascii. ...
- Defining isascii to 1 should let any compiler worth its salt
- eliminate the && through constant folding."
-
- Bruno Haible adds:
-
- "... Furthermore, isupper(c) etc. have an undefined result if c is
- outside the range -1 <= c <= 255. One is tempted to write isupper(c)
- with c being of type `char', but this is wrong if c is an 8-bit
- character >= 128 which gets sign-extended to a negative value.
- The macro ISUPPER protects against this as well." */
-
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) || defined(HOST_EBCDIC)
-# define IN_CTYPE_DOMAIN(c) 1
+/* There are an extraordinary number of issues with <ctype.h>.
+ The last straw is that it varies with the locale. Use libiberty's
+ replacement instead. (But not in programs which run during the
+ build.) */
+#ifdef GENERATOR_FILE
+# include <ctype.h>
#else
-# define IN_CTYPE_DOMAIN(c) isascii(c)
+# include <safe-ctype.h>
#endif
-
-/* The ctype functions are often implemented as macros which do
- lookups in arrays using the parameter as the offset. If the ctype
- function parameter is a char, then gcc will (appropriately) warn
- that a "subscript has type char". Using a (signed) char as a subscript
- is bad because you may get negative offsets and thus it is not 8-bit
- safe. The CTYPE_CONV macro ensures that the parameter is cast to an
- unsigned char when a char is passed in. When an int is passed in, the
- parameter is left alone so we don't lose EOF.
-*/
-
-#define CTYPE_CONV(CH) \
- (sizeof(CH) == sizeof(unsigned char) ? (int)(unsigned char)(CH) : (int)(CH))
-
-
-/* WARNING! The argument to the ctype replacement macros below is
- evaluated more than once so it must not have side effects! */
-
-#ifdef isblank
-# define ISBLANK(c) (IN_CTYPE_DOMAIN (c) && isblank (CTYPE_CONV(c)))
-#else
-# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
-#endif
-#ifdef isgraph
-# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isgraph (CTYPE_CONV(c)))
-#else
-# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isprint (CTYPE_CONV(c)) && !isspace (CTYPE_CONV(c)))
-#endif
-
-#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (CTYPE_CONV(c)))
-#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (CTYPE_CONV(c)))
-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (CTYPE_CONV(c)))
-#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (CTYPE_CONV(c)))
-#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (CTYPE_CONV(c)))
-#define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (CTYPE_CONV(c)))
-#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (CTYPE_CONV(c)))
-#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (CTYPE_CONV(c)))
-#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (CTYPE_CONV(c)))
-#define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (CTYPE_CONV(c)))
-
-#if STDC_HEADERS
-# define TOLOWER(c) (tolower (CTYPE_CONV(c)))
-# define TOUPPER(c) (toupper (CTYPE_CONV(c)))
-#else
-# define TOLOWER(c) (ISUPPER (c) ? tolower (CTYPE_CONV(c)) : (c))
-# define TOUPPER(c) (ISLOWER (c) ? toupper (CTYPE_CONV(c)) : (c))
-#endif
-
-/* ISDIGIT differs from ISDIGIT_LOCALE, as follows:
- - Its arg may be any int or unsigned int; it need not be an unsigned char.
- - It's guaranteed to evaluate its argument exactly once.
- - It's typically faster.
- Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
- only '0' through '9' are digits. Prefer ISDIGIT to ISDIGIT_LOCALE 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) (c) - '0' <= 9)
/* Define a default escape character; its different for EBCDIC. */
#ifndef TARGET_ESC
===================================================================
Index: gcc/tlink.c
--- gcc/tlink.c 2000/11/02 19:03:56 1.32
+++ gcc/tlink.c 2000/11/27 17:27:48
@@ -611,13 +611,13 @@ scan_linker_output (fname)
symbol *sym;
int end;
- while (*p && ISSPACE ((unsigned char)*p))
+ while (*p && isspace ((unsigned char)*p))
++p;
if (! *p)
continue;
- for (q = p; *q && ! ISSPACE ((unsigned char)*q); ++q)
+ for (q = p; *q && ! isspace ((unsigned char)*q); ++q)
;
/* Try the first word on the line. */
===================================================================
Index: gcc/tradcif.y
--- gcc/tradcif.y 2000/11/19 00:30:05 1.4
+++ gcc/tradcif.y 2000/11/27 17:27:48
@@ -399,13 +399,13 @@ yylex ()
if (c >= '0' && c <= '9') {
/* It's a number */
for (namelen = 0;
- c = tokstart[namelen], is_idchar[c] || c == '.';
+ c = tokstart[namelen], is_idchar (c) || c == '.';
namelen++)
;
return parse_number (namelen);
}
- if (!is_idstart[c]) {
+ if (!is_idstart (c)) {
yyerror ("Invalid token in expression");
return ERROR;
}
@@ -413,7 +413,7 @@ yylex ()
/* It is a name. See how long it is. */
for (namelen = 0;
- is_idchar[(int)(unsigned char)tokstart[namelen]];
+ is_idchar (tokstart[namelen]);
namelen++)
;
===================================================================
Index: gcc/tradcpp.c
--- gcc/tradcpp.c 2000/11/21 15:55:08 1.17
+++ gcc/tradcpp.c 2000/11/27 17:27:48
@@ -351,7 +351,6 @@ static void output_line_command PARAMS (
static int eval_if_expression PARAMS ((const U_CHAR *, int));
-static void initialize_char_syntax PARAMS ((void));
static void initialize_builtins PARAMS ((void));
static void make_definition PARAMS ((const U_CHAR *));
static void make_undef PARAMS ((U_CHAR *));
@@ -394,17 +393,8 @@ struct directive directive_table[] = {
{ -1, 0, "", T_UNUSED},
};
-/* table to tell if char can be part of a C identifier. */
-U_CHAR is_idchar[256];
-/* table to tell if char can be first char of a c identifier. */
-U_CHAR is_idstart[256];
-/* table to tell if c is horizontal space. */
-U_CHAR is_hor_space[256];
-/* table to tell if c is horizontal or vertical space. */
-U_CHAR is_space[256];
-
-#define SKIP_WHITE_SPACE(p) do { while (is_hor_space[*p]) p++; } while (0)
-#define SKIP_ALL_WHITE_SPACE(p) do { while (is_space[*p]) p++; } while (0)
+#define SKIP_WHITE_SPACE(p) do { while (is_nvspace(*p)) p++; } while (0)
+#define SKIP_ALL_WHITE_SPACE(p) do { while (is_space(*p)) p++; } while (0)
int errors = 0; /* Error counter for exit code */
@@ -484,9 +474,6 @@ main (argc, argv)
in_fname = NULL;
out_fname = NULL;
- /* Initialize is_idchar to allow $. */
- initialize_char_syntax ();
-
no_line_commands = 0;
dump_macros = 0;
no_output = 0;
@@ -691,12 +678,8 @@ main (argc, argv)
if (user_label_prefix == 0)
user_label_prefix = USER_LABEL_PREFIX;
-
- /* Initialize is_idchar. */
- initialize_char_syntax ();
- /* Install __LINE__, etc. Must follow initialize_char_syntax
- and option processing. */
+ /* Install __LINE__, etc. Must follow option processing. */
initialize_builtins ();
/* Do defines specified with -D and undefines specified with -U. */
@@ -1011,14 +994,14 @@ name_newline_fix (bp)
/* What follows the backslash-newlines is not embarrassing. */
- if (count == 0 || !is_idchar[*p])
+ if (count == 0 || !is_idchar (*p))
return;
/* Copy all potentially embarrassing characters
that follow the backslash-newline pairs
down to where the pairs originally started. */
- while (is_idchar[*p])
+ while (is_idchar (*p))
*bp++ = *p++;
/* Now write the same number of pairs after the embarrassing chars. */
@@ -1359,7 +1342,7 @@ do { ip = &instack[indepth]; \
ibp += 2;
}
c = *ibp++;
- if (!ISALNUM (c) && c != '.' && c != '_') {
+ if (!isalnum (c) && c != '.' && c != '_') {
--ibp;
break;
}
@@ -1422,7 +1405,7 @@ do { ip = &instack[indepth]; \
/* If expanding a macro arg, keep the newline -. */
*obp++ = '-';
}
- } else if (is_space[*ibp]) {
+ } else if (is_space (*ibp)) {
/* Newline Space does not prevent expansion of preceding token
so expand the preceding token and then come back. */
if (ident_length > 0)
@@ -1473,7 +1456,7 @@ do { ip = &instack[indepth]; \
ibp--;
/* If we have an identifier that ends here, process it now, so
we get the right error for recursion. */
- if (ident_length && ! is_idchar[*instack[indepth - 1].bufp]) {
+ if (ident_length && ! is_idchar (*instack[indepth - 1].bufp)) {
redo_char = 1;
goto randomchar;
}
@@ -1601,7 +1584,7 @@ randomchar:
*obp++ = '/';
}
}
- else if (is_space[*ibp]) {
+ else if (is_space (*ibp)) {
*obp++ = *ibp++;
if (ibp[-1] == '\n') {
if (ip->macro == 0) {
@@ -1796,7 +1779,7 @@ handle_directive (ip, op)
bp = ip->bufp;
/* Skip whitespace and \-newline. */
while (1) {
- if (is_hor_space[*bp])
+ if (is_nvspace (*bp))
bp++;
else if (*bp == '/' && (newline_fix (bp + 1), bp[1]) == '*') {
ip->bufp = bp;
@@ -1813,12 +1796,12 @@ handle_directive (ip, op)
cp = bp;
while (1) {
- if (is_idchar[*cp])
+ if (is_idchar (*cp))
cp++;
else {
if (*cp == '\\' && cp[1] == '\n')
name_newline_fix (cp);
- if (is_idchar[*cp])
+ if (is_idchar (*cp))
cp++;
else break;
}
@@ -1955,11 +1938,11 @@ handle_directive (ip, op)
if (*xp == '\n') {
xp++;
cp--;
- if (cp != buf && is_space[cp[-1]]) {
- while (cp != buf && is_space[cp[-1]]) cp--;
+ if (cp != buf && is_space (cp[-1])) {
+ while (cp != buf && is_space(cp[-1])) cp--;
cp++;
SKIP_WHITE_SPACE (xp);
- } else if (is_space[*xp]) {
+ } else if (is_space (*xp)) {
*cp++ = *xp++;
SKIP_WHITE_SPACE (xp);
}
@@ -2131,11 +2114,11 @@ special_symbol (hp, op)
SKIP_WHITE_SPACE (ip->bufp);
}
- if (!is_idstart[*ip->bufp])
+ if (!is_idstart (*ip->bufp))
goto oops;
if (lookup (ip->bufp, -1, -1))
buf = " 1 ";
- while (is_idchar[*ip->bufp])
+ while (is_idchar (*ip->bufp))
++ip->bufp;
SKIP_WHITE_SPACE (ip->bufp);
if (paren) {
@@ -2195,7 +2178,7 @@ get_filename:
SKIP_WHITE_SPACE (fbeg);
/* Discard trailing whitespace so we can easily see
if we have parsed all the significant chars we were given. */
- while (limit != fbeg && is_hor_space[limit[-1]]) limit--;
+ while (limit != fbeg && is_nvspace (limit[-1])) limit--;
switch (*fbeg++) {
case '\"':
@@ -2475,17 +2458,17 @@ do_define (buf, limit, op, keyword)
bp = buf;
- while (is_hor_space[*bp])
+ while (is_nvspace (*bp))
bp++;
symname = bp; /* remember where it starts */
- while (is_idchar[*bp] && bp < limit) {
+ while (is_idchar (*bp) && bp < limit) {
bp++;
}
sym_length = bp - symname;
if (sym_length == 0)
error ("invalid macro name");
- else if (!is_idstart[*symname]) {
+ else if (!is_idstart (*symname)) {
U_CHAR *msg; /* what pain... */
msg = (U_CHAR *) alloca (sym_length + 1);
memcpy (msg, symname, sym_length);
@@ -2517,11 +2500,11 @@ do_define (buf, limit, op, keyword)
temp->argno = argno++;
arg_ptrs = temp;
- if (!is_idstart[*bp])
+ if (!is_idstart (*bp))
warning ("parameter name starts with a digit in #define");
/* Find the end of the arg name. */
- while (is_idchar[*bp]) {
+ while (is_idchar (*bp)) {
bp++;
}
temp->length = bp - temp->name;
@@ -2542,7 +2525,7 @@ do_define (buf, limit, op, keyword)
}
++bp; /* skip paren */
- while (is_hor_space[*bp]) /* and leading whitespace */
+ while (is_nvspace (*bp)) /* and leading whitespace */
++bp;
/* now everything from bp before limit is the definition. */
defn = collect_expansion (bp, limit, argno, arg_ptrs);
@@ -2569,7 +2552,7 @@ do_define (buf, limit, op, keyword)
}
} else {
/* simple expansion or empty definition; skip leading whitespace */
- while (is_hor_space[*bp])
+ while (is_nvspace (*bp))
++bp;
/* now everything from bp before limit is the definition. */
defn = collect_expansion (bp, limit, -1, 0);
@@ -2650,17 +2633,17 @@ comp_def_part (first, beg1, len1, beg2,
register const U_CHAR *end1 = beg1 + len1;
register const U_CHAR *end2 = beg2 + len2;
if (first) {
- while (beg1 != end1 && is_space[*beg1]) beg1++;
- while (beg2 != end2 && is_space[*beg2]) beg2++;
+ while (beg1 != end1 && is_space (*beg1)) beg1++;
+ while (beg2 != end2 && is_space (*beg2)) beg2++;
}
if (last) {
- while (beg1 != end1 && is_space[end1[-1]]) end1--;
- while (beg2 != end2 && is_space[end2[-1]]) end2--;
+ while (beg1 != end1 && is_space (end1[-1])) end1--;
+ while (beg2 != end2 && is_space (end2[-1])) end2--;
}
while (beg1 != end1 && beg2 != end2) {
- if (is_space[*beg1] && is_space[*beg2]) {
- while (beg1 != end1 && is_space[*beg1]) beg1++;
- while (beg2 != end2 && is_space[*beg2]) beg2++;
+ if (is_space (*beg1) && is_space (*beg2)) {
+ while (beg1 != end1 && is_space (*beg1)) beg1++;
+ while (beg2 != end2 && is_space (*beg2)) beg2++;
} else if (*beg1 == *beg2) {
beg1++; beg2++;
} else break;
@@ -2717,8 +2700,8 @@ collect_expansion (buf, end, nargs, argl
/* Find end of leading whitespace. */
limit = end;
p = buf;
- while (p < limit && is_space[limit[-1]]) limit--;
- while (p < limit && is_space[*p]) p++;
+ while (p < limit && is_space (limit[-1])) limit--;
+ while (p < limit && is_space (*p)) p++;
/* Allocate space for the text in the macro definition.
Leading and trailing whitespace chars need 2 bytes each.
@@ -2737,7 +2720,7 @@ collect_expansion (buf, end, nargs, argl
p = buf;
/* Convert leading whitespace to Newline-markers. */
- while (p < limit && is_space[*p]) {
+ while (p < limit && is_space (*p)) {
*exp_p++ = '\n';
*exp_p++ = *p++;
}
@@ -2787,15 +2770,15 @@ collect_expansion (buf, end, nargs, argl
break;
}
- if (is_idchar[c] && nargs > 0) {
+ if (is_idchar (c) && nargs > 0) {
U_CHAR *id_beg = p - 1;
int id_len;
--exp_p;
- while (p != limit && is_idchar[*p]) p++;
+ while (p != limit && is_idchar (*p)) p++;
id_len = p - id_beg;
- if (is_idstart[c]) {
+ if (is_idstart (c)) {
register struct arglist *arg;
for (arg = arglist; arg != NULL; arg = arg->next) {
@@ -2848,7 +2831,7 @@ collect_expansion (buf, end, nargs, argl
if (limit < end) {
/* Convert trailing whitespace to Newline-markers. */
- while (limit < end && is_space[*limit]) {
+ while (limit < end && is_space (*limit)) {
*exp_p++ = '\n';
*exp_p++ = *limit++;
}
@@ -2888,7 +2871,7 @@ do_line (buf, limit, op, keyword)
bp = tem.buf;
SKIP_WHITE_SPACE (bp);
- if (!ISDIGIT (*bp)) {
+ if (!isdigit (*bp)) {
error ("invalid format #line command");
return;
}
@@ -2899,11 +2882,11 @@ do_line (buf, limit, op, keyword)
new_lineno = atoi ((const char *)bp) - 1;
/* skip over the line number. */
- while (ISDIGIT (*bp))
+ while (isdigit (*bp))
bp++;
#if 0 /* #line 10"foo.c" is supposed to be allowed. */
- if (*bp && !is_space[*bp]) {
+ if (*bp && !is_space (*bp)) {
error ("invalid format #line command");
return;
}
@@ -2993,7 +2976,7 @@ do_undef (buf, limit, op, keyword)
SKIP_WHITE_SPACE (buf);
- if (! strncmp ((const char *)buf, "defined", 7) && ! is_idchar[buf[7]])
+ if (! strncmp ((const char *)buf, "defined", 7) && ! is_idchar (buf[7]))
warning ("undefining `defined'");
while ((hp = lookup (buf, -1, -1)) != NULL) {
@@ -3110,10 +3093,10 @@ do_xifdef (buf, limit, op, keyword)
/* Discard leading and trailing whitespace. */
SKIP_WHITE_SPACE (buf);
- while (limit != buf && is_hor_space[limit[-1]]) limit--;
+ while (limit != buf && is_nvspace (limit[-1])) limit--;
/* Find the end of the identifier at the beginning. */
- for (end = buf; is_idchar[*end]; end++);
+ for (end = buf; is_idchar (*end); end++);
if (end == buf) {
skip = (keyword->type == T_IFDEF);
@@ -3205,7 +3188,7 @@ skip_if_group (ip, any)
If not, this # is not special. */
bp = beg_of_line;
while (1) {
- if (is_hor_space[*bp])
+ if (is_nvspace (*bp))
bp++;
else if (*bp == '\\' && bp[1] == '\n')
bp += 2;
@@ -3229,7 +3212,7 @@ skip_if_group (ip, any)
/* Skip whitespace and \-newline. */
while (1) {
- if (is_hor_space[*bp])
+ if (is_nvspace (*bp))
bp++;
else if (*bp == '\\' && bp[1] == '\n')
bp += 2;
@@ -3249,12 +3232,12 @@ skip_if_group (ip, any)
symbol-constituents so that we end up with a contiguous name. */
while (1) {
- if (is_idchar[*bp])
+ if (is_idchar (*bp))
bp++;
else {
if (*bp == '\\' && bp[1] == '\n')
name_newline_fix (bp);
- if (is_idchar[*bp])
+ if (is_idchar (*bp))
bp++;
else break;
}
@@ -3263,7 +3246,7 @@ skip_if_group (ip, any)
for (kt = directive_table; kt->length >= 0; kt++) {
IF_STACK_FRAME *temp;
if (strncmp ((const char *)cp, kt->name, kt->length) == 0
- && !is_idchar[cp[kt->length]]) {
+ && !is_idchar (cp[kt->length])) {
/* If we are asked to return on next directive,
do so now. */
@@ -3612,7 +3595,7 @@ macroexpand (hp, op)
if (i == 1) {
register const U_CHAR *bp = args[0].raw;
register const U_CHAR *lim = bp + args[0].raw_length;
- while (bp != lim && is_space[*bp]) bp++;
+ while (bp != lim && is_space (*bp)) bp++;
if (bp == lim)
i = 0;
}
@@ -3680,10 +3663,10 @@ macroexpand (hp, op)
int c;
i = 0;
while (i < arglen
- && (c = arg->raw[i], is_space[c]))
+ && (c = arg->raw[i], is_space (c)))
i++;
while (i < arglen
- && (c = arg->raw[arglen - 1], is_space[c]))
+ && (c = arg->raw[arglen - 1], is_space (c)))
arglen--;
for (; i < arglen; i++) {
c = arg->raw[i];
@@ -3698,13 +3681,13 @@ macroexpand (hp, op)
/* Internal sequences of whitespace are replaced by one space
except within an string or char token. */
if (! in_string
- && (c == '\n' ? arg->raw[i+1] == '\n' : is_space[c])) {
+ && (c == '\n' ? arg->raw[i+1] == '\n' : is_space (c))) {
while (1) {
/* Note that Newline Space does occur within whitespace
sequences; consider it part of the sequence. */
- if (c == '\n' && is_space[arg->raw[i+1]])
+ if (c == '\n' && is_space (arg->raw[i+1]))
i += 2;
- else if (c != '\n' && is_space[c])
+ else if (c != '\n' && is_space (c))
i++;
else break;
c = arg->raw[i];
@@ -3728,7 +3711,7 @@ macroexpand (hp, op)
/* Escape these chars */
if (c == '\"' || (in_string && c == '\\'))
xbuf[totlen++] = '\\';
- if (ISPRINT (c))
+ if (isprint (c))
xbuf[totlen++] = c;
else {
sprintf ((char *) &xbuf[totlen], "\\%03o", (unsigned int) c);
@@ -3740,8 +3723,8 @@ macroexpand (hp, op)
const U_CHAR *l1 = p1 + arg->raw_length;
if (ap->raw_before) {
- while (p1 != l1 && is_space[*p1]) p1++;
- while (p1 != l1 && is_idchar[*p1])
+ while (p1 != l1 && is_space (*p1)) p1++;
+ while (p1 != l1 && is_idchar (*p1))
xbuf[totlen++] = *p1++;
/* Delete any no-reexpansion marker that follows
an identifier at the beginning of the argument
@@ -3753,7 +3736,7 @@ macroexpand (hp, op)
/* Arg is concatenated after: delete trailing whitespace,
whitespace markers, and no-reexpansion markers. */
while (p1 != l1) {
- if (is_space[l1[-1]]) l1--;
+ if (is_space (l1[-1])) l1--;
else if (l1[-1] == '-') {
const U_CHAR *p2 = l1 - 1;
/* If a `-' is preceded by an odd number of newlines then it
@@ -3930,7 +3913,7 @@ macarg (argptr)
in case we need to keep it all. */
if (c == '\"' || c == '\\') /* escape these chars */
totlen++;
- else if (!ISPRINT (c))
+ else if (!isprint (c))
totlen += 3;
}
argptr->stringified_length = totlen;
@@ -4367,7 +4350,7 @@ install (name, len, type, hash)
if (len < 0) {
p = name;
- while (is_idchar[*p])
+ while (is_idchar (*p))
p++;
len = p - name;
}
@@ -4411,7 +4394,7 @@ lookup (name, len, hash)
register HASHNODE *bucket;
if (len < 0) {
- for (bp = name; is_idchar[*bp]; bp++) ;
+ for (bp = name; is_idchar (*bp); bp++) ;
len = bp - name;
}
@@ -4581,44 +4564,6 @@ dump_arg_n (defn, argnum)
putchar (*p);
p++;
}
-}
-
-/* Initialize syntactic classifications of characters. */
-static void
-initialize_char_syntax ()
-{
- register int i;
-
- /*
- * Set up is_idchar and is_idstart tables. These should be
- * faster than saying (is_alpha (c) || c == '_'), etc.
- * Must do set up these things before calling any routines tthat
- * refer to them.
- */
- for (i = 'a'; i <= 'z'; i++) {
- is_idchar[i - 'a' + 'A'] = 1;
- is_idchar[i] = 1;
- is_idstart[i - 'a' + 'A'] = 1;
- is_idstart[i] = 1;
- }
- for (i = '0'; i <= '9'; i++)
- is_idchar[i] = 1;
- is_idchar['_'] = 1;
- is_idstart['_'] = 1;
-
- /* horizontal space table */
- is_hor_space[' '] = 1;
- is_hor_space['\t'] = 1;
- is_hor_space['\v'] = 1;
- is_hor_space['\f'] = 1;
- is_hor_space['\r'] = 1;
-
- is_space[' '] = 1;
- is_space['\t'] = 1;
- is_space['\v'] = 1;
- is_space['\f'] = 1;
- is_space['\n'] = 1;
- is_space['\r'] = 1;
}
/* Initialize the built-in macros. */
===================================================================
Index: gcc/tradcpp.h
--- gcc/tradcpp.h 2000/11/19 00:30:05 1.1
+++ gcc/tradcpp.h 2000/11/27 17:27:48
@@ -35,7 +35,7 @@ extern void fancy_abort PARAMS ((int, co
extern struct hashnode *lookup PARAMS ((const unsigned char *, int, int));
extern int parse_c_expression PARAMS ((const char *)); /* in tradcif.y */
-/* some external tables of character types */
-extern unsigned char is_idstart[], is_idchar[];
+#define is_idchar(x) isidnum(x)
+#define is_idstart(x) isidst(x)
#endif /* ! _TRADCPP_H_ */
===================================================================
Index: gcc/tree.c
--- gcc/tree.c 2000/11/27 07:09:19 1.177
+++ gcc/tree.c 2000/11/27 17:27:49
@@ -4485,15 +4485,15 @@ clean_symbol_name (p)
char *p;
{
for (; *p; p++)
- if (! (ISDIGIT(*p)
+ if (! (isdigit(*p)
#ifndef NO_DOLLAR_IN_LABEL /* this for `$'; unlikely, but... -- kr */
|| *p == '$'
#endif
#ifndef NO_DOT_IN_LABEL /* this for `.'; unlikely, but... */
|| *p == '.'
#endif
- || ISUPPER (*p)
- || ISLOWER (*p)))
+ || isupper (*p)
+ || islower (*p)))
*p = '_';
}
===================================================================
Index: gcc/ch/lex.c
--- gcc/ch/lex.c 2000/08/29 21:39:45 1.16
+++ gcc/ch/lex.c 2000/11/27 17:27:49
@@ -499,7 +499,7 @@ yylex ()
break;
if (ch == '_')
continue;
- if (!ISXDIGIT (ch)) /* error on non-hex digit */
+ if (!isxdigit (ch)) /* error on non-hex digit */
{
if (pass == 1)
error ("invalid C'xx' ");
@@ -535,7 +535,7 @@ yylex ()
for (;;)
{
ch = input ();
- if (ISALNUM (ch))
+ if (isalnum (ch))
obstack_1grow (&temporary_obstack, ch);
else if (ch != '_')
break;
@@ -585,7 +585,7 @@ yylex ()
case '.':
nextc = input ();
unput (nextc);
- if (ISDIGIT (nextc)) /* || nextc == '_') we don't start numbers with '_' */
+ if (isdigit (nextc)) /* || nextc == '_') we don't start numbers with '_' */
goto number;
return DOT;
case '0': case '1': case '2': case '3': case '4':
@@ -628,7 +628,7 @@ read_identifier (first)
first = input ();
if (first == EOF)
break;
- if (! ISALNUM (first) && first != '_')
+ if (! isalnum (first) && first != '_')
{
unput (first);
break;
@@ -652,7 +652,7 @@ handle_name (id)
struct resword *tp;
tp = in_word_set (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
if (tp != NULL
- && special_UC == ISUPPER ((unsigned char) tp->name[0])
+ && special_UC == isupper ((unsigned char) tp->name[0])
&& (tp->flags == RESERVED || tp->flags == PREDEF))
{
if (tp->rid != NORID)
@@ -677,7 +677,7 @@ read_number (ch)
if (ch != '_')
obstack_1grow (&temporary_obstack, ch);
ch = input ();
- if (! ISDIGIT (ch) && ch != '_')
+ if (! isdigit (ch) && ch != '_')
break;
}
if (ch == '.')
@@ -687,7 +687,7 @@ read_number (ch)
if (ch != '_')
obstack_1grow (&temporary_obstack, ch);
ch = input ();
- } while (ISDIGIT (ch) || ch == '_');
+ } while (isdigit (ch) || ch == '_');
is_float++;
}
if (ch == 'd' || ch == 'D' || ch == 'e' || ch == 'E')
@@ -700,14 +700,14 @@ read_number (ch)
obstack_1grow (&temporary_obstack, ch);
ch = input ();
}
- if (ISDIGIT (ch) || ch == '_')
+ if (isdigit (ch) || ch == '_')
{
do
{
if (ch != '_')
obstack_1grow (&temporary_obstack, ch);
ch = input ();
- } while (ISDIGIT (ch) || ch == '_');
+ } while (isdigit (ch) || ch == '_');
}
else
{
@@ -770,7 +770,7 @@ read_directive ()
struct resword *tp;
tree id;
int ch = skip_whitespace();
- if (ISALPHA (ch) || ch == '_')
+ if (isalpha (ch) || ch == '_')
id = read_identifier (ch);
else if (ch == EOF)
{
@@ -785,7 +785,7 @@ read_directive ()
return;
}
tp = in_word_set (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
- if (tp == NULL || special_UC != ISUPPER ((unsigned char) tp->name[0]))
+ if (tp == NULL || special_UC != isupper ((unsigned char) tp->name[0]))
{
if (pass == 1)
warning ("unrecognized compiler directive `%s'",
@@ -888,8 +888,8 @@ maybe_downcase (str)
return;
while (*str)
{
- if (ISUPPER ((unsigned char) *str))
- *str = TOLOWER (*str);
+ if (isupper ((unsigned char) *str))
+ *str = tolower (*str);
str++;
}
}
@@ -929,7 +929,7 @@ maybe_number (s)
break;
case 'h':
case 'H':
- if (!ISXDIGIT ((unsigned char) *s))
+ if (!isxdigit ((unsigned char) *s))
return 0;
break;
case 'b':
@@ -1092,14 +1092,14 @@ readstring (terminator, len)
}
else if (base == 10)
{
- if (! ISDIGIT (cc))
+ if (! isdigit (cc))
cc = -1;
else
cc -= '0';
}
else if (base == 16)
{
- if (!ISXDIGIT (cc))
+ if (!isxdigit (cc))
cc = -1;
else
{
@@ -1194,7 +1194,7 @@ convert_integer (intchars)
base = 2;
break;
default:
- if (!ISDIGIT (*p)) /* this test is for equal_number () */
+ if (!isdigit (*p)) /* this test is for equal_number () */
{
obstack_free (&temporary_obstack, intchars);
return 0;
@@ -1472,7 +1472,7 @@ getlc (file)
c = getc (file);
if (ignore_case)
- c = TOLOWER (c);
+ c = tolower (c);
return c;
}
@@ -1525,7 +1525,7 @@ handle_generic_pragma (buffer)
* buff ++ = c;
c = getc (finput);
}
- while (c != EOF && isascii (c) && ! ISSPACE (c) && c != '\n'
+ while (c != EOF && isascii (c) && ! isspace (c) && c != '\n'
&& buff < buffer + 128); /* XXX shared knowledge about size of buffer. */
ungetc (c, finput);
@@ -1579,7 +1579,7 @@ check_newline ()
if the word isn't `pragma', `ident', `define', or `undef'. */
if (ignore_case)
- c = TOLOWER (c);
+ c = tolower (c);
if (c >= 'a' && c <= 'z')
{
@@ -1590,14 +1590,14 @@ check_newline ()
&& getlc (finput) == 'g'
&& getlc (finput) == 'm'
&& getlc (finput) == 'a'
- && (c = getlc (finput), ISSPACE (c)))
+ && (c = getlc (finput), isspace (c)))
{
#ifdef HANDLE_PRAGMA
static char buffer [128];
char * buff = buffer;
/* Read the pragma name into a buffer. */
- while (c = getlc (finput), ISSPACE (c))
+ while (c = getlc (finput), isspace (c))
continue;
do
@@ -1605,7 +1605,7 @@ check_newline ()
* buff ++ = c;
c = getlc (finput);
}
- while (c != EOF && ! ISSPACE (c) && c != '\n'
+ while (c != EOF && ! isspace (c) && c != '\n'
&& buff < buffer + 128);
pragma_ungetc (c);
@@ -1632,7 +1632,7 @@ check_newline ()
&& getlc (finput) == 'i'
&& getlc (finput) == 'n'
&& getlc (finput) == 'e'
- && (c = getlc (finput), ISSPACE (c)))
+ && (c = getlc (finput), isspace (c)))
{
#if 0 /*def DWARF_DEBUGGING_INFO*/
if (c != '\n'
@@ -1649,7 +1649,7 @@ check_newline ()
&& getlc (finput) == 'd'
&& getlc (finput) == 'e'
&& getlc (finput) == 'f'
- && (c = getlc (finput), ISSPACE (c)))
+ && (c = getlc (finput), isspace (c)))
{
#if 0 /*def DWARF_DEBUGGING_INFO*/
if (c != '\n'
@@ -1730,7 +1730,7 @@ linenum:
/* Something follows the #; read a token. */
- if (ISDIGIT(c))
+ if (isdigit(c))
{
int old_lineno = lineno;
int used_up = 0;
@@ -1741,7 +1741,7 @@ linenum:
{
l = l * 10 + (c - '0'); /* FIXME Not portable */
c = getlc(finput);
- } while (ISDIGIT(c));
+ } while (isdigit(c));
/* subtract one, because it is the following line that
gets the specified number */
@@ -1808,7 +1808,7 @@ linenum:
/* `1' after file name means entering new file.
`2' after file name means just left a file. */
- if (ISDIGIT (c))
+ if (isdigit (c))
{
if (c == '1')
{
@@ -2007,7 +2007,7 @@ equal_number ()
/* collect token into tokenbuf for later analysis */
while (TRUE)
{
- if (ISSPACE (c) || c == '<')
+ if (isspace (c) || c == '<')
break;
obstack_1grow (&temporary_obstack, c);
c = input ();
@@ -2048,7 +2048,7 @@ equal_number ()
{
cursor = tokenbuf;
c = *cursor;
- if (!ISALPHA (c) && c != '_')
+ if (!isalpha (c) && c != '_')
{
if (pass == 1)
error ("invalid value follows `=' in compiler directive");
@@ -2056,8 +2056,8 @@ equal_number ()
}
for (cursor = &tokenbuf[1]; *cursor != '\0'; cursor++)
- if (ISALPHA ((unsigned char) *cursor) || *cursor == '_' ||
- ISDIGIT (*cursor))
+ if (isalpha ((unsigned char) *cursor) || *cursor == '_' ||
+ isdigit (*cursor))
continue;
else
{
===================================================================
Index: gcc/config/alpha/alpha.c
--- gcc/config/alpha/alpha.c 2000/11/22 00:59:11 1.150
+++ gcc/config/alpha/alpha.c 2000/11/27 17:27:50
@@ -298,11 +298,11 @@ override_options ()
if (!alpha_mlat_string)
alpha_mlat_string = "L1";
- if (ISDIGIT ((unsigned char)alpha_mlat_string[0])
+ if (isdigit ((unsigned char)alpha_mlat_string[0])
&& (lat = strtol (alpha_mlat_string, &end, 10), *end == '\0'))
;
else if ((alpha_mlat_string[0] == 'L' || alpha_mlat_string[0] == 'l')
- && ISDIGIT ((unsigned char)alpha_mlat_string[1])
+ && isdigit ((unsigned char)alpha_mlat_string[1])
&& alpha_mlat_string[2] == '\0')
{
static int const cache_latency[][4] =
===================================================================
Index: gcc/config/c4x/c4x.c
--- gcc/config/c4x/c4x.c 2000/09/07 22:24:32 1.66
+++ gcc/config/c4x/c4x.c 2000/11/27 17:27:50
@@ -786,8 +786,8 @@ c4x_interrupt_function_p ()
&& current_function_name[2] == 'i'
&& current_function_name[3] == 'n'
&& current_function_name[4] == 't'
- && ISDIGIT (current_function_name[5])
- && ISDIGIT (current_function_name[6]);
+ && isdigit (current_function_name[5])
+ && isdigit (current_function_name[6]);
}
void
===================================================================
Index: gcc/config/i370/i370.h
--- gcc/config/i370/i370.h 2000/09/25 13:03:18 1.26
+++ gcc/config/i370/i370.h 2000/11/27 17:27:50
@@ -1136,7 +1136,7 @@ enum reg_class
else \
ch = '@'; \
for (bp = temp; *bp; bp++) \
- *bp = (*bp == '_' ? ch : TOUPPER (*bp)); \
+ *bp = (*bp == '_' ? ch : toupper (*bp)); \
fprintf (FILE, "%s", temp); \
}
@@ -1254,7 +1254,7 @@ enum reg_class
for (j = 0, i = 0; i < LEN; j++, i++) \
{ \
c = PTR[i]; \
- if (ISCNTRL (c) || c == '&') \
+ if (iscntrl (c) || c == '&') \
{ \
if (j % MVS_ASCII_TEXT_LENGTH != 0 ) \
fprintf (FILE, "'\n"); \
===================================================================
Index: gcc/config/mips/mips.c
--- gcc/config/mips/mips.c 2000/11/10 16:01:23 1.103
+++ gcc/config/mips/mips.c 2000/11/27 17:27:51
@@ -4714,7 +4714,7 @@ override_options ()
if (mips_isa_string == 0)
mips_isa = MIPS_ISA_DEFAULT;
- else if (ISDIGIT (*mips_isa_string))
+ else if (isdigit (*mips_isa_string))
{
mips_isa = atoi (mips_isa_string);
if (mips_isa == 16)
===================================================================
Index: gcc/config/pj/pj.c
--- gcc/config/pj/pj.c 2000/03/08 06:27:35 1.3
+++ gcc/config/pj/pj.c 2000/11/27 17:27:51
@@ -201,9 +201,9 @@ pj_printf VPARAMS ((const char *template
int code = 0;
rtx send;
- if (ISALPHA (*template))
+ if (isalpha (*template))
code = *template++;
- if (ISDIGIT (*template))
+ if (isdigit (*template))
{
int num = atoi (template);
template++;
===================================================================
Index: gcc/config/rs6000/rs6000.c
--- gcc/config/rs6000/rs6000.c 2000/11/19 18:49:31 1.156
+++ gcc/config/rs6000/rs6000.c 2000/11/27 17:27:52
@@ -7016,7 +7016,7 @@ rs6000_gen_section_name (buf, filename,
p += strlen (section_desc);
}
- else if (ISALNUM (*q))
+ else if (isalnum (*q))
*p++ = *q;
}
===================================================================
Index: gcc/config/v850/v850.c
--- gcc/config/v850/v850.c 2000/11/25 00:43:32 1.34
+++ gcc/config/v850/v850.c 2000/11/27 17:27:52
@@ -101,7 +101,7 @@ override_options ()
{
if (small_memory[i].value)
{
- if (!ISDIGIT (*small_memory[i].value))
+ if (!isdigit (*small_memory[i].value))
error ("%s=%s is not numeric.",
small_memory[i].name,
small_memory[i].value);
===================================================================
Index: gcc/cp/error.c
--- gcc/cp/error.c 2000/11/07 22:49:57 1.142
+++ gcc/cp/error.c 2000/11/27 17:27:52
@@ -1493,7 +1493,7 @@ dump_char (c)
output_add_string (scratch_buffer, "\\\"");
break;
default:
- if (ISPRINT (c))
+ if (isprint (c))
output_add_character (scratch_buffer, c);
else
{
===================================================================
Index: gcc/cp/lex.c
--- gcc/cp/lex.c 2000/11/26 10:48:50 1.229
+++ gcc/cp/lex.c 2000/11/27 17:27:52
@@ -318,7 +318,7 @@ init_operators ()
struct operator_name_info_t *oni;
#define DEF_OPERATOR(NAME, CODE, NEW_MANGLING, OLD_MANGLING, ARITY, ASSN_P) \
- sprintf (buffer, ISALPHA (NAME[0]) ? "operator %s" : "operator%s", NAME); \
+ sprintf (buffer, isalpha (NAME[0]) ? "operator %s" : "operator%s", NAME); \
identifier = get_identifier (buffer); \
IDENTIFIER_OPNAME_P (identifier) = 1; \
\
===================================================================
Index: gcc/cp/method.c
--- gcc/cp/method.c 2000/11/25 19:50:50 1.180
+++ gcc/cp/method.c 2000/11/27 17:27:52
@@ -1057,7 +1057,7 @@ build_qualified_name (decl)
{
tree id = DECL_ASSEMBLER_NAME (decl);
OB_PUTID (id);
- if (ISDIGIT (IDENTIFIER_POINTER (id) [IDENTIFIER_LENGTH (id) - 1]))
+ if (isdigit (IDENTIFIER_POINTER (id) [IDENTIFIER_LENGTH (id) - 1]))
numeric_output_need_bar = 1;
return;
}
===================================================================
Index: gcc/cp/spew.c
--- gcc/cp/spew.c 2000/11/26 10:48:50 1.39
+++ gcc/cp/spew.c 2000/11/27 17:27:52
@@ -1385,7 +1385,7 @@ yyerror (msgid)
{
unsigned int val = TREE_INT_CST_LOW (yylval.ttype);
const char *ell = (last_token == CPP_CHAR) ? "" : "L";
- if (val <= UCHAR_MAX && ISGRAPH (val))
+ if (val <= UCHAR_MAX && isgraph (val))
error ("%s before %s'%c'", string, ell, val);
else
error ("%s before %s'\\x%x'", string, ell, val);
===================================================================
Index: gcc/cp/xref.c
--- gcc/cp/xref.c 2000/11/02 19:03:58 1.26
+++ gcc/cp/xref.c 2000/11/27 17:27:53
@@ -727,7 +727,7 @@ simplify_type(typ)
int lvl, i;
i = strlen(typ);
- while (i > 0 && ISSPACE((unsigned char) typ[i-1])) typ[--i] = 0;
+ while (i > 0 && isspace((unsigned char) typ[i-1])) typ[--i] = 0;
if (i > 7 && STREQL(&typ[i-5], "const"))
{
===================================================================
Index: gcc/f/bad.c
--- gcc/f/bad.c 2000/06/21 20:11:14 1.10
+++ gcc/f/bad.c 2000/11/27 17:27:53
@@ -457,11 +457,11 @@ ffebad_finish ()
if (ffebad_places_ == 0)
{
/* Didn't output "warning:" string, capitalize it for message. */
- if ((s[0] != '\0') && ISALPHA (s[0]) && ISLOWER (s[0]))
+ if ((s[0] != '\0') && isalpha (s[0]) && islower (s[0]))
{
char c;
- c = TOUPPER (s[0]);
+ c = toupper (s[0]);
fprintf (stderr, "%c%s ", c, &s[1]);
}
else if (s[0] != '\0')
@@ -486,7 +486,7 @@ ffebad_finish ()
if (c == '%')
{
c = ffebad_message_[++i];
- if (ISALPHA (c) && ISUPPER (c))
+ if (isalpha (c) && isupper (c))
{
index = c - 'A';
@@ -504,7 +504,7 @@ ffebad_finish ()
bufi = ffebad_bufputs_ (buf, bufi, s);
}
}
- else if (ISDIGIT (c))
+ else if (isdigit (c))
{
index = c - '0';
===================================================================
Index: gcc/f/expr.c
--- gcc/f/expr.c 2000/08/02 17:01:13 1.20
+++ gcc/f/expr.c 2000/11/27 17:27:53
@@ -9540,7 +9540,7 @@ static bool
ffeexpr_isdigits_ (const char *p)
{
for (; *p != '\0'; ++p)
- if (! ISDIGIT (*p))
+ if (! isdigit (*p))
return FALSE;
return TRUE;
}
===================================================================
Index: gcc/f/fini.c
--- gcc/f/fini.c 2000/07/27 15:58:01 1.14
+++ gcc/f/fini.c 2000/11/27 17:27:53
@@ -310,7 +310,7 @@ main (int argc, char **argv)
}
else if (cc != EOF)
{
- while (((cc = getc (in)) != EOF) && (! ISALNUM (cc)))
+ while (((cc = getc (in)) != EOF) && (! isalnum (cc)))
;
ungetc (cc, in);
break;
@@ -381,10 +381,10 @@ main (int argc, char **argv)
for (i = 0; i < newname->namelen; ++i)
{
cc = buf[i];
- if (ISALPHA (cc))
+ if (isalpha (cc))
{
- newname->name_uc[i] = TOUPPER (cc);
- newname->name_lc[i] = TOLOWER (cc);
+ newname->name_uc[i] = toupper (cc);
+ newname->name_lc[i] = tolower (cc);
newname->name_ic[i] = cc;
}
else
===================================================================
Index: gcc/f/implic.c
--- gcc/f/implic.c 1999/03/27 10:23:50 1.7
+++ gcc/f/implic.c 2000/11/27 17:27:53
@@ -92,7 +92,7 @@ static ffeimplic_
ffeimplic_lookup_ (unsigned char c)
{
/* NOTE: This is definitely ASCII-specific!! */
- if (ISALPHA (c) || (c == '_'))
+ if (isalpha (c) || (c == '_'))
return &ffeimplic_table_[c - 'A'];
return NULL;
}
===================================================================
Index: gcc/f/intrin.c
--- gcc/f/intrin.c 2000/02/26 20:02:01 1.15
+++ gcc/f/intrin.c 2000/11/27 17:27:53
@@ -1581,14 +1581,10 @@ ffeintrin_init_0 ()
p3 = ffeintrin_names_[i].name_ic;
for (; *p1 != '\0' && *p2 != '\0' && *p3 != '\0'; ++p1, ++p2, ++p3)
{
- if (! IN_CTYPE_DOMAIN (*p1)
- || ! IN_CTYPE_DOMAIN (*p2)
- || ! IN_CTYPE_DOMAIN (*p3))
- break;
- if ((ISDIGIT (*p1) || (*p1 == '_')) && (*p1 == *p2) && (*p1 == *p3))
+ if ((isdigit (*p1) || (*p1 == '_')) && (*p1 == *p2) && (*p1 == *p3))
continue;
- if (! ISUPPER ((unsigned char)*p1) || ! ISLOWER ((unsigned char)*p2)
- || (*p1 != TOUPPER (*p2))
+ if (! isupper ((unsigned char)*p1) || ! islower ((unsigned char)*p2)
+ || (*p1 != toupper (*p2))
|| ((*p3 != *p1) && (*p3 != *p2)))
break;
}
===================================================================
Index: gcc/f/lex.c
--- gcc/f/lex.c 2000/11/17 17:31:13 1.20
+++ gcc/f/lex.c 2000/11/27 17:27:53
@@ -766,7 +766,7 @@ ffelex_cfelex_ (ffelexToken *xtoken, FIL
r = &q[buffer_length];
}
c = ffelex_getc_ (finput);
- if (! ISDIGIT (c))
+ if (! isdigit (c))
break;
}
*p = '\0';
@@ -1124,8 +1124,8 @@ ffelex_hash_ (FILE *finput)
char * buff = buffer;
/* Read the pragma name into a buffer.
- ISSPACE() may evaluate its argument more than once! */
- while (((c = getc (finput)), ISSPACE(c)))
+ isspace() may evaluate its argument more than once! */
+ while (((c = getc (finput)), isspace(c)))
continue;
do
@@ -1133,7 +1133,7 @@ ffelex_hash_ (FILE *finput)
* buff ++ = c;
c = getc (finput);
}
- while (c != EOF && ! ISSPACE (c) && c != '\n'
+ while (c != EOF && ! isspace (c) && c != '\n'
&& buff < buffer + 128);
pragma_ungetc (c);
@@ -4353,7 +4353,7 @@ ffelex_splice_tokens (ffelexHandler firs
while (*p != '\0')
{
- if (ISDIGIT (*p))
+ if (isdigit (*p))
{
t = ffelex_token_number_from_names (master, i);
p += ffelex_token_length (t);
===================================================================
Index: gcc/f/lex.h
--- gcc/f/lex.h 1999/03/27 10:23:58 1.6
+++ gcc/f/lex.h 2000/11/27 17:27:53
@@ -172,7 +172,7 @@ ffelexToken ffelex_token_use (ffelexToke
#define ffelex_init_3()
#define ffelex_init_4()
#define ffelex_is_firstnamechar(c) \
- (ISALPHA ((c)) || ((c) == '_'))
+ (isalpha ((c)) || ((c) == '_'))
#define ffelex_terminate_0()
#define ffelex_terminate_1()
#define ffelex_terminate_2()
===================================================================
Index: gcc/f/proj.c
--- gcc/f/proj.c 2000/06/21 20:11:14 1.7
+++ gcc/f/proj.c 2000/11/27 17:27:53
@@ -32,7 +32,7 @@ strtoul (const char *nptr, char **endptr
assert (base == 10);
assert (endptr == NULL);
- while (ISDIGIT (*nptr))
+ while (isdigit (*nptr))
{
number = old_number * 10 + (*(nptr++) - '0');
if ((number <= old_number) && (old_number != 0))
===================================================================
Index: gcc/f/src.c
--- gcc/f/src.c 1999/09/16 22:20:43 1.7
+++ gcc/f/src.c 2000/11/27 17:27:53
@@ -120,10 +120,10 @@ ffesrc_init_1 ()
}
for (i = 'A'; i <= 'Z'; ++i)
- ffesrc_tolower_[i] = TOLOWER (i);
+ ffesrc_tolower_[i] = tolower (i);
for (i = 'a'; i <= 'z'; ++i)
- ffesrc_toupper_[i] = TOUPPER (i);
+ ffesrc_toupper_[i] = toupper (i);
ffesrc_check_symbol_ = (ffe_case_symbol () != FFE_caseNONE);
@@ -153,7 +153,7 @@ ffesrc_init_1 ()
if (ffesrc_ok_match_init_lower_)
for (i = 'a'; i <= 'z'; ++i)
- ffesrc_char_match_init_[i] = TOUPPER (i);
+ ffesrc_char_match_init_[i] = toupper (i);
else
for (i = 'a'; i <= 'z'; ++i)
ffesrc_char_match_init_[i] = FFESRC_INVALID_SYMBOL_CHAR_;
@@ -164,21 +164,21 @@ ffesrc_init_1 ()
if (ffesrc_ok_match_noninit_lower_)
for (i = 'a'; i <= 'z'; ++i)
- ffesrc_char_match_noninit_[i] = TOUPPER (i);
+ ffesrc_char_match_noninit_[i] = toupper (i);
else
for (i = 'a'; i <= 'z'; ++i)
ffesrc_char_match_noninit_[i] = FFESRC_INVALID_SYMBOL_CHAR_;
if (ffe_case_source () == FFE_caseLOWER)
for (i = 'A'; i <= 'Z'; ++i)
- ffesrc_char_source_[i] = TOLOWER (i);
+ ffesrc_char_source_[i] = tolower (i);
else if (ffe_case_source () == FFE_caseUPPER)
for (i = 'a'; i <= 'z'; ++i)
- ffesrc_char_source_[i] = TOUPPER (i);
+ ffesrc_char_source_[i] = toupper (i);
if (ffe_case_match () == FFE_caseLOWER)
for (i = 'A'; i <= 'Z'; ++i)
- ffesrc_char_internal_init_[i] = TOLOWER (i);
+ ffesrc_char_internal_init_[i] = tolower (i);
switch (ffe_case_symbol ())
{
===================================================================
Index: gcc/f/src.h
--- gcc/f/src.h 1999/02/15 18:17:21 1.5
+++ gcc/f/src.h 2000/11/27 17:27:53
@@ -87,9 +87,9 @@ extern bool ffesrc_ok_match_noninit_lowe
characters for which ffelex_is_firstnamechar returns TRUE. */
#define ffesrc_is_name_init(c) \
- ((ISALPHA ((c))) || (! (1 || ffe_is_90 ()) && ((c) == '_')))
+ ((isalpha ((c))) || (! (1 || ffe_is_90 ()) && ((c) == '_')))
#define ffesrc_is_name_noninit(c) \
- ((ISALNUM ((c))) || (! (1 || ffe_is_90 ()) && ((c) == '_')))
+ ((isalnum ((c))) || (! (1 || ffe_is_90 ()) && ((c) == '_')))
/* Test if source-translated character matches given alphabetic character
(passed in both uppercase and lowercase, to allow for custom speedup
===================================================================
Index: gcc/f/stb.c
--- gcc/f/stb.c 1999/04/19 22:27:03 1.12
+++ gcc/f/stb.c 2000/11/27 17:27:54
@@ -1915,7 +1915,7 @@ ffestb_do (ffelexToken t)
goto bad_1; /* :::::::::::::::::::: */
case FFELEX_typeOPEN_PAREN: /* Must be "DO" label "WHILE". */
- if (! ISDIGIT (*p))
+ if (! isdigit (*p))
goto bad_i; /* :::::::::::::::::::: */
ffesta_tokens[1] = ffelex_token_number_from_names (ffesta_tokens[0],
i);
@@ -1938,7 +1938,7 @@ ffestb_do (ffelexToken t)
ffesta_tokens[1] = NULL;
return (ffelexHandler) ffestb_do2_;
}
- if (! ISDIGIT (*p))
+ if (! isdigit (*p))
goto bad_i; /* :::::::::::::::::::: */
ffesta_tokens[1] = ffelex_token_number_from_names (ffesta_tokens[0],
i);
@@ -1949,7 +1949,7 @@ ffestb_do (ffelexToken t)
return (ffelexHandler) ffestb_do2_;
case FFELEX_typeEQUALS:
- if (ISDIGIT (*p))
+ if (isdigit (*p))
{
ffesta_tokens[1]
= ffelex_token_number_from_names (ffesta_tokens[0], i);
@@ -1971,7 +1971,7 @@ ffestb_do (ffelexToken t)
case FFELEX_typeEOS:
case FFELEX_typeSEMICOLON:
ffesta_confirmed ();
- if (ISDIGIT (*p))
+ if (isdigit (*p))
{
ffesta_tokens[1]
= ffelex_token_number_from_names (ffesta_tokens[0], i);
@@ -3368,7 +3368,7 @@ ffestb_goto (ffelexToken t)
if (ffelex_token_length (ffesta_tokens[0]) != FFESTR_firstlGOTO)
{
p = ffelex_token_text (ffesta_tokens[0]) + (i = FFESTR_firstlGOTO);
- if (ISDIGIT (*p))
+ if (isdigit (*p))
{
nt = ffelex_token_number_from_names (ffesta_tokens[0], i);
p += ffelex_token_length (nt);
@@ -6695,7 +6695,7 @@ ffestb_R838 (ffelexToken t)
case FFELEX_typePERCENT:
case FFELEX_typeOPEN_PAREN:
p = ffelex_token_text (ffesta_tokens[0]) + (i = FFESTR_firstlASSIGN);
- if (! ISDIGIT (*p))
+ if (! isdigit (*p))
goto bad_i; /* :::::::::::::::::::: */
ffesta_tokens[1]
= ffelex_token_number_from_names (ffesta_tokens[0], i);
@@ -9692,7 +9692,7 @@ ffestb_R10014_ (ffelexToken t)
p = ffelex_token_text (t) + i;
if (*p == '\0')
return (ffelexHandler) ffestb_R10015_;
- if (! ISDIGIT (*p))
+ if (! isdigit (*p))
{
if (ffestb_local_.format.current == FFESTP_formattypeH)
p = strpbrk (p, "0123456789");
@@ -9771,7 +9771,7 @@ ffestb_R10014_ (ffelexToken t)
p = ffelex_token_text (t) + i;
if (*p == '\0')
return (ffelexHandler) ffestb_R10015_;
- if (! ISDIGIT (*p))
+ if (! isdigit (*p))
{
ffestb_local_.format.current = FFESTP_formattypeNone;
p = strpbrk (p, "0123456789");
@@ -10051,7 +10051,7 @@ ffestb_R10015_ (ffelexToken t)
p = ffelex_token_text (t) + i;
if (*p == '\0')
return (ffelexHandler) ffestb_R10015_;
- if (! ISDIGIT (*p))
+ if (! isdigit (*p))
{
ffestb_local_.format.current = FFESTP_formattypeNone;
p = strpbrk (p, "0123456789");
@@ -10225,7 +10225,7 @@ ffestb_R10018_ (ffelexToken t)
if (*++p == '\0')
return (ffelexHandler) ffestb_R10019_; /* Go get NUMBER. */
i = 1;
- if (! ISDIGIT (*p))
+ if (! isdigit (*p))
{
ffesta_ffebad_1p (FFEBAD_FORMAT_TEXT_IN_NUMBER, t, 1, NULL);
return (ffelexHandler) ffestb_R10018_;
@@ -11908,7 +11908,7 @@ ffestb_R12026_ (ffelexToken t)
default:
for (p = ffelex_token_text (ffesta_tokens[2]); *p != '\0'; ++p)
{
- if (! ISALPHA (*p))
+ if (! isalpha (*p))
{
ffelex_token_kill (ffesta_tokens[1]);
ffelex_token_kill (ffesta_tokens[2]);
@@ -12015,7 +12015,7 @@ ffestb_S3P4 (ffelexToken t)
ffeexpr_rhs (ffesta_output_pool, FFEEXPR_contextINCLUDE,
(ffeexprCallback) ffestb_S3P41_)))
(t);
- if (! ISDIGIT (*p))
+ if (! isdigit (*p))
goto bad_i; /* :::::::::::::::::::: */
nt = ffelex_token_number_from_names (ffesta_tokens[0], i);
p += ffelex_token_length (nt);
@@ -12448,7 +12448,7 @@ ffestb_V025 (ffelexToken t)
break;
}
p = ffelex_token_text (ffesta_tokens[0]) + (i = FFESTR_firstlDEFINEFILE);
- if (ISDIGIT (*p))
+ if (isdigit (*p))
nt = ffelex_token_number_from_names (ffesta_tokens[0], i);
else if (ffesrc_is_name_init (*p))
nt = ffelex_token_name_from_names (ffesta_tokens[0], i, 0);
@@ -17985,7 +17985,7 @@ ffestb_V020 (ffelexToken t)
break;
}
p = ffelex_token_text (ffesta_tokens[0]) + (i = FFESTR_firstlTYPE);
- if (ISDIGIT (*p))
+ if (isdigit (*p))
ffesta_confirmed (); /* Else might be '90 TYPE statement. */
for (ix = 0; ix < FFESTP_typeix; ++ix)
ffestp_file.type.type_spec[ix].kw_or_val_present = FALSE;
===================================================================
Index: gcc/f/target.c
--- gcc/f/target.c 2000/06/21 20:11:14 1.13
+++ gcc/f/target.c 2000/11/27 17:27:54
@@ -130,7 +130,7 @@ ffetarget_print_char_ (FILE *f, unsigned
break;
default:
- if (ISPRINT (c))
+ if (isprint (c))
fputc (c, f);
else
fprintf (f, "\\%03o", (unsigned int) c);
@@ -2394,7 +2394,7 @@ ffetarget_typeless_binary (ffetargetType
new_value <<= 1;
if ((new_value >> 1) != value)
overflow = TRUE;
- if (ISDIGIT (c))
+ if (isdigit (c))
new_value += c - '0';
else
bad_digit = TRUE;
@@ -2438,7 +2438,7 @@ ffetarget_typeless_octal (ffetargetTypel
new_value <<= 3;
if ((new_value >> 3) != value)
overflow = TRUE;
- if (ISDIGIT (c))
+ if (isdigit (c))
new_value += c - '0';
else
bad_digit = TRUE;
@@ -2482,7 +2482,7 @@ ffetarget_typeless_hex (ffetargetTypeles
new_value <<= 4;
if ((new_value >> 4) != value)
overflow = TRUE;
- if (ISDIGIT (c))
+ if (isdigit (c))
new_value += c - '0';
else if ((c >= 'A') && (c <= 'F'))
new_value += c - 'A' + 10;
===================================================================
Index: gcc/f/top.c
--- gcc/f/top.c 2000/08/19 13:20:07 1.23
+++ gcc/f/top.c 2000/11/27 17:27:54
@@ -151,7 +151,7 @@ ffe_is_digit_string_ (char *s)
{
char *p;
- for (p = s; ISDIGIT (*p); ++p)
+ for (p = s; isdigit (*p); ++p)
;
return (p != s) && (*p == '\0');
===================================================================
Index: gcc/fixinc/fixincl.c
--- gcc/fixinc/fixincl.c 2000/11/17 04:16:55 1.42
+++ gcc/fixinc/fixincl.c 2000/11/27 17:27:54
@@ -139,7 +139,7 @@ main (argc, argv)
/* skip to start of name, past any "./" prefixes */
- while (ISSPACE (*file_name_buf)) file_name_buf++;
+ while (isspace (*file_name_buf)) file_name_buf++;
while ((file_name_buf[0] == '.') && (file_name_buf[1] == '/'))
file_name_buf += 2;
@@ -157,7 +157,7 @@ main (argc, argv)
else
file_name_buf = pz_end + 1;
- while ((pz_end > pz_curr_file) && ISSPACE( pz_end[-1])) pz_end--;
+ while ((pz_end > pz_curr_file) && isspace( pz_end[-1])) pz_end--;
/* IF no name is found (blank line) or comment marker, skip line */
@@ -701,7 +701,7 @@ quoted_file_exists (pz_src_path, pz_file
for (;;) {
char ch = *pz_file++;
- if (! ISGRAPH( ch ))
+ if (! isgraph( ch ))
return 0;
if (ch == '"')
break;
@@ -764,10 +764,10 @@ extract_quoted_files (pz_data, pz_fixed_
pz_incl_quot += p_re_match->rm_so;
/* Skip forward to the included file name */
- while (ISSPACE (*pz_incl_quot))
+ while (isspace (*pz_incl_quot))
pz_incl_quot++;
- /* ISSPACE() may evaluate its argument more than once! */
- while (++pz_incl_quot, ISSPACE (*pz_incl_quot))
+ /* isspace() may evaluate its argument more than once! */
+ while (++pz_incl_quot, isspace (*pz_incl_quot))
;
pz_incl_quot += sizeof ("include") - 1;
while (*pz_incl_quot++ != '"')
===================================================================
Index: gcc/fixinc/fixlib.h
--- gcc/fixinc/fixlib.h 2000/09/12 14:28:27 1.18
+++ gcc/fixinc/fixlib.h 2000/11/27 17:27:54
@@ -25,6 +25,8 @@ Boston, MA 02111-1307, USA. */
#ifndef FIXINCLUDES_FIXLIB_H
#define FIXINCLUDES_FIXLIB_H
+#define GENERATOR_FILE
+
#include "auto-host.h"
#include "gansidecl.h"
#include "system.h"
===================================================================
Index: gcc/fixinc/server.c
--- gcc/fixinc/server.c 2000/06/02 17:25:47 1.15
+++ gcc/fixinc/server.c 2000/11/27 17:27:54
@@ -168,7 +168,7 @@ load_data (fp)
return (char *) NULL;
}
- while ((pz_scan > pz_text) && ISSPACE (pz_scan[-1]))
+ while ((pz_scan > pz_text) && isspace (pz_scan[-1]))
pz_scan--;
*pz_scan = NUL;
return realloc ((void *) pz_text, strlen (pz_text) + 1);
===================================================================
Index: gcc/java/class.c
--- gcc/java/class.c 2000/11/04 04:56:25 1.80
+++ gcc/java/class.c 2000/11/27 17:27:54
@@ -834,7 +834,7 @@ build_utf8_ref (name)
unsigned char c = *name_ptr++;
if (c & 0x80)
continue;
- if (!ISALPHA(c) && !ISDIGIT(c))
+ if (!isalpha(c) && !isdigit(c))
c = '_';
*buf_ptr++ = c;
if (buf_ptr >= buf + 50)
===================================================================
Index: gcc/java/jcf-dump.c
--- gcc/java/jcf-dump.c 2000/11/26 19:30:31 1.35
+++ gcc/java/jcf-dump.c 2000/11/27 17:27:55
@@ -591,7 +591,7 @@ DEFUN(print_signature_type, (stream, ptr
{
case '[':
array_size = -1;
- for ((*ptr)++; (*ptr) < limit && ISDIGIT (**ptr); (*ptr)++)
+ for ((*ptr)++; (*ptr) < limit && isdigit (**ptr); (*ptr)++)
{
array_size = (array_size < 0 ? 0 : 10 * array_size) + *(*ptr) - '0';
}
===================================================================
Index: gcc/java/jvgenmain.c
--- gcc/java/jvgenmain.c 2000/10/13 21:06:45 1.17
+++ gcc/java/jvgenmain.c 2000/11/27 17:27:55
@@ -144,7 +144,7 @@ main (int argc, const char **argv)
fprintf (stream, " \"");
for (p = &argv[i][2]; *p; ++p)
{
- if (! isascii (*p))
+ if (! isprint (*p))
fprintf (stream, "\\%o", *p);
else if (*p == '\\' || *p == '"')
fprintf (stream, "\\%c", *p);
===================================================================
Index: gcc/java/typeck.c
--- gcc/java/typeck.c 2000/10/13 06:26:46 1.33
+++ gcc/java/typeck.c 2000/11/27 17:27:55
@@ -512,7 +512,7 @@ parse_signature_type (ptr, limit)
case 'Z': (*ptr)++; return boolean_type_node;
case 'V': (*ptr)++; return void_type_node;
case '[':
- for ((*ptr)++; (*ptr) < limit && ISDIGIT (**ptr); ) (*ptr)++;
+ for ((*ptr)++; (*ptr) < limit && isdigit (**ptr); ) (*ptr)++;
type = parse_signature_type (ptr, limit);
type = build_java_array_type (type, -1);
break;
===================================================================
Index: include/safe-ctype.h
--- include/safe-ctype.h Tue May 5 13:32:27 1998
+++ include/safe-ctype.h Mon Nov 27 09:28:00 2000
@@ -0,0 +1,102 @@
+/* <ctype.h> replacement macros.
+
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ Contributed by Zack Weinberg <zackw@stanford.edu>.
+
+This file is part of the libiberty library.
+Libiberty is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+Libiberty is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with libiberty; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* This is a compatible replacement of the standard C library's <ctype.h>
+ with the following properties:
+
+ - Implements all isxxx() macros required by C99.
+ - Also implements some character classes useful when
+ parsing C-like languages.
+ - Does not change behavior depending on the current locale.
+ - Behaves properly for all values in the range of a signed or
+ unsigned char.
+
+ You must not include this header and ctype.h in the same
+ translation unit. */
+
+#ifndef SAFE_CTYPE_H
+#define SAFE_CTYPE_H
+
+#ifdef isalpha
+ #error "safe-ctype.h and ctype.h may not be used simultaneously"
+#else
+
+/* Categories. */
+
+enum {
+ /* In C99 */
+ _sch_isalnum = 0x0001, /* A-Za-z0-9 */
+ _sch_isalpha = 0x0002, /* A-Za-z */
+ _sch_isblank = 0x0004, /* space \t */
+ _sch_iscntrl = 0x0008, /* nonprinting characters */
+ _sch_isdigit = 0x0010, /* 0-9 */
+ _sch_isgraph = 0x0020, /* any printing character except ' ' */
+ _sch_islower = 0x0040, /* a-z */
+ _sch_isprint = 0x0080, /* any printing character including ' ' */
+ _sch_ispunct = 0x0100, /* !isspace && !isalnum */
+ _sch_isspace = 0x0200, /* space \t \n \r \f \v */
+ _sch_isupper = 0x0400, /* A-Z */
+ _sch_isxdigit = 0x0800, /* 0-9A-Fa-f */
+
+ /* Extra categories useful to cpplib. */
+ _sch_isidnum = 0x1000, /* A-Za-z0-9_ */
+ _sch_isidst = 0x2000, /* A-Za-z_ */
+ _sch_isvsp = 0x4000, /* \n \r */
+ _sch_isnvsp = 0x8000 /* space \t \f \v \0 */
+};
+
+/* This code fundamentally assumes that a byte is 8 bits. Test this
+ at compile time. */
+
+extern int a_byte_isnt_eight_bits[(unsigned char)256 == 0 ? 1 : -1];
+
+/* Character classification. */
+extern const unsigned short _sch_istable[256];
+
+#define _sch_test(c, bit) (_sch_istable[(int)(unsigned char)(c)] & (bit))
+
+#define isalpha(c) _sch_test(c, _sch_isalpha)
+#define isalnum(c) _sch_test(c, _sch_isalnum)
+#define isblank(c) _sch_test(c, _sch_isblank)
+#define iscntrl(c) _sch_test(c, _sch_iscntrl)
+#define isdigit(c) _sch_test(c, _sch_isdigit)
+#define isgraph(c) _sch_test(c, _sch_isgraph)
+#define islower(c) _sch_test(c, _sch_islower)
+#define isprint(c) _sch_test(c, _sch_isprint)
+#define ispunct(c) _sch_test(c, _sch_ispunct)
+#define isspace(c) _sch_test(c, _sch_isspace)
+#define isupper(c) _sch_test(c, _sch_isupper)
+#define isxdigit(c) _sch_test(c, _sch_isxdigit)
+
+#define isidnum(c) _sch_test(c, _sch_isidnum)
+#define isidst(c) _sch_test(c, _sch_isidst)
+#define is_vspace(c) _sch_test(c, _sch_isvsp)
+#define is_nvspace(c) _sch_test(c, _sch_isnvsp)
+#define is_space(c) _sch_test(c, _sch_isvsp|_sch_isnvsp)
+
+/* Character transformation. */
+extern const unsigned char _sch_toupper[256];
+extern const unsigned char _sch_tolower[256];
+#define toupper(c) _sch_toupper[(int)(unsigned char)(c)]
+#define tolower(c) _sch_tolower[(int)(unsigned char)(c)]
+
+#endif /* no ctype.h */
+#endif /* SAFE_CTYPE_H */
===================================================================
Index: libiberty/Makefile.in
--- libiberty/Makefile.in 2000/08/29 04:35:59 1.54
+++ libiberty/Makefile.in 2000/11/27 17:28:00
@@ -128,22 +128,22 @@ CFILES = asprintf.c alloca.c argv.c atex
bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c \
cp-demangle.c dyn-string.c fdmatch.c fnmatch.c getcwd.c \
getpwd.c getopt.c getopt1.c getpagesize.c getruntime.c \
- floatformat.c hashtab.c hex.c index.c insque.c md5.c memchr.c memcmp.c\
- memcpy.c memmove.c memset.c mkstemps.c objalloc.c obstack.c \
+ floatformat.c hashtab.c hex.c index.c insque.c md5.c memchr.c \
+ memcmp.c memcpy.c memmove.c memset.c mkstemps.c objalloc.c obstack.c \
partition.c pexecute.c putenv.c random.c rename.c rindex.c setenv.c \
- sigsetmask.c sort.c spaces.c splay-tree.c strcasecmp.c strncasecmp.c \
- strchr.c strdup.c strerror.c strncmp.c strrchr.c strsignal.c strstr.c \
- strtod.c strtol.c strtoul.c tmpnam.c vasprintf.c vfork.c vfprintf.c \
- vprintf.c vsprintf.c waitpid.c xatexit.c xexit.c xmalloc.c \
- xmemdup.c xstrdup.c xstrerror.c
+ sigsetmask.c safe-ctype.c sort.c spaces.c splay-tree.c strcasecmp.c \
+ strncasecmp.c strchr.c strdup.c strerror.c strncmp.c strrchr.c \
+ strsignal.c strstr.c strtod.c strtol.c strtoul.c tmpnam.c vasprintf.c \
+ vfork.c vfprintf.c vprintf.c vsprintf.c waitpid.c xatexit.c xexit.c \
+ xmalloc.c xmemdup.c xstrdup.c xstrerror.c
# These are always included in the library.
-REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o cp-demangle.o \
- dyn-string.o fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o \
+REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o cp-demangle.o \
+ dyn-string.o fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o \
getruntime.o hashtab.o hex.o floatformat.o md5.o objalloc.o obstack.o \
- partition.o pexecute.o sort.o spaces.o splay-tree.o strerror.o \
- strsignal.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o \
- xstrerror.o
+ partition.o pexecute.o safe-ctype.o sort.o spaces.o splay-tree.o \
+ strerror.o strsignal.o xatexit.o xexit.o xmalloc.o xmemdup.o \
+ xstrdup.o xstrerror.o
$(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA)
rm -f $(TARGETLIB)
===================================================================
Index: libiberty/safe-ctype.c
--- libiberty/safe-ctype.c Tue May 5 13:32:27 1998
+++ libiberty/safe-ctype.c Mon Nov 27 09:28:00 2000
@@ -0,0 +1,165 @@
+/* <ctype.h> replacement macros.
+
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ Contributed by Zack Weinberg <zackw@stanford.edu>.
+
+This file is part of the libiberty library.
+Libiberty is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+Libiberty is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with libiberty; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* This is a compatible replacement of the standard C library's <ctype.h>
+ with the following properties:
+
+ - Implements all isxxx() macros required by C99.
+ - Also implements some character classes useful when
+ parsing C-like languages.
+ - Does not change behavior depending on the current locale.
+ - Behaves properly for all values in the range of a signed or
+ unsigned char. */
+
+#include <safe-ctype.h>
+
+/* Shorthand */
+#define al _sch_isalpha
+#define an _sch_isalnum
+#define bl _sch_isblank
+#define cn _sch_iscntrl
+#define di _sch_isdigit
+#define gr _sch_isgraph
+#define id _sch_isidnum
+#define is _sch_isidst
+#define lo _sch_islower
+#define nv _sch_isnvsp
+#define pn _sch_ispunct
+#define pr _sch_isprint
+#define sp _sch_isspace
+#define up _sch_isupper
+#define vs _sch_isvsp
+#define xd _sch_isxdigit
+
+/* Masks. */
+#define L lo|al|an|id|is|gr|pr /* lower case letter */
+#define U up|al|an|id|is|gr|pr /* upper case letter */
+#define D di|xd|an|id|gr|pr /* decimal digit */
+#define XL xd|L /* lowercase hex digit */
+#define XU xd|U /* uppercase hex digit */
+#define P pn|gr|pr /* punctuation */
+#define _ pn|gr|pr|id|is /* underscore */
+
+#define C cn /* control character */
+#define M nv|sp|cn /* cursor movement: \f \v */
+#define Z nv|cn /* NUL */
+#define T nv|sp|cn|bl /* tab */
+#define S nv|sp|pr|bl /* space */
+#define V vs|sp|cn /* vertical space: \r \n */
+
+
+/* Are we ASCII? */
+#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
+ && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21
+
+const unsigned short _sch_istable[256] =
+{
+ Z, C, C, C, C, C, C, C, /* NUL SOH STX ETX EOT ENQ ACK BEL */
+ C, T, V, M, M, V, C, C, /* BS HT LF VT FF CR SO SI */
+ C, C, C, C, C, C, C, C, /* DLE DC1 DC2 DC3 DC4 NAK SYN ETB */
+ C, C, C, C, C, C, C, C, /* CAN EM SUB ESC FS GS RS US */
+ S, P, P, P, P, P, P, P, /* SP ! " # $ % & ' */
+ P, P, P, P, P, P, P, P, /* ( ) * + , - . / */
+ D, D, D, D, D, D, D, D, /* 0 1 2 3 4 5 6 7 */
+ D, D, P, P, P, P, P, P, /* 8 9 : ; < = > ? */
+ P, XU, XU, XU, XU, XU, XU, U, /* @ A B C D E F G */
+ U, U, U, U, U, U, U, U, /* H I J K L M N O */
+ U, U, U, U, U, U, U, U, /* P Q R S T U V W */
+ U, U, U, P, P, P, P, _, /* X Y Z [ \ ] ^ _ */
+ P, XL, XL, XL, XL, XL, XL, L, /* ` a b c d e f g */
+ L, L, L, L, L, L, L, L, /* h i j k l m n o */
+ L, L, L, L, L, L, L, L, /* p q r s t u v w */
+ L, L, L, P, P, P, P, C, /* x y z { | } ~ DEL */
+
+ /* high half of unsigned char is locale-specific, so all tests are
+ false in "C" locale */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+const unsigned char _sch_tolower[256] =
+{
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64,
+
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
+ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+
+ 91, 92, 93, 94, 95, 96,
+
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
+ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+
+ 123,124,125,126,127,
+
+ 128,129,130,131, 132,133,134,135, 136,137,138,139, 140,141,142,143,
+ 144,145,146,147, 148,149,150,151, 152,153,154,155, 156,157,158,159,
+ 160,161,162,163, 164,165,166,167, 168,169,170,171, 172,173,174,175,
+ 176,177,178,179, 180,181,182,183, 184,185,186,187, 188,189,190,191,
+
+ 192,193,194,195, 196,197,198,199, 200,201,202,203, 204,205,206,207,
+ 208,209,210,211, 212,213,214,215, 216,217,218,219, 220,221,222,223,
+ 224,225,226,227, 228,229,230,231, 232,233,234,235, 236,237,238,239,
+ 240,241,242,243, 244,245,246,247, 248,249,250,251, 252,253,254,255,
+};
+
+const unsigned char _sch_toupper[256] =
+{
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64,
+
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+
+ 91, 92, 93, 94, 95, 96,
+
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+
+ 123,124,125,126,127,
+
+ 128,129,130,131, 132,133,134,135, 136,137,138,139, 140,141,142,143,
+ 144,145,146,147, 148,149,150,151, 152,153,154,155, 156,157,158,159,
+ 160,161,162,163, 164,165,166,167, 168,169,170,171, 172,173,174,175,
+ 176,177,178,179, 180,181,182,183, 184,185,186,187, 188,189,190,191,
+
+ 192,193,194,195, 196,197,198,199, 200,201,202,203, 204,205,206,207,
+ 208,209,210,211, 212,213,214,215, 216,217,218,219, 220,221,222,223,
+ 224,225,226,227, 228,229,230,231, 232,233,234,235, 236,237,238,239,
+ 240,241,242,243, 244,245,246,247, 248,249,250,251, 252,253,254,255,
+};
+
+#else
+ #error "Unsupported host character set"
+#endif /* not ASCII */