changeset 1328:0aa10b723959

Use RE_TRANSLATE_P to check whether translation is needed.
author Andreas Schwab <schwab@suse.de>
date Wed, 15 Apr 1998 10:33:18 +0000
parents 25dd289d21bf
children 818db3848f2b
files regex.c
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/regex.c
+++ b/regex.c
@@ -1540,7 +1540,7 @@
 #define PATFETCH(c)							\
   do {if (p == pend) return REG_EEND;					\
     c = (unsigned char) *p++;						\
-    if (translate) c = RE_TRANSLATE (translate, c);			\
+    if (RE_TRANSLATE_P (translate)) c = RE_TRANSLATE (translate, c);	\
   } while (0)
 #endif
 
@@ -1561,7 +1561,8 @@
    when we use a character as a subscript we must make it unsigned.  */
 #ifndef TRANSLATE
 #define TRANSLATE(d) \
-  (translate ? (unsigned) RE_TRANSLATE (translate, (unsigned) (d)) : (d))
+  (RE_TRANSLATE_P (translate) \
+   ? (unsigned) RE_TRANSLATE (translate, (unsigned) (d)) : (d))
 #endif
 
 
@@ -3785,8 +3786,8 @@
 
 	      /* Written out as an if-else to avoid testing `translate'
 		 inside the loop.  */
-	      if (translate)
-		{
+	            if (RE_TRANSLATE_P (translate))
+{
 		  if (multibyte)
 		    while (range > lim)
 		      {
@@ -3822,7 +3823,7 @@
 			  : size1 - startpos);
 
 	      buf_ch = STRING_CHAR (d, room);
-	      if (translate)
+	      if (RE_TRANSLATE_P (translate))
 		buf_ch = RE_TRANSLATE (translate, buf_ch);
 
 	      if (! (buf_ch >= 0400
@@ -4498,7 +4499,7 @@
 
 	  /* This is written out as an if-else so we don't waste time
 	     testing `translate' inside the loop.  */
-	  if (translate)
+	  if (RE_TRANSLATE_P (translate))
 	    {
 #ifdef emacs
 	      if (multibyte)
@@ -4873,7 +4874,7 @@
 
 		/* Compare that many; failure if mismatch, else move
 		   past them.  */
-		if (translate
+		if (RE_TRANSLATE_P (translate)
 		    ? bcmp_translate (d, d2, mcnt, translate)
 		    : bcmp (d, d2, mcnt))
 		  goto fail;