mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-18 20:11:32 +08:00
genautomata.c: Don't include ctype.h or limits.h.
* 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
This commit is contained in:
parent
f210d2390d
commit
1f8e46828a
@ -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.
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user