* egcs-19980425, system.h stuff part 6/6
@ 1998-05-01 17:40 Kaveh R. Ghazi
0 siblings, 0 replies; only message in thread
From: Kaveh R. Ghazi @ 1998-05-01 17:40 UTC (permalink / raw)
To: egcs
This is part 6/6.
Fri May 1 15:56:40 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.
diff -rup orig/egcs-19980425/gcc/cp/error.c egcs-19980425/gcc/cp/error.c
--- orig/egcs-19980425/gcc/cp/error.c Thu Apr 23 05:35:38 1998
+++ egcs-19980425/gcc/cp/error.c Fri May 1 14:46:19 1998
@@ -1142,7 +1142,7 @@ dump_char (c)
OB_PUTS ("\\\"");
break;
default:
- if (isprint (c))
+ if (ISPRINT (c))
OB_PUTC (c);
else
{
diff -rup orig/egcs-19980425/gcc/cp/lex.c egcs-19980425/gcc/cp/lex.c
--- orig/egcs-19980425/gcc/cp/lex.c Fri Apr 17 04:05:20 1998
+++ egcs-19980425/gcc/cp/lex.c Fri May 1 15:05:15 1998
@@ -45,18 +45,9 @@ Boston, MA 02111-1307, USA. */
#endif
#ifdef MULTIBYTE_CHARS
-#include <stdlib.h>
#include <locale.h>
#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_free free
@@ -2603,13 +2594,6 @@ do_pending_lang_change ()
pop_lang_context ();
}
\f
-#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 */
/* Read an escape sequence, returning its equivalent as a character,
@@ -2634,7 +2618,7 @@ readescape (ignore_ptr)
while (1)
{
c = getch ();
- if (! isxdigit (c))
+ if (! ISXDIGIT (c))
{
put_back (c);
break;
@@ -3175,7 +3159,7 @@ real_yylex ()
/* Make this run fast. We know that we are reading straight
from FINPUT in this case (since identifiers cannot straddle
input sources. */
- while (isalnum (c) || (c == '_') || c == '$')
+ while (ISALNUM (c) || (c == '_') || c == '$')
{
if (c == '$')
{
@@ -3205,7 +3189,7 @@ real_yylex ()
*p++ = c;
c = getch ();
- while (isalnum (c) || (c == '_') || c == '$')
+ while (ISALNUM (c) || (c == '_') || c == '$')
{
if (c == '$')
{
@@ -3398,7 +3382,7 @@ real_yylex ()
}
error ("parse error at `..'");
}
- if (isdigit (c1))
+ if (ISDIGIT (c1))
{
put_back (c1);
goto resume_numerical_scan;
@@ -3412,7 +3396,7 @@ real_yylex ()
/* Optimize for most frequent case. */
{
register int c1 = getch ();
- if (! isalnum (c1) && c1 != '.')
+ if (! ISALNUM (c1) && c1 != '.')
{
/* Terminate string. */
token_buffer[0] = c;
@@ -3477,7 +3461,7 @@ real_yylex ()
/* Read all the digits-and-decimal-points. */
while (c == '.'
- || (isalnum (c) && (c != 'l') && (c != 'L')
+ || (ISALNUM (c) && (c != 'l') && (c != 'L')
&& (c != 'u') && (c != 'U')
&& c != 'i' && c != 'I' && c != 'j' && c != 'J'
&& (floatflag == NOT_FLOAT || ((c != 'f') && (c != 'F')))))
@@ -3506,7 +3490,7 @@ real_yylex ()
only when it is followed by a digit.
Otherwise, unread the following non-digit
and use the '.' as a structural token. */
- if (p == token_buffer + 2 && !isdigit (c))
+ if (p == token_buffer + 2 && !ISDIGIT (c))
{
if (c == '.')
{
@@ -3531,7 +3515,7 @@ real_yylex ()
/* It is not a decimal point.
It should be a digit (perhaps a hex digit). */
- if (isdigit (c))
+ if (ISDIGIT (c))
{
c = c - '0';
}
@@ -3613,9 +3597,9 @@ real_yylex ()
*p++ = c;
c = getch ();
}
- if (! isdigit (c))
+ if (! ISDIGIT (c))
error ("floating constant exponent has no digits");
- while (isdigit (c))
+ while (ISDIGIT (c))
{
if (p >= token_buffer + maxtoken - 3)
p = extend_token_buffer (p);
@@ -3919,7 +3903,7 @@ real_yylex ()
&& (unsigned) c >= (1 << width))
warning ("escape sequence out of range for character");
#ifdef MAP_CHARACTER
- if (isprint (c))
+ if (ISPRINT (c))
c = MAP_CHARACTER (c);
#endif
}
diff -rup orig/egcs-19980425/gcc/cp/method.c egcs-19980425/gcc/cp/method.c
--- orig/egcs-19980425/gcc/cp/method.c Fri Apr 17 04:32:50 1998
+++ egcs-19980425/gcc/cp/method.c Fri May 1 15:05:40 1998
@@ -936,7 +936,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;
}
diff -rup orig/egcs-19980425/gcc/cp/xref.c egcs-19980425/gcc/cp/xref.c
--- orig/egcs-19980425/gcc/cp/xref.c Wed Apr 1 12:25:12 1998
+++ egcs-19980425/gcc/cp/xref.c Fri May 1 14:46:19 1998
@@ -714,7 +714,7 @@ simplify_type(typ)
int lvl, i;
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"))
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-05-01 17:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-05-01 17:40 egcs-19980425, system.h stuff part 6/6 Kaveh R. Ghazi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).