Patch to use more safe-ctype macros

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Sun Oct 21 05:41:00 GMT 2001


This patch makes gcc use more of the safe-ctype macros in lieu of
explicit character range tests.  I find this makes code much more
readable.  I also found many places where we could simplify multiple
ctype calls and/or multiple ranges into one ctype call, which should
be slightly faster.

Bootstrapped on sparc-sun-solaris2.7, no testsuite or warning
regressions.

Okay to install?

	   	--Kaveh



2001-10-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* c-format.c (maybe_read_dollar_number): Use safe-ctype macros
	and/or fold extra calls into fewer ones.
	* collect2.c (dump_file): Likewise.
	* cppexp.c (parse_number): Likewise.
	* cpplex.c (lex_dot, hex_digit_value): Likewise.
	* final.c (output_asm_insn, asm_fprintf): Likewise.
	* fix-header.c (inf_scan_ident, main): Likewise.
	* fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix):
	Likewise.
	* fold-const.c (real_hex_to_f): Likewise.
	* gen-protos.c (parse_fn_proto): Likewise.
	* genattrtab.c (check_attr_test, check_attr_value): Likewise.
	* genrecog.c (change_state, write_action): Likewise.
	* gensupport.c (shift_output_template): Likewise.
	* local-alloc.c (requires_inout): Likewise.
	* mips-tfile.c (IS_ASM_IDENT): Likewise.
	* protoize.c (is_id_char, main): Likewise.
	* real.c (asctoeg): Likewise.
	* recog.c (asm_operand_ok): Likewise.
	* reload.c (find_reloads): Likewise.
	* scan.c (scan_identget_token): Likewise.
	* sched-vis.c (print_value): Likewise.
	* stringpool.c (ggc_alloc_string): Likewise.
	* toplev.c (read_integral_parameter, decode_g_option): Likewise.
	* tradcif.y (parse_number, yylex, parse_escape): Likewise.
	* tradcpp.c (rescan): Likewise.
	* tree.c (clean_symbol_name): Likewise.
	* varasm.c (decode_reg_name): Likewise.

	* alpha.h (ASM_OUTPUT_ASCII): Likewise.
	* darwin.c (name_needs_quotes, func_name_maybe_scoped): Likewise.
	* dsp16xx.h (ASM_OUTPUT_ASCII): Likewise.
	* m88k.c (output_ascii): Likewise.
	* m88k.h (OVERRIDE_OPTIONS): Likewise.
	* mcore.h (REG_CLASS_FROM_LETTER): Likewise.
	* ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise.
	* sh.h (REG_CLASS_FROM_LETTER): Likewise.

cp:
	* xref.c (GNU_xref_member): Use safe-ctype macros and/or fold
	extra calls into fewer ones.

f:
	* bad.c (ffebad_finish): Use safe-ctype macros and/or fold extra
	calls into fewer ones.
	* implic.c (ffeimplic_lookup_): Likewise.
	* intdoc.c (dumpimp): Likewise.
	* intrin.c (ffeintrin_init_0): Likewise.
	* lex.c (ffelex_backslash_, ffelex_cfebackslash_, ffelex_hash_):
	Likewise.
	* lex.h (ffelex_is_firstnamechar): Likewise.
	* target.c (ffetarget_integerhex): Likewise.

java:
	* gjavah.c (jni_print_char, decode_signature_piece): Use
	safe-ctype macros and/or fold extra calls into fewer ones.
	* lex.c (java_read_unicode, java_lex): Likewise.
	* lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
	JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
	* mangle_name.c (append_unicode_mangled_name,
	unicode_mangling_length): Likewise.

diff -rup orig/egcs-CVS20011020/gcc/c-format.c egcs-CVS20011020/gcc/c-format.c
--- orig/egcs-CVS20011020/gcc/c-format.c	Thu Oct 11 07:30:17 2001
+++ egcs-CVS20011020/gcc/c-format.c	Sat Oct 20 15:25:28 2001
@@ -1092,7 +1092,7 @@ maybe_read_dollar_number (status, format
   int argnum;
   int overflow_flag;
   const char *fcp = *format;
-  if (*fcp < '0' || *fcp > '9')
+  if (! ISDIGIT (*fcp))
     {
       if (dollar_needed)
 	{
@@ -1104,7 +1104,7 @@ maybe_read_dollar_number (status, format
     }
   argnum = 0;
   overflow_flag = 0;
-  while (*fcp >= '0' && *fcp <= '9')
+  while (ISDIGIT (*fcp))
     {
       int nargnum;
       nargnum = 10 * argnum + (*fcp - '0');
diff -rup orig/egcs-CVS20011020/gcc/collect2.c egcs-CVS20011020/gcc/collect2.c
--- orig/egcs-CVS20011020/gcc/collect2.c	Fri Oct 19 15:31:55 2001
+++ egcs-CVS20011020/gcc/collect2.c	Sat Oct 20 15:25:28 2001
@@ -502,7 +502,7 @@ dump_file (name)
     {
       int c;
       while (c = getc (stream),
-	     c != EOF && (ISALNUM (c) || c == '_' || c == '$' || c == '.'))
+	     c != EOF && (ISIDNUM (c) || c == '$' || c == '.'))
 	obstack_1grow (&temporary_obstack, c);
       if (obstack_object_size (&temporary_obstack) > 0)
 	{
diff -rup orig/egcs-CVS20011020/gcc/config/alpha/alpha.h egcs-CVS20011020/gcc/config/alpha/alpha.h
--- orig/egcs-CVS20011020/gcc/config/alpha/alpha.h	Wed Oct 17 07:30:33 2001
+++ egcs-CVS20011020/gcc/config/alpha/alpha.h	Sat Oct 20 15:25:28 2001
@@ -2010,8 +2010,7 @@ do {						\
 		 The VAX assembler fails to stop reading the escape	      \
 		 after three digits, so this is the only way we		      \
 		 can get it to parse the data properly.  */		      \
-	      if (i < thissize - 1					      \
-		  && p[i + 1] >= '0' && p[i + 1] <= '9')		      \
+	      if (i < thissize - 1 && ISDIGIT (p[i + 1]))		      \
 		_size_so_far = 0, fprintf (asm_out_file, "\"\n\t.ascii \"");  \
 	  }								      \
 	}								      \
diff -rup orig/egcs-CVS20011020/gcc/config/darwin.c egcs-CVS20011020/gcc/config/darwin.c
--- orig/egcs-CVS20011020/gcc/config/darwin.c	Wed Oct 17 07:30:31 2001
+++ egcs-CVS20011020/gcc/config/darwin.c	Sat Oct 20 15:25:28 2001
@@ -53,7 +53,7 @@ name_needs_quotes (name)
 {
   int c;
   while ((c = *name++) != '\0')
-    if (!isalnum (c) && c != '_')
+    if (! ISIDNUM (c))
       return 1;
   return 0;
 }
@@ -587,7 +587,7 @@ func_name_maybe_scoped (fname)
 	  while (*fname != 0)
 	    {
 	      if (fname[0] == '_' && fname[1] == '_'
-		  && (fname[2] == 'F' || (fname[2] >= '0' && fname[2] <= '9')))
+		  && (fname[2] == 'F' || ISDIGIT (fname[2])))
 		return 0;
 	      ++fname;
 	    }
diff -rup orig/egcs-CVS20011020/gcc/config/dsp16xx/dsp16xx.h egcs-CVS20011020/gcc/config/dsp16xx/dsp16xx.h
--- orig/egcs-CVS20011020/gcc/config/dsp16xx/dsp16xx.h	Mon Oct 15 16:30:16 2001
+++ egcs-CVS20011020/gcc/config/dsp16xx/dsp16xx.h	Sat Oct 20 15:25:28 2001
@@ -1699,8 +1699,7 @@ const_section ()                        
 		 The Vax assembler fails to stop reading the escape	      \
 		 after three digits, so this is the only way we		      \
 		 can get it to parse the data properly.  		      \
-	      if (i < thissize - 1					      \
-		  && p[i + 1] >= '0' && p[i + 1] <= '9')		      \
+	      if (i < thissize - 1 && ISDIGIT (p[i + 1]))		      \
 		fprintf (asm_out_file, "\'\n\tint \'");		              \
 		*/ \
 	  }								      \
diff -rup orig/egcs-CVS20011020/gcc/config/m88k/m88k.c egcs-CVS20011020/gcc/config/m88k/m88k.c
--- orig/egcs-CVS20011020/gcc/config/m88k/m88k.c	Sun Oct  7 12:27:01 2001
+++ egcs-CVS20011020/gcc/config/m88k/m88k.c	Sat Oct 20 15:25:28 2001
@@ -1662,7 +1662,7 @@ output_ascii (file, opcode, max, p, size
 	  num += 2;
 	  in_escape = 0;
 	}
-      else if (in_escape && c >= '0' && c <= '9')
+      else if (in_escape && ISDIGIT (c))
 	{
 	  /* If a digit follows an octal-escape, the VAX assembler fails
 	     to stop reading the escape after three digits.  Continue to
diff -rup orig/egcs-CVS20011020/gcc/config/m88k/m88k.h egcs-CVS20011020/gcc/config/m88k/m88k.h
--- orig/egcs-CVS20011020/gcc/config/m88k/m88k.h	Sun Oct  7 12:27:01 2001
+++ egcs-CVS20011020/gcc/config/m88k/m88k.h	Sat Oct 20 15:25:28 2001
@@ -292,7 +292,7 @@ extern int flag_pic;				/* -fpic */
       {									     \
 	const char *p = m88k_short_data;				     \
 	while (*p)							     \
-	  if (*p >= '0' && *p <= '9')					     \
+	  if (ISDIGIT (*p))						     \
 	    p++;							     \
 	  else								     \
 	    {								     \
diff -rup orig/egcs-CVS20011020/gcc/config/mcore/mcore.h egcs-CVS20011020/gcc/config/mcore/mcore.h
--- orig/egcs-CVS20011020/gcc/config/mcore/mcore.h	Tue Oct  9 07:30:34 2001
+++ egcs-CVS20011020/gcc/config/mcore/mcore.h	Sat Oct 20 15:25:28 2001
@@ -547,7 +547,7 @@ extern int regno_reg_class[];
 extern enum reg_class reg_class_from_letter[];
 
 #define REG_CLASS_FROM_LETTER(C) \
-   ( (C) >= 'a' && (C) <= 'z' ? reg_class_from_letter[(C) - 'a'] : NO_REGS )
+   ( ISLOWER (C) ? reg_class_from_letter[(C) - 'a'] : NO_REGS )
 
 /* The letters I, J, K, L, M, N, O, and P in a register constraint string
    can be used to stand for particular ranges of immediate operands.
diff -rup orig/egcs-CVS20011020/gcc/config/ns32k/encore.h egcs-CVS20011020/gcc/config/ns32k/encore.h
--- orig/egcs-CVS20011020/gcc/config/ns32k/encore.h	Thu Nov  2 18:29:12 2000
+++ egcs-CVS20011020/gcc/config/ns32k/encore.h	Sat Oct 20 15:25:28 2001
@@ -144,8 +144,7 @@ do {							\
       else						\
         {						\
           fprintf ((file), "\\%o", c);			\
-          if (i < (size) - 1 				\
-              && (p)[i + 1] >= '0' && (p)[i + 1] <= '9')\
+          if (i < (size) - 1 && ISDIGIT ((p)[i + 1]))	\
           fprintf ((file), "\"\n\t.ascii \"");		\
         }						\
     }							\
diff -rup orig/egcs-CVS20011020/gcc/config/sh/sh.h egcs-CVS20011020/gcc/config/sh/sh.h
--- orig/egcs-CVS20011020/gcc/config/sh/sh.h	Thu Sep 20 23:12:39 2001
+++ egcs-CVS20011020/gcc/config/sh/sh.h	Sat Oct 20 15:25:28 2001
@@ -832,7 +832,7 @@ extern int regno_reg_class[];
 extern enum reg_class reg_class_from_letter[];
 
 #define REG_CLASS_FROM_LETTER(C) \
-   ( (C) >= 'a' && (C) <= 'z' ? reg_class_from_letter[(C)-'a'] : NO_REGS )
+   ( ISLOWER (C) ? reg_class_from_letter[(C)-'a'] : NO_REGS )
 
 /* The letters I, J, K, L and M in a register constraint string
    can be used to stand for particular ranges of immediate operands.
diff -rup orig/egcs-CVS20011020/gcc/cp/xref.c egcs-CVS20011020/gcc/cp/xref.c
--- orig/egcs-CVS20011020/gcc/cp/xref.c	Sun Apr 22 20:17:18 2001
+++ egcs-CVS20011020/gcc/cp/xref.c	Sat Oct 20 15:25:28 2001
@@ -615,11 +615,11 @@ GNU_xref_member(cls, fld)
 #ifdef XREF_SHORT_MEMBER_NAMES
   for (p = &bufa[1]; *p != 0; ++p)
     {
-      if (p[0] == '_' && p[1] == '_' && p[2] >= '0' && p[2] <= '9') {
+      if (p[0] == '_' && p[1] == '_' && ISDIGIT (p[2])) {
 	if (strncmp(&p[2], buf, i) == 0) *p = 0;
 	break;
       }
-      else if (p[0] == '_' && p[1] == '_' && p[2] == 'C' && p[3] >= '0' && p[3] <= '9') {
+      else if (p[0] == '_' && p[1] == '_' && p[2] == 'C' && ISDIGIT (p[3])) {
 	if (strncmp(&p[3], buf, i) == 0) *p = 0;
 	break;
       }
diff -rup orig/egcs-CVS20011020/gcc/cppexp.c egcs-CVS20011020/gcc/cppexp.c
--- orig/egcs-CVS20011020/gcc/cppexp.c	Thu Oct 11 07:30:21 2001
+++ egcs-CVS20011020/gcc/cppexp.c	Sat Oct 20 15:25:28 2001
@@ -129,7 +129,7 @@ parse_number (pfile, tok)
     {
       c = *p;
 
-      if (c >= '0' && c <= '9')
+      if (ISDIGIT (c))
 	digit = c - '0';
       /* We believe that in all live character sets, a-f are
 	 consecutive, and so are A-F.  */
diff -rup orig/egcs-CVS20011020/gcc/cpplex.c egcs-CVS20011020/gcc/cpplex.c
--- orig/egcs-CVS20011020/gcc/cpplex.c	Sat Oct 20 07:30:21 2001
+++ egcs-CVS20011020/gcc/cpplex.c	Sat Oct 20 15:25:28 2001
@@ -843,7 +843,7 @@ lex_dot (pfile, result)
     }
 
   /* All known character sets have 0...9 contiguous.  */
-  if (c >= '0' && c <= '9')
+  if (ISDIGIT (c))
     {
       result->type = CPP_NUMBER;
       parse_number (pfile, &result->val.str, c, 1);
@@ -1654,12 +1654,12 @@ static unsigned int
 hex_digit_value (c)
      unsigned int c;
 {
+  if (ISDIGIT (c))
+    return c - '0';
   if (c >= 'a' && c <= 'f')
     return c - 'a' + 10;
   if (c >= 'A' && c <= 'F')
     return c - 'A' + 10;
-  if (c >= '0' && c <= '9')
-    return c - '0';
   abort ();
 }
 
diff -rup orig/egcs-CVS20011020/gcc/f/bad.c egcs-CVS20011020/gcc/f/bad.c
--- orig/egcs-CVS20011020/gcc/f/bad.c	Thu Oct 18 07:31:40 2001
+++ egcs-CVS20011020/gcc/f/bad.c	Sat Oct 20 15:25:28 2001
@@ -473,7 +473,7 @@ ffebad_finish ()
       if (c == '%')
 	{
 	  c = ffebad_message_[++i];
-	  if (ISALPHA (c) && ISUPPER (c))
+	  if (ISUPPER (c))
 	    {
 	      index = c - 'A';
 
diff -rup orig/egcs-CVS20011020/gcc/f/implic.c egcs-CVS20011020/gcc/f/implic.c
--- orig/egcs-CVS20011020/gcc/f/implic.c	Sat Mar 27 05:23:50 1999
+++ egcs-CVS20011020/gcc/f/implic.c	Sat Oct 20 15:25:28 2001
@@ -92,7 +92,7 @@ static ffeimplic_
 ffeimplic_lookup_ (unsigned char c)
 {
   /* NOTE: This is definitely ASCII-specific!!  */
-  if (ISALPHA (c) || (c == '_'))
+  if (ISIDST (c))
     return &ffeimplic_table_[c - 'A'];
   return NULL;
 }
diff -rup orig/egcs-CVS20011020/gcc/f/intdoc.c egcs-CVS20011020/gcc/f/intdoc.c
--- orig/egcs-CVS20011020/gcc/f/intdoc.c	Thu Oct 18 07:31:51 2001
+++ egcs-CVS20011020/gcc/f/intdoc.c	Sat Oct 20 15:25:28 2001
@@ -399,15 +399,12 @@ dumpimp (int menu, const char *name, con
 
 	  for (c = summaries[imp]; c[0] != '\0'; ++c)
 	    {
-	      if ((c[0] == '@')
-		  && (c[1] >= '0')
-	      && (c[1] <= '9'))
+	      if (c[0] == '@' && ISDIGIT (c[1]))
 		{
 		  int argno = c[1] - '0';
 
 		  c += 2;
-		  while ((c[0] >= '0')
-			 && (c[0] <= '9'))
+		  while (ISDIGIT (c[0]))
 		    {
 		      argno = 10 * argno + (c[0] - '0');
 		      ++c;
@@ -495,8 +492,7 @@ external procedure.\n\
       const char *arg_string;
       const char *arg_info;
 
-      if ((c[colon + 1] >= '0')
-	  && (c[colon + 1] <= '9'))
+      if (ISDIGIT (c[colon + 1]))
 	{
 	  other_arg = c[colon + 1] - '0';
 	  arg_string = argument_name_string (imp, other_arg);
@@ -548,9 +544,7 @@ this intrinsic is valid only when used a
 	printf (", the exact type being wide enough to hold a pointer\n\
 on the target system (typically @code{INTEGER(KIND=1)} or @code{INTEGER(KIND=4)}).\n\n");
 #endif
-      else if ((c[1] == '=')
-	       && (c[colon + 1] >= '0')
-	       && (c[colon + 1] <= '9'))
+      else if (c[1] == '=' && ISDIGIT (c[colon + 1]))
 	{
 	  assert (other_arg >= 0);
 
@@ -1011,15 +1005,12 @@ Description:\n\
 
       while (c[0] != '\0')
 	{
-	  if ((c[0] == '@')
-	      && (c[1] >= '0')
-	  && (c[1] <= '9'))
+	  if (c[0] == '@' && ISDIGIT (c[1]))
 	    {
 	      int argno = c[1] - '0';
 
 	      c += 2;
-	      while ((c[0] >= '0')
-		     && (c[0] <= '9'))
+	      while (ISDIGIT (c[0]))
 		{
 		  argno = 10 * argno + (c[0] - '0');
 		  ++c;
diff -rup orig/egcs-CVS20011020/gcc/f/intrin.c egcs-CVS20011020/gcc/f/intrin.c
--- orig/egcs-CVS20011020/gcc/f/intrin.c	Thu Oct 18 07:31:51 2001
+++ egcs-CVS20011020/gcc/f/intrin.c	Sat Oct 20 15:25:28 2001
@@ -1628,8 +1628,7 @@ ffeintrin_init_0 ()
 	}
       if ((c[colon + 1] != '-')
 	  && (c[colon + 1] != '*')
-	  && ((c[colon + 1] < '0')
-	      || (c[colon + 1] > '9')))
+	  && (! ISDIGIT (c[colon + 1])))
 	{
 	  fprintf (stderr, "%s: bad COL-spec\n",
 		   ffeintrin_imps_[i].name);
@@ -1673,8 +1672,7 @@ ffeintrin_init_0 ()
 	      break;
 	    }
 	  if ((c[2] != '*')
-	      && ((c[2] < '1')
-		  || (c[2] > '9'))
+	      && (! ISDIGIT (c[2]))
 	      && (c[2] != 'A'))
 	    {
 	      fprintf (stderr, "%s: bad arg-kind-type\n",
@@ -1683,9 +1681,9 @@ ffeintrin_init_0 ()
 	    }
 	  if (c[3] == '[')
 	    {
-	      if (((c[4] < '0') || (c[4] > '9'))
+	      if ((! ISDIGIT (c[4]))
 		  || ((c[5] != ']')
-		      && (++c, (c[4] < '0') || (c[4] > '9')
+		      && (++c, ! ISDIGIT (c[4])
 			  || (c[5] != ']'))))
 		{
 		  fprintf (stderr, "%s: bad arg-len\n",
@@ -1696,9 +1694,9 @@ ffeintrin_init_0 ()
 	    }
 	  if (c[3] == '(')
 	    {
-	      if (((c[4] < '0') || (c[4] > '9'))
+	      if ((! ISDIGIT (c[4]))
 		  || ((c[5] != ')')
-		      && (++c, (c[4] < '0') || (c[4] > '9')
+		      && (++c, ! ISDIGIT (c[4])
 			  || (c[5] != ')'))))
 		{
 		  fprintf (stderr, "%s: bad arg-rank\n",
diff -rup orig/egcs-CVS20011020/gcc/f/lex.c egcs-CVS20011020/gcc/f/lex.c
--- orig/egcs-CVS20011020/gcc/f/lex.c	Thu Oct 18 07:31:54 2001
+++ egcs-CVS20011020/gcc/f/lex.c	Sat Oct 20 15:25:28 2001
@@ -394,16 +394,14 @@ ffelex_backslash_ (int c, ffewhereColumn
       return c;
 
     case 2:
-      if ((c >= 'a' && c <= 'f')
-	  || (c >= 'A' && c <= 'F')
-	  || (c >= '0' && c <= '9'))
+      if (ISXDIGIT (c))
 	{
 	  code *= 16;
 	  if (c >= 'a' && c <= 'f')
 	    code += c - 'a' + 10;
 	  if (c >= 'A' && c <= 'F')
 	    code += c - 'A' + 10;
-	  if (c >= '0' && c <= '9')
+	  if (ISDIGIT (c))
 	    code += c - '0';
 	  if (code != 0 || count != 0)
 	    {
@@ -599,9 +597,7 @@ ffelex_cfebackslash_ (int *use_d, int *d
       while (1)
 	{
 	  c = getc (finput);
-	  if (!(c >= 'a' && c <= 'f')
-	      && !(c >= 'A' && c <= 'F')
-	      && !(c >= '0' && c <= '9'))
+	  if (! ISXDIGIT (c))
 	    {
 	      *use_d = 1;
 	      *d = c;
@@ -612,7 +608,7 @@ ffelex_cfebackslash_ (int *use_d, int *d
 	    code += c - 'a' + 10;
 	  if (c >= 'A' && c <= 'F')
 	    code += c - 'A' + 10;
-	  if (c >= '0' && c <= '9')
+	  if (ISDIGIT (c))
 	    code += c - '0';
 	  if (code != 0 || count != 0)
 	    {
@@ -1079,7 +1075,7 @@ ffelex_hash_ (FILE *finput)
      it and ignore it; otherwise, ignore the line, with an error
      if the word isn't `pragma', `ident', `define', or `undef'.  */
 
-  if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
+  if (ISALPHA(c))
     {
       if (c == 'p')
 	{
diff -rup orig/egcs-CVS20011020/gcc/f/lex.h egcs-CVS20011020/gcc/f/lex.h
--- orig/egcs-CVS20011020/gcc/f/lex.h	Sat May 26 07:30:30 2001
+++ egcs-CVS20011020/gcc/f/lex.h	Sat Oct 20 15:25:28 2001
@@ -171,8 +171,7 @@ ffelexToken ffelex_token_use (ffelexToke
 #define ffelex_init_2()
 #define ffelex_init_3()
 #define ffelex_init_4()
-#define ffelex_is_firstnamechar(c) \
-  (ISALPHA ((c)) || ((c) == '_'))
+#define ffelex_is_firstnamechar(c) ISIDST (c)
 #define ffelex_terminate_0()
 #define ffelex_terminate_1()
 #define ffelex_terminate_2()
diff -rup orig/egcs-CVS20011020/gcc/f/target.c egcs-CVS20011020/gcc/f/target.c
--- orig/egcs-CVS20011020/gcc/f/target.c	Wed Jun 21 16:11:14 2000
+++ egcs-CVS20011020/gcc/f/target.c	Sat Oct 20 15:25:28 2001
@@ -1451,7 +1451,7 @@ ffetarget_integerhex (ffetargetIntegerDe
 	c = c - 'A' + 10;
       else if ((c >= 'a') && (c <= 'f'))
 	c = c - 'a' + 10;
-      else if ((c >= '0') && (c <= '9'))
+      else if (ISDIGIT (c))
 	c -= '0';
       else
 	{
diff -rup orig/egcs-CVS20011020/gcc/final.c egcs-CVS20011020/gcc/final.c
--- orig/egcs-CVS20011020/gcc/final.c	Sat Oct 20 07:30:22 2001
+++ egcs-CVS20011020/gcc/final.c	Sat Oct 20 15:26:01 2001
@@ -3500,12 +3500,12 @@ output_asm_insn (template, operands)
 	   Letters `acln' are implemented directly.
 	   Other letters are passed to `output_operand' so that
 	   the PRINT_OPERAND macro can define them.  */
-	else if (ISLOWER (*p) || ISUPPER (*p))
+	else if (ISALPHA (*p))
 	  {
 	    int letter = *p++;
 	    c = atoi (p);
 
-	    if (! (*p >= '0' && *p <= '9'))
+	    if (! ISDIGIT (*p))
 	      output_operand_lossage ("operand number missing after %-letter");
 	    else if (this_is_asm_operands
 		     && (c < 0 || (unsigned int) c >= insn_noperands))
@@ -3539,11 +3539,11 @@ output_asm_insn (template, operands)
 	      oporder[ops++] = c;
 	    opoutput[c] = 1;
 
-	    while ((c = *p) >= '0' && c <= '9')
+	    while (ISDIGIT (c = *p))
 	      p++;
 	  }
 	/* % followed by a digit outputs an operand the default way.  */
-	else if (*p >= '0' && *p <= '9')
+	else if (ISDIGIT (*p))
 	  {
 	    c = atoi (p);
 	    if (this_is_asm_operands
@@ -3556,7 +3556,7 @@ output_asm_insn (template, operands)
 	      oporder[ops++] = c;
 	    opoutput[c] = 1;
 
-	    while ((c = *p) >= '0' && c <= '9')
+	    while (ISDIGIT (c = *p))
 	      p++;
 	  }
 	/* % followed by punctuation: output something for that
@@ -3819,7 +3819,7 @@ asm_fprintf VPARAMS ((FILE *file, const 
       case '%':
 	c = *p++;
 	q = &buf[1];
-	while ((c >= '0' && c <= '9') || c == '.')
+	while (ISDIGIT (c) || c == '.')
 	  {
 	    *q++ = c;
 	    c = *p++;
diff -rup orig/egcs-CVS20011020/gcc/fix-header.c egcs-CVS20011020/gcc/fix-header.c
--- orig/egcs-CVS20011020/gcc/fix-header.c	Thu Oct 11 07:30:27 2001
+++ egcs-CVS20011020/gcc/fix-header.c	Sat Oct 20 15:25:28 2001
@@ -933,13 +933,13 @@ inf_scan_ident (s, c)
      int c;
 {
   s->ptr = s->base;
-  if (ISALPHA (c) || c == '_')
+  if (ISIDST (c))
     {
       for (;;)
 	{
 	  SSTRING_PUT (s, c);
 	  c = INF_GET ();
-	  if (c == EOF || !(ISALNUM (c) || c == '_'))
+	  if (c == EOF || !(ISIDNUM (c)))
 	    break;
 	}
     }
@@ -1250,7 +1250,7 @@ main (argc, argv)
 	  c = INF_GET ();
 	  if (c == EOF)
 	    break;
-	  if (ISALPHA (c) || c == '_')
+	  if (ISIDST (c))
 	    {
 	      c = inf_scan_ident (&buf, c);
 	      (void) INF_UNGET (c);
diff -rup orig/egcs-CVS20011020/gcc/fixinc/fixfixes.c egcs-CVS20011020/gcc/fixinc/fixfixes.c
--- orig/egcs-CVS20011020/gcc/fixinc/fixfixes.c	Wed Sep 12 12:05:27 2001
+++ egcs-CVS20011020/gcc/fixinc/fixfixes.c	Sat Oct 20 15:25:28 2001
@@ -374,7 +374,7 @@ FIX_PROC_HEAD( char_macro_use_fix )
 	continue;
       if (!ISALPHA (*p))
 	continue;
-      if (ISALNUM (p[1]) || p[1] == '_')
+      if (ISIDNUM (p[1]))
 	continue;
 
       /* Splat all preceding text into the output buffer,
@@ -447,7 +447,7 @@ FIX_PROC_HEAD( char_macro_def_fix )
 	    goto found;
 	  p++;
 	}
-      while (ISALPHA (*p) || ISALNUM (*p) || *p == '_');
+      while (ISIDNUM (*p));
       /* Hit end of macro name without finding the string.  */
       continue;
 
@@ -461,7 +461,7 @@ FIX_PROC_HEAD( char_macro_def_fix )
 	continue;
       if (!ISALPHA (*p))
 	continue;
-      if (ISALNUM (p[1]) || p[1] == '_')
+      if (ISIDNUM (p[1]))
 	continue;
 
       /* The character at P is the one to look for in the following
diff -rup orig/egcs-CVS20011020/gcc/fold-const.c egcs-CVS20011020/gcc/fold-const.c
--- orig/egcs-CVS20011020/gcc/fold-const.c	Thu Oct 11 07:30:29 2001
+++ egcs-CVS20011020/gcc/fold-const.c	Sat Oct 20 15:25:28 2001
@@ -1127,8 +1127,7 @@ real_hex_to_f (s, mode)
   shcount = 0;
   while ((c = *p) != '\0')
     {
-      if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')
-	  || (c >= 'a' && c <= 'f'))
+      if (ISXDIGIT (c))
 	{
 	  k = c & CHARMASK;
 	  if (k >= 'a' && k <= 'f')
diff -rup orig/egcs-CVS20011020/gcc/gen-protos.c egcs-CVS20011020/gcc/gen-protos.c
--- orig/egcs-CVS20011020/gcc/gen-protos.c	Thu Oct 11 07:30:31 2001
+++ egcs-CVS20011020/gcc/gen-protos.c	Sat Oct 20 15:25:28 2001
@@ -109,7 +109,8 @@ parse_fn_proto (start, end, fn)
     }
   name_end = ptr+1;
 
-  while (ISALNUM ((unsigned char)*ptr) || *ptr == '_') --ptr;
+  while (ISIDNUM (*ptr))
+    --ptr;
   name_start = ptr+1;
   while (*ptr == ' ' || *ptr == '\t') ptr--;
   ptr[1] = 0;
diff -rup orig/egcs-CVS20011020/gcc/genattrtab.c egcs-CVS20011020/gcc/genattrtab.c
--- orig/egcs-CVS20011020/gcc/genattrtab.c	Fri Oct 19 15:38:24 2001
+++ egcs-CVS20011020/gcc/genattrtab.c	Sat Oct 20 15:25:28 2001
@@ -976,7 +976,7 @@ check_attr_test (exp, is_const, lineno)
 	  if (attr->is_numeric)
 	    {
 	      for (p = XSTR (exp, 1); *p; p++)
-		if (*p < '0' || *p > '9')
+		if (! ISDIGIT (*p))
 		  fatal ("Attribute `%s' takes only numeric values",
 			 XSTR (exp, 0));
 	    }
@@ -1112,7 +1112,7 @@ check_attr_value (exp, attr)
 	  if (attr && attr->negative_ok && *p == '-')
 	    p++;
 	  for (; *p; p++)
-	    if (*p > '9' || *p < '0')
+	    if (! ISDIGIT (*p))
 	      {
 		message_with_line (attr ? attr->lineno : 0,
 				   "non-numeric value for numeric attribute %s",
diff -rup orig/egcs-CVS20011020/gcc/genrecog.c egcs-CVS20011020/gcc/genrecog.c
--- orig/egcs-CVS20011020/gcc/genrecog.c	Fri Oct 19 15:33:30 2001
+++ egcs-CVS20011020/gcc/genrecog.c	Sat Oct 20 15:25:28 2001
@@ -1725,17 +1725,17 @@ change_state (oldpos, newpos, afterward,
 
   /* Hunt for the last [A-Z] in both strings.  */
   for (old_has_insn = odepth - 1; old_has_insn >= 0; --old_has_insn)
-    if (oldpos[old_has_insn] >= 'A' && oldpos[old_has_insn] <= 'Z')
+    if (ISUPPER (oldpos[old_has_insn]))
       break;
   for (new_has_insn = ndepth - 1; new_has_insn >= 0; --new_has_insn)
-    if (newpos[new_has_insn] >= 'A' && newpos[new_has_insn] <= 'Z')
+    if (ISUPPER (newpos[new_has_insn]))
       break;
 
   /* Go down to desired level.  */
   while (depth < ndepth)
     {
       /* It's a different insn from the first one.  */
-      if (newpos[depth] >= 'A' && newpos[depth] <= 'Z')
+      if (ISUPPER (newpos[depth]))
 	{
 	  /* We can only fail if we're moving down the tree.  */
 	  if (old_has_insn >= 0 && oldpos[old_has_insn] >= newpos[depth])
@@ -1755,7 +1755,7 @@ change_state (oldpos, newpos, afterward,
 	    }
 	  printf ("%sx%d = PATTERN (tem);\n", indent, depth + 1);
 	}
-      else if (newpos[depth] >= 'a' && newpos[depth] <= 'z')
+      else if (ISLOWER (newpos[depth]))
 	printf ("%sx%d = XVECEXP (x%d, 0, %d);\n",
 		indent, depth + 1, depth, newpos[depth] - 'a');
       else
@@ -2129,7 +2129,7 @@ write_action (p, test, depth, uncond, su
 	    int match_len = 0, i;
 
 	    for (i = strlen (p->position) - 1; i >= 0; --i)
-	      if (p->position[i] >= 'A' && p->position[i] <= 'Z')
+	      if (ISUPPER (p->position[i]))
 		{
 		  match_len = p->position[i] - 'A';
 		  break;
diff -rup orig/egcs-CVS20011020/gcc/gensupport.c egcs-CVS20011020/gcc/gensupport.c
--- orig/egcs-CVS20011020/gcc/gensupport.c	Thu Oct 11 07:30:33 2001
+++ egcs-CVS20011020/gcc/gensupport.c	Sat Oct 20 15:25:28 2001
@@ -588,8 +588,7 @@ shift_output_template (new, old, disp)
 	  c = *old++;
 	  if (ISDIGIT ((unsigned char) c))
 	    c += disp;
-	  else if (ISUPPER ((unsigned char) c)
-		   || ISLOWER ((unsigned char) c))
+	  else if (ISALPHA (c))
 	    {
 	      *new++ = c;
 	      c = *old++ + disp;
diff -rup orig/egcs-CVS20011020/gcc/java/gjavah.c egcs-CVS20011020/gcc/java/gjavah.c
--- orig/egcs-CVS20011020/gcc/java/gjavah.c	Wed Sep 12 12:05:28 2001
+++ egcs-CVS20011020/gcc/java/gjavah.c	Sat Oct 20 15:25:28 2001
@@ -287,9 +287,7 @@ jni_print_char (stream, ch)
     fputs ("_3", stream);
   else if (ch == '/')
     fputs ("_", stream);
-  else if ((ch >= '0' && ch <= '9')
-	   || (ch >= 'a' && ch <= 'z')
-	   || (ch >= 'A' && ch <= 'Z'))
+  else if (ISXDIGIT (ch))
     fputc (ch, stream);
   else
     {
@@ -975,8 +973,7 @@ decode_signature_piece (stream, signatur
 
     array_loop:
       for (signature++; (signature < limit
-			 && *signature >= '0'
-			 && *signature <= '9'); signature++)
+			 && ISDIGIT (*signature)); signature++)
 	;
       switch (*signature)
 	{
diff -rup orig/egcs-CVS20011020/gcc/java/lex.c egcs-CVS20011020/gcc/java/lex.c
--- orig/egcs-CVS20011020/gcc/java/lex.c	Sun Oct  7 12:27:05 2001
+++ egcs-CVS20011020/gcc/java/lex.c	Sat Oct 20 15:25:28 2001
@@ -562,7 +562,7 @@ java_read_unicode (lex, unicode_escape_p
 	    {
 	      if ((c = java_read_char (lex)) == UEOF)
 	        return UEOF;
-	      if (c >= '0' && c <= '9')
+	      if (ISDIGIT (c))
 		unicode |= (unicode_t)((c-'0') << shift);
 	      else if ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))
 	        unicode |= (unicode_t)((10+(c | 0x20)-'a') << shift);
@@ -1058,7 +1058,7 @@ java_lex (java_lval)
 	{
 	  /* We store in a string (in case it turns out to be a FP) and in
 	     PARTS if we have to process a integer literal.  */
-	  int numeric = (RANGE (c, '0', '9') ? c-'0' : 10 +(c|0x20)-'a');
+	  int numeric = (ISDIGIT (c) ? c-'0' : 10 +(c|0x20)-'a');
 	  int count;
 
 	  /* Remember when we find a valid hexadecimal digit */
diff -rup orig/egcs-CVS20011020/gcc/java/lex.h egcs-CVS20011020/gcc/java/lex.h
--- orig/egcs-CVS20011020/gcc/java/lex.h	Sat Aug 11 21:56:35 2001
+++ egcs-CVS20011020/gcc/java/lex.h	Sat Oct 20 15:25:28 2001
@@ -250,33 +250,25 @@ extern void java_destroy_lexer PARAMS ((
 #define RANGE(c, l, h)           (((c) >= l && (c) <= h))
 #define JAVA_WHITE_SPACE_P(c) (c == ' ' || c == '\t' || c == '\f')
 #define JAVA_START_CHAR_P(c) ((c < 128					      \
-			       && (RANGE (c, 'A', 'Z')			      \
-				   || RANGE (c, 'a', 'z')		      \
-				   || c == '_'				      \
-				   || c == '$'))			      \
+			       && (ISIDST (c) || c == '$'))		      \
                               || (c >= 128 && java_start_char_p (c)))
 #define JAVA_PART_CHAR_P(c) ((c < 128					      \
-			       && (RANGE (c, 'A', 'Z')			      \
-				   || RANGE (c, 'a', 'z')		      \
-				   || RANGE (c, '0', '9')		      \
-				   || c == '_'				      \
+			       && (ISIDNUM (c)				      \
 				   || c == '$'				      \
 				   || c == 0x0000			      \
 				   || RANGE (c, 0x01, 0x08)		      \
 				   || RANGE (c, 0x0e, 0x1b)		      \
 				   || c == 0x7f))			      \
                               || (c >= 128 && java_part_char_p (c)))
-#define JAVA_ASCII_DIGIT(c)    RANGE (c, '0', '9')
+#define JAVA_ASCII_DIGIT(c)    ISDIGIT (c)
 #define JAVA_ASCII_OCTDIGIT(c) RANGE (c, '0', '7')
-#define JAVA_ASCII_HEXDIGIT(c) (RANGE (c, '0', '9') || 	\
-				RANGE (c, 'a', 'f') ||	\
-				RANGE (c, 'A', 'F'))
+#define JAVA_ASCII_HEXDIGIT(c) ISXDIGIT (c)
 #define JAVA_ASCII_FPCHAR(c)   (RANGE (c, 'd', 'f') || RANGE (c, 'D', 'F') || \
 				c == '.' || JAVA_ASCII_DIGIT (c))
 #define JAVA_FP_SUFFIX(c)      (c == 'D' || c == 'd' || c == 'f' || c == 'F')
 #define JAVA_FP_EXP(c)         (c == 'E' || c == 'F')
 #define JAVA_FP_PM(c)          (c == '-' || c == '+')
-#define JAVA_ASCII_LETTER(c)   (RANGE (c, 'a', 'z') || RANGE (c, 'A', 'Z'))
+#define JAVA_ASCII_LETTER(c)   ISALPHA (c)
 
 /* Constants  */
 #define JAVA_READ_BUFFER 256
diff -rup orig/egcs-CVS20011020/gcc/java/mangle_name.c egcs-CVS20011020/gcc/java/mangle_name.c
--- orig/egcs-CVS20011020/gcc/java/mangle_name.c	Fri Feb  9 15:29:08 2001
+++ egcs-CVS20011020/gcc/java/mangle_name.c	Sat Oct 20 15:25:28 2001
@@ -87,12 +87,11 @@ append_unicode_mangled_name (name, len)
     {
       int ch = UTF8_GET(ptr, limit);
 
-      if ((ch >= '0' && ch <= '9')
+      if ((ISALNUM (ch) && ch != 'U')
 #ifndef NO_DOLLAR_IN_LABEL
 	  || ch == '$'
 #endif
-	  || (ch >= 'a' && ch <= 'z')
-	  || (ch >= 'A' && ch <= 'Z' && ch != 'U'))
+	  )
 	obstack_1grow (mangle_obstack, ch);
       /* Everything else needs encoding */
       else
@@ -149,12 +148,11 @@ unicode_mangling_length (name, len)
 
       if (ch < 0)
 	error ("internal error - invalid Utf8 name");
-      if ((ch >= '0' && ch <= '9')
+      if ((ISALNUM (ch) && ch != 'U')
 #ifndef NO_DOLLAR_IN_LABEL
 	  || ch == '$'
 #endif
-	  || (ch >= 'a' && ch <= 'z')
-	  || (ch >= 'A' && ch <= 'Z' && ch != 'U'))
+	  )
 	num_chars++;
       /* Everything else needs encoding */
       else
diff -rup orig/egcs-CVS20011020/gcc/local-alloc.c egcs-CVS20011020/gcc/local-alloc.c
--- orig/egcs-CVS20011020/gcc/local-alloc.c	Thu Oct 11 07:30:36 2001
+++ egcs-CVS20011020/gcc/local-alloc.c	Sat Oct 20 15:25:28 2001
@@ -2432,7 +2432,7 @@ requires_inout (p)
       case '1':  case '2':  case '3':  case '4': case '5':
       case '6':  case '7':  case '8':  case '9':
 	/* Skip the balance of the matching constraint.  */
-	while (*p >= '0' && *p <= '9')
+	while (ISDIGIT (*p))
 	  p++;
 	break;
 
diff -rup orig/egcs-CVS20011020/gcc/mips-tfile.c egcs-CVS20011020/gcc/mips-tfile.c
--- orig/egcs-CVS20011020/gcc/mips-tfile.c	Thu Oct 11 07:30:38 2001
+++ egcs-CVS20011020/gcc/mips-tfile.c	Sat Oct 20 15:25:28 2001
@@ -681,7 +681,7 @@ main ()
 #endif
 
 #define IS_ASM_IDENT(ch) \
-  (ISALNUM (ch) || (ch) == '_' || (ch) == '.' || (ch) == '$')
+  (ISIDNUM (ch) || (ch) == '.' || (ch) == '$')
 
 
 /* Redefinition of storage classes as an enumeration for better
diff -rup orig/egcs-CVS20011020/gcc/protoize.c egcs-CVS20011020/gcc/protoize.c
--- orig/egcs-CVS20011020/gcc/protoize.c	Fri Oct 19 15:31:56 2001
+++ egcs-CVS20011020/gcc/protoize.c	Sat Oct 20 15:25:28 2001
@@ -716,7 +716,7 @@ static int
 is_id_char (ch)
      int ch;
 {
-  return (ISALNUM (ch) || (ch == '_') || (ch == '$'));
+  return (ISIDNUM (ch) || (ch == '$'));
 }
 
 /* Give a message indicating the proper way to invoke this program and then
@@ -4700,8 +4700,7 @@ main (argc, argv)
   {
     const char *cp;
 
-    for (cp = varargs_style_indicator;
-	 ISALNUM ((const unsigned char)*cp) || *cp == '_'; cp++)
+    for (cp = varargs_style_indicator; ISIDNUM (*cp); cp++)
       continue;
     if (*cp != 0)
       varargs_style_indicator = savestring (varargs_style_indicator,
diff -rup orig/egcs-CVS20011020/gcc/real.c egcs-CVS20011020/gcc/real.c
--- orig/egcs-CVS20011020/gcc/real.c	Thu Oct 11 07:30:40 2001
+++ egcs-CVS20011020/gcc/real.c	Sat Oct 20 15:25:28 2001
@@ -5190,7 +5190,7 @@ asctoeg (ss, y, oprec)
   trail = 0;
 
  nxtcom:
-  if (*s >= '0' && *s <= '9')
+  if (ISDIGIT (*s))
     k = *s - '0';
   else if (*s >= 'a' && *s <= 'f')
     k = 10 + *s - 'a';
@@ -5205,7 +5205,7 @@ asctoeg (ss, y, oprec)
       if ((trail == 0) && (decflg != 0))
 	{
 	  sp = s;
-	  while ((*sp >= '0' && *sp <= '9')
+	  while (ISDIGIT (*sp)
 		 || (base == 16 && ((*sp >= 'a' && *sp <= 'f')
 				    || (*sp >= 'A' && *sp <= 'F'))))
 	    ++sp;
@@ -5345,7 +5345,7 @@ read_expnt:
     }
   if (*s == '+')
     ++s;
-  while ((*s >= '0') && (*s <= '9'))
+  while (ISDIGIT (*s))
     {
       exp *= 10;
       exp += *s++ - '0';
diff -rup orig/egcs-CVS20011020/gcc/recog.c egcs-CVS20011020/gcc/recog.c
--- orig/egcs-CVS20011020/gcc/recog.c	Sat Oct 20 07:30:23 2001
+++ egcs-CVS20011020/gcc/recog.c	Sat Oct 20 15:25:28 2001
@@ -1657,7 +1657,7 @@ asm_operand_ok (op, constraint)
 	     proper matching constraint, but we can't actually fail
 	     the check if they didn't.  Indicate that results are
 	     inconclusive.  */
-	  while (*constraint >= '0' && *constraint <= '9')
+	  while (ISDIGIT (*constraint))
 	    constraint++;
 	  result = -1;
 	  break;
diff -rup orig/egcs-CVS20011020/gcc/reload.c egcs-CVS20011020/gcc/reload.c
--- orig/egcs-CVS20011020/gcc/reload.c	Thu Oct 11 07:30:41 2001
+++ egcs-CVS20011020/gcc/reload.c	Sat Oct 20 15:25:28 2001
@@ -2549,7 +2549,7 @@ find_reloads (insn, replace, ind_levels,
 
 	      commutative = i;
 	    }
-	  else if (c >= '0' && c <= '9')
+	  else if (ISDIGIT (c))
 	    {
 	      c = strtoul (p - 1, &p, 10);
 
diff -rup orig/egcs-CVS20011020/gcc/scan.c egcs-CVS20011020/gcc/scan.c
--- orig/egcs-CVS20011020/gcc/scan.c	Thu Oct 11 07:30:44 2001
+++ egcs-CVS20011020/gcc/scan.c	Sat Oct 20 15:25:28 2001
@@ -63,13 +63,13 @@ scan_ident (fp, s, c)
      int c;
 {
   s->ptr = s->base;
-  if (ISALPHA(c) || c == '_')
+  if (ISIDST(c))
     {
       for (;;)
 	{
 	  SSTRING_PUT(s, c);
 	  c = getc (fp);
-	  if (c == EOF || !(ISALNUM(c) || c == '_'))
+	  if (c == EOF || ! ISIDNUM(c))
 	    break;
 	}
     }
@@ -222,7 +222,7 @@ get_token (fp, s)
       c = INT_TOKEN;
       goto done;
     }
-  if (ISALPHA (c) || c == '_')
+  if (ISIDST (c))
     {
       c = scan_ident (fp, s, c);
       ungetc (c, fp);
diff -rup orig/egcs-CVS20011020/gcc/sched-vis.c egcs-CVS20011020/gcc/sched-vis.c
--- orig/egcs-CVS20011020/gcc/sched-vis.c	Fri Sep 14 07:30:09 2001
+++ egcs-CVS20011020/gcc/sched-vis.c	Sat Oct 20 15:25:28 2001
@@ -578,7 +578,7 @@ print_value (buf, x, verbose)
       if (REGNO (x) < FIRST_PSEUDO_REGISTER)
 	{
 	  int c = reg_names[REGNO (x)][0];
-	  if (c >= '0' && c <= '9')
+	  if (ISDIGIT (c))
 	    cur = safe_concat (buf, cur, "%");
 
 	  cur = safe_concat (buf, cur, reg_names[REGNO (x)]);
diff -rup orig/egcs-CVS20011020/gcc/stringpool.c egcs-CVS20011020/gcc/stringpool.c
--- orig/egcs-CVS20011020/gcc/stringpool.c	Fri Sep 21 16:30:23 2001
+++ egcs-CVS20011020/gcc/stringpool.c	Sat Oct 20 15:25:28 2001
@@ -86,7 +86,7 @@ ggc_alloc_string (contents, length)
 
   if (length == 0)
     return empty_string;
-  if (length == 1 && contents[0] >= '0' && contents[0] <= '9')
+  if (length == 1 && ISDIGIT (contents[0]))
     return digit_string (contents[0] - '0');
 
   obstack_grow0 (&string_stack, contents, length);
diff -rup orig/egcs-CVS20011020/gcc/toplev.c egcs-CVS20011020/gcc/toplev.c
--- orig/egcs-CVS20011020/gcc/toplev.c	Sat Oct 20 07:30:24 2001
+++ egcs-CVS20011020/gcc/toplev.c	Sat Oct 20 15:25:28 2001
@@ -1590,7 +1590,7 @@ read_integral_parameter (p, pname, defva
 
   while (*endp)
     {
-      if (*endp >= '0' && *endp <= '9')
+      if (ISDIGIT (*endp))
 	endp++;
       else
 	break;
@@ -4269,7 +4269,7 @@ decode_g_option (arg)
 	  enum debug_info_type type = da->debug_type;
 	  const char *p = arg + da_len;
 
-	  if (*p && (*p < '0' || *p > '9'))
+	  if (*p && ! ISDIGIT (*p))
 	    continue;
 
 	  /* A debug flag without a level defaults to level 2.
diff -rup orig/egcs-CVS20011020/gcc/tradcif.y egcs-CVS20011020/gcc/tradcif.y
--- orig/egcs-CVS20011020/gcc/tradcif.y	Thu Oct 11 07:30:46 2001
+++ egcs-CVS20011020/gcc/tradcif.y	Sat Oct 20 15:25:28 2001
@@ -246,9 +246,10 @@ parse_number (olen)
   while (len > 0) {
     c = *p++;
     len--;
-    if (c >= 'A' && c <= 'Z') c += 'a' - 'A';
+    if (ISUPPER (c))
+      c += 'a' - 'A';
 
-    if (c >= '0' && c <= '9') {
+    if (ISDIGIT (c)) {
       n *= base;
       n += c - '0';
     } else if (base == 16 && c >= 'a' && c <= 'f') {
@@ -396,7 +397,7 @@ yylex ()
     yyerror ("double quoted strings not allowed in #if expressions");
     return ERROR;
   }
-  if (c >= '0' && c <= '9') {
+  if (ISDIGIT (c)) {
     /* It's a number */
     for (namelen = 0;
 	 c = tokstart[namelen], is_idchar (c) || c == '.'; 
@@ -507,7 +508,7 @@ parse_escape (string_ptr)
 	for (;;)
 	  {
 	    c = *(*string_ptr)++;
-	    if (c >= '0' && c <= '9')
+	    if (ISDIGIT (c))
 	      i = (i << 4) + c - '0';
 	    else if (c >= 'a' && c <= 'f')
 	      i = (i << 4) + c - 'a' + 10;
diff -rup orig/egcs-CVS20011020/gcc/tradcpp.c egcs-CVS20011020/gcc/tradcpp.c
--- orig/egcs-CVS20011020/gcc/tradcpp.c	Thu Oct 11 07:30:46 2001
+++ egcs-CVS20011020/gcc/tradcpp.c	Sat Oct 20 15:25:28 2001
@@ -1474,7 +1474,7 @@ do { ip = &instack[indepth];		\
 	    ibp += 2;
 	  }
 	  c = *ibp++;
-	  if (!ISALNUM (c) && c != '.' && c != '_') {
+	  if (! ISIDNUM (c) && c != '.') {
 	    --ibp;
 	    break;
 	  }
diff -rup orig/egcs-CVS20011020/gcc/tree.c egcs-CVS20011020/gcc/tree.c
--- orig/egcs-CVS20011020/gcc/tree.c	Thu Oct 11 07:30:47 2001
+++ egcs-CVS20011020/gcc/tree.c	Sat Oct 20 15:25:28 2001
@@ -4489,15 +4489,14 @@ clean_symbol_name (p)
      char *p;
 {
   for (; *p; p++)
-    if (! (ISDIGIT(*p)
+    if (! (ISALNUM (*p)
 #ifndef NO_DOLLAR_IN_LABEL	/* this for `$'; unlikely, but... -- kr */
 	    || *p == '$'
 #endif
 #ifndef NO_DOT_IN_LABEL		/* this for `.'; unlikely, but...  */
 	    || *p == '.'
 #endif
-	    || ISUPPER (*p)
-	    || ISLOWER (*p)))
+	   ))
       *p = '_';
 }
   
diff -rup orig/egcs-CVS20011020/gcc/varasm.c egcs-CVS20011020/gcc/varasm.c
--- orig/egcs-CVS20011020/gcc/varasm.c	Fri Oct 19 15:40:20 2001
+++ egcs-CVS20011020/gcc/varasm.c	Sat Oct 20 15:25:28 2001
@@ -758,7 +758,7 @@ decode_reg_name (asmspec)
 
       /* Allow a decimal number as a "register name".  */
       for (i = strlen (asmspec) - 1; i >= 0; i--)
-	if (! (asmspec[i] >= '0' && asmspec[i] <= '9'))
+	if (! ISDIGIT (asmspec[i]))
 	  break;
       if (asmspec[0] != 0 && i < 0)
 	{



More information about the Gcc-patches mailing list