Commit faa25e97 by Kaveh R. Ghazi Committed by Kaveh Ghazi

error.c: Convert to using ctype macros defined in system.h.

        * error.c: Convert to using ctype macros defined in system.h.
        * method.c: Likewise.
        * xref.c: Likewise.
        * lex.c: Likewise.  Also remove redundant system header stuff.

From-SVN: r19577
parent f8676b5d
Wed May 6 14:28:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* error.c: Convert to using ctype macros defined in system.h.
* method.c: Likewise.
* xref.c: Likewise.
* lex.c: Likewise. Also remove redundant system header stuff.
Wed May 6 06:36:41 1998 Robert Lipe <robertl@dgii.com> Wed May 6 06:36:41 1998 Robert Lipe <robertl@dgii.com>
* call.c, class.c, decl.c, decl2.c, errfn.c, error.c, except.c, * call.c, class.c, decl.c, decl2.c, errfn.c, error.c, except.c,
......
/* Call-backs for C++ error reporting. /* Call-backs for C++ error reporting.
This code is non-reentrant. This code is non-reentrant.
Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. Copyright (C) 1993, 94-97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -1143,7 +1143,7 @@ dump_char (c) ...@@ -1143,7 +1143,7 @@ dump_char (c)
OB_PUTS ("\\\""); OB_PUTS ("\\\"");
break; break;
default: default:
if (isprint (c)) if (ISPRINT (c))
OB_PUTC (c); OB_PUTC (c);
else else
{ {
......
/* Separate lexical analyzer for GNU C++. /* Separate lexical analyzer for GNU C++.
Copyright (C) 1987, 89, 92-96, 1997 Free Software Foundation, Inc. Copyright (C) 1987, 89, 92-97, 1998 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com) Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC. This file is part of GNU CC.
...@@ -46,18 +46,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -46,18 +46,9 @@ Boston, MA 02111-1307, USA. */
#endif #endif
#ifdef MULTIBYTE_CHARS #ifdef MULTIBYTE_CHARS
#include <stdlib.h>
#include <locale.h> #include <locale.h>
#endif #endif
#ifdef HAVE_STDLIB_H
#ifndef MULTIBYTE_CHARS
#include <stdlib.h>
#endif
#else
extern double atof ();
#endif
#define obstack_chunk_alloc xmalloc #define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free #define obstack_chunk_free free
...@@ -2604,13 +2595,6 @@ do_pending_lang_change () ...@@ -2604,13 +2595,6 @@ do_pending_lang_change ()
pop_lang_context (); pop_lang_context ();
} }
#if 0
#define isalnum(char) (char >= 'a' ? char <= 'z' : char >= '0' ? char <= '9' || (char >= 'A' && char <= 'Z') : 0)
#define isdigit(char) (char >= '0' && char <= '9')
#else
#include <ctype.h>
#endif
#define ENDFILE -1 /* token that represents end-of-file */ #define ENDFILE -1 /* token that represents end-of-file */
/* Read an escape sequence, returning its equivalent as a character, /* Read an escape sequence, returning its equivalent as a character,
...@@ -2635,7 +2619,7 @@ readescape (ignore_ptr) ...@@ -2635,7 +2619,7 @@ readescape (ignore_ptr)
while (1) while (1)
{ {
c = getch (); c = getch ();
if (! isxdigit (c)) if (! ISXDIGIT (c))
{ {
put_back (c); put_back (c);
break; break;
...@@ -3176,7 +3160,7 @@ real_yylex () ...@@ -3176,7 +3160,7 @@ real_yylex ()
/* Make this run fast. We know that we are reading straight /* Make this run fast. We know that we are reading straight
from FINPUT in this case (since identifiers cannot straddle from FINPUT in this case (since identifiers cannot straddle
input sources. */ input sources. */
while (isalnum (c) || (c == '_') || c == '$') while (ISALNUM (c) || (c == '_') || c == '$')
{ {
if (c == '$') if (c == '$')
{ {
...@@ -3206,7 +3190,7 @@ real_yylex () ...@@ -3206,7 +3190,7 @@ real_yylex ()
*p++ = c; *p++ = c;
c = getch (); c = getch ();
while (isalnum (c) || (c == '_') || c == '$') while (ISALNUM (c) || (c == '_') || c == '$')
{ {
if (c == '$') if (c == '$')
{ {
...@@ -3399,7 +3383,7 @@ real_yylex () ...@@ -3399,7 +3383,7 @@ real_yylex ()
} }
error ("parse error at `..'"); error ("parse error at `..'");
} }
if (isdigit (c1)) if (ISDIGIT (c1))
{ {
put_back (c1); put_back (c1);
goto resume_numerical_scan; goto resume_numerical_scan;
...@@ -3413,7 +3397,7 @@ real_yylex () ...@@ -3413,7 +3397,7 @@ real_yylex ()
/* Optimize for most frequent case. */ /* Optimize for most frequent case. */
{ {
register int c1 = getch (); register int c1 = getch ();
if (! isalnum (c1) && c1 != '.') if (! ISALNUM (c1) && c1 != '.')
{ {
/* Terminate string. */ /* Terminate string. */
token_buffer[0] = c; token_buffer[0] = c;
...@@ -3478,7 +3462,7 @@ real_yylex () ...@@ -3478,7 +3462,7 @@ real_yylex ()
/* Read all the digits-and-decimal-points. */ /* Read all the digits-and-decimal-points. */
while (c == '.' while (c == '.'
|| (isalnum (c) && (c != 'l') && (c != 'L') || (ISALNUM (c) && (c != 'l') && (c != 'L')
&& (c != 'u') && (c != 'U') && (c != 'u') && (c != 'U')
&& c != 'i' && c != 'I' && c != 'j' && c != 'J' && c != 'i' && c != 'I' && c != 'j' && c != 'J'
&& (floatflag == NOT_FLOAT || ((c != 'f') && (c != 'F'))))) && (floatflag == NOT_FLOAT || ((c != 'f') && (c != 'F')))))
...@@ -3507,7 +3491,7 @@ real_yylex () ...@@ -3507,7 +3491,7 @@ real_yylex ()
only when it is followed by a digit. only when it is followed by a digit.
Otherwise, unread the following non-digit Otherwise, unread the following non-digit
and use the '.' as a structural token. */ and use the '.' as a structural token. */
if (p == token_buffer + 2 && !isdigit (c)) if (p == token_buffer + 2 && !ISDIGIT (c))
{ {
if (c == '.') if (c == '.')
{ {
...@@ -3532,7 +3516,7 @@ real_yylex () ...@@ -3532,7 +3516,7 @@ real_yylex ()
/* It is not a decimal point. /* It is not a decimal point.
It should be a digit (perhaps a hex digit). */ It should be a digit (perhaps a hex digit). */
if (isdigit (c)) if (ISDIGIT (c))
{ {
c = c - '0'; c = c - '0';
} }
...@@ -3614,9 +3598,9 @@ real_yylex () ...@@ -3614,9 +3598,9 @@ real_yylex ()
*p++ = c; *p++ = c;
c = getch (); c = getch ();
} }
if (! isdigit (c)) if (! ISDIGIT (c))
error ("floating constant exponent has no digits"); error ("floating constant exponent has no digits");
while (isdigit (c)) while (ISDIGIT (c))
{ {
if (p >= token_buffer + maxtoken - 3) if (p >= token_buffer + maxtoken - 3)
p = extend_token_buffer (p); p = extend_token_buffer (p);
...@@ -3920,7 +3904,7 @@ real_yylex () ...@@ -3920,7 +3904,7 @@ real_yylex ()
&& (unsigned) c >= (1 << width)) && (unsigned) c >= (1 << width))
warning ("escape sequence out of range for character"); warning ("escape sequence out of range for character");
#ifdef MAP_CHARACTER #ifdef MAP_CHARACTER
if (isprint (c)) if (ISPRINT (c))
c = MAP_CHARACTER (c); c = MAP_CHARACTER (c);
#endif #endif
} }
......
...@@ -937,7 +937,7 @@ build_qualified_name (decl) ...@@ -937,7 +937,7 @@ build_qualified_name (decl)
{ {
tree id = DECL_ASSEMBLER_NAME (decl); tree id = DECL_ASSEMBLER_NAME (decl);
OB_PUTID (id); 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; numeric_output_need_bar = 1;
return; return;
} }
......
/* Code for handling XREF output from GNU C++. /* Code for handling XREF output from GNU C++.
Copyright (C) 1992, 1993, 1994, 1995, 1997 Free Software Foundation, Inc. Copyright (C) 1992, 93-97, 1998 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) Contributed by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC. This file is part of GNU CC.
...@@ -715,7 +715,7 @@ simplify_type(typ) ...@@ -715,7 +715,7 @@ simplify_type(typ)
int lvl, i; int lvl, i;
i = strlen(typ); i = strlen(typ);
while (i > 0 && isspace(typ[i-1])) typ[--i] = 0; while (i > 0 && ISSPACE(typ[i-1])) typ[--i] = 0;
if (i > 7 && STREQL(&typ[i-5], "const")) if (i > 7 && STREQL(&typ[i-5], "const"))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment