genautomata.c: Don't include ctype.h or limits.h.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sun, 9 Jun 2002 02:12:21 +0000 (02:12 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sun, 9 Jun 2002 02:12:21 +0000 (02:12 +0000)
* 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.

From-SVN: r54392

gcc/ChangeLog
gcc/genautomata.c
gcc/gengtype-lex.l
gcc/gengtype.c
gcc/read-rtl.c

index 411ed86e662d3645637a3140e227204e0b08514b..0598383b62cd5f1fe56963f5cd7940c594da74af 100644 (file)
@@ -1,3 +1,13 @@
+2002-06-08  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * 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  <zack@codesourcery.com>
 
        * Makefile.in (LIBCPP_OBJS): Take out version.o.
index 900cfb610c314c4e4ec10ce911eb12202e9c19e7..f2235f368ff5591c585bb0b553293503385fc7e6 100644 (file)
@@ -106,18 +106,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "obstack.h"
 #include "errors.h"
 
-#include <ctype.h>
 #include <math.h>
 #include "hashtab.h"
 #include "varray.h"
 
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#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
        {
index 4f81a6820c00dd05be81b0616fd8112b46397892..c6383760197d4987febda5a427793748d002541d 100644 (file)
@@ -25,7 +25,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include "hconfig.h"
 #include "system.h"
-#include <ctype.h>
 #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);
index eac1605a1eca1f2e7690b2e7ed9527a2bd996624..5e910df382f668f1f41cc69fe72c9a82d6579b5b 100644 (file)
@@ -20,7 +20,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include "hconfig.h"
 #include "system.h"
-#include <ctype.h>
 #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);
index 5db7b99a409b140ac141a8f0353b70d27ea581c6..03b0f7d4b0dd4d765cf2671b7c65a9a640227597 100644 (file)
@@ -25,12 +25,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "obstack.h"
 #include "hashtab.h"
 
-#ifndef ISDIGIT
-#include <ctype.h>
-#define ISDIGIT isdigit
-#define ISSPACE isspace
-#endif
-
 #define        obstack_chunk_alloc     xmalloc
 #define        obstack_chunk_free      free