diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 411ed86e662..0598383b62c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2002-06-08 Kaveh R. Ghazi + + * genautomata.c: Don't include ctype.h or limits.h. Use ISSPACE, + not isspace. + * gengtype-lex.l: Don't include ctype.h and use ISSPACE/ISIDNUM in + lieu of isspace/IDchar. + * gengtype.c: Likewise for ctype.h and ISALNUM vs isalnum. + * read-rtl.c: Likewise for ctype.h. Don't define ISDIGIT or + ISSPACE. + 2002-06-08 Zack Weinberg * Makefile.in (LIBCPP_OBJS): Take out version.o. diff --git a/gcc/genautomata.c b/gcc/genautomata.c index 900cfb610c3..f2235f368ff 100644 --- a/gcc/genautomata.c +++ b/gcc/genautomata.c @@ -106,18 +106,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "obstack.h" #include "errors.h" -#include #include #include "hashtab.h" #include "varray.h" -#ifdef HAVE_LIMITS_H -#include -#else #ifndef CHAR_BIT #define CHAR_BIT 8 #endif -#endif #include "genattrtab.h" @@ -1301,7 +1296,7 @@ next_sep_el (pstr, sep, par_flag) int n_spaces; /* Remove leading whitespaces. */ - while (isspace ((int) **pstr)) + while (ISSPACE ((int) **pstr)) (*pstr)++; if (**pstr == '\0') @@ -1316,7 +1311,7 @@ next_sep_el (pstr, sep, par_flag) pars_num--; else if (pars_num == 0 && *p == sep) break; - if (pars_num == 0 && isspace ((int) *p)) + if (pars_num == 0 && ISSPACE ((int) *p)) n_spaces++; else { diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l index 4f81a6820c0..c6383760197 100644 --- a/gcc/gengtype-lex.l +++ b/gcc/gengtype-lex.l @@ -25,7 +25,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "hconfig.h" #include "system.h" -#include #include "gengtype.h" #include "gengtype-yacc.h" @@ -44,7 +43,6 @@ update_lineno (l, len) lexer_line.line++; } -#define IDchar(c) (isalnum(c) || (c) == '_') %} ID [[:alpha:]][[:alnum:]_]* @@ -67,20 +65,20 @@ ITYPE {IWORD}({WS}{IWORD})* int union_p; tagstart = yytext + strlen (" typedef "); - while (isspace (*tagstart)) + while (ISSPACE (*tagstart)) tagstart++; union_p = tagstart[0] == 'u'; tagstart += strlen ("union "); - while (isspace (*tagstart)) + while (ISSPACE (*tagstart)) tagstart++; - for (taglen = 1; IDchar (tagstart[taglen]); taglen++) + for (taglen = 1; ISIDNUM (tagstart[taglen]); taglen++) ; for (namestart = tagstart + taglen; - ! IDchar (*namestart); + ! ISIDNUM (*namestart); namestart++) if (*namestart == '*') is_pointer = 1; - for (namelen = 1; IDchar (namestart[namelen]); namelen++) + for (namelen = 1; ISIDNUM (namestart[namelen]); namelen++) ; t = find_structure (xmemdup (tagstart, taglen, taglen+1), union_p); if (is_pointer) @@ -97,17 +95,17 @@ ITYPE {IWORD}({WS}{IWORD})* char *typestart; size_t typelen; - for (namestart = yytext + yyleng - 2; isspace (*namestart); namestart--) + for (namestart = yytext + yyleng - 2; ISSPACE (*namestart); namestart--) ; - for (namelen = 1; !isspace (namestart[-namelen]); namelen++) + for (namelen = 1; !ISSPACE (namestart[-namelen]); namelen++) ; namestart -= namelen - 1; for (typestart = yytext + strlen (" typedef "); - isspace(*typestart); + ISSPACE(*typestart); typestart++) ; for (typelen = namestart - typestart; - isspace(typestart[typelen-1]); + ISSPACE(typestart[typelen-1]); typelen--) ; @@ -121,9 +119,9 @@ ITYPE {IWORD}({WS}{IWORD})* size_t namelen; struct type *t; - for (namestart = yytext + yyleng - 7; isspace (*namestart); namestart--) + for (namestart = yytext + yyleng - 7; ISSPACE (*namestart); namestart--) ; - for (namelen = 1; !isspace (namestart[-namelen]); namelen++) + for (namelen = 1; !ISSPACE (namestart[-namelen]); namelen++) ; namestart -= namelen - 1; @@ -136,9 +134,9 @@ ITYPE {IWORD}({WS}{IWORD})* size_t namelen; struct type *t; - for (namestart = yytext + yyleng - 7; !IDchar (*namestart); namestart--) + for (namestart = yytext + yyleng - 7; !ISIDNUM (*namestart); namestart--) ; - for (namelen = 1; IDchar (namestart[-namelen]); namelen++) + for (namelen = 1; ISIDNUM (namestart[-namelen]); namelen++) ; namestart -= namelen - 1; @@ -156,7 +154,7 @@ ITYPE {IWORD}({WS}{IWORD})* typedef_p = yytext[1] == 't'; if (typedef_p) for (tagstart = yytext + strlen (" typedef "); - isspace(*tagstart); + ISSPACE(*tagstart); tagstart++) ; else @@ -164,9 +162,9 @@ ITYPE {IWORD}({WS}{IWORD})* union_p = tagstart[0] == 'u'; tagstart += strlen ("union "); - while (isspace (*tagstart)) + while (ISSPACE (*tagstart)) tagstart++; - for (taglen = 1; IDchar (tagstart[taglen]); taglen++) + for (taglen = 1; ISIDNUM (tagstart[taglen]); taglen++) ; yylval.t = find_structure (xmemdup (tagstart, taglen, taglen + 1), union_p); @@ -209,7 +207,7 @@ ITYPE {IWORD}({WS}{IWORD})* "ENUM_BITFIELD"{WS}?"("{WS}?{ID}{WS}?")" { size_t len; - for (len = yyleng; isspace (yytext[len-1]); len--) + for (len = yyleng; ISSPACE (yytext[len-1]); len--) ; yylval.t = create_scalar_type (yytext, len); diff --git a/gcc/gengtype.c b/gcc/gengtype.c index eac1605a1ec..5e910df382f 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -20,7 +20,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "hconfig.h" #include "system.h" -#include #include "gengtype.h" /* Nonzero iff an error has occurred. */ @@ -687,7 +686,7 @@ get_output_file_with_visibility (input_file) fm->output_name = s = xmalloc (sizeof ("gt-") + len); sprintf (s, "gt-%s", basename); for (; *s != '.'; s++) - if (! isalnum (*s) && *s != '-') + if (! ISALNUM (*s) && *s != '-') *s = '-'; memcpy (s, ".h", sizeof (".h")); } @@ -1435,7 +1434,7 @@ put_mangled_filename (f, fn) { const char *name = get_output_file_name (fn); for (; *name != 0; name++) - if (isalnum (*name)) + if (ISALNUM (*name)) fputc (*name, f); else fputc ('_', f); diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c index 5db7b99a409..03b0f7d4b0d 100644 --- a/gcc/read-rtl.c +++ b/gcc/read-rtl.c @@ -25,12 +25,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "obstack.h" #include "hashtab.h" -#ifndef ISDIGIT -#include -#define ISDIGIT isdigit -#define ISSPACE isspace -#endif - #define obstack_chunk_alloc xmalloc #define obstack_chunk_free free