changeset 61805:139319ba429a

(re_search_2, re_match_2_internal): Convert second arg of RE_TRANSLATE to int, to shut up GCC warnings.
author Eli Zaretskii <eliz@gnu.org>
date Sun, 24 Apr 2005 16:40:43 +0000
parents 3dfc34e3266a
children ce9a234f2b28
files src/regex.c
diffstat 1 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/regex.c	Sun Apr 24 15:11:38 2005 +0000
+++ b/src/regex.c	Sun Apr 24 16:40:43 2005 +0000
@@ -4290,12 +4290,19 @@
 			d += buf_charlen;
 		      }
 		  else
-		    while (range > lim
-			   && !fastmap[RE_TRANSLATE (translate, *d)])
-		      {
-			d++;
-			range--;
-		      }
+		    {
+		      /* Convert *d to integer to shut up GCC's
+			 whining about comparison that is always
+			 true.  */
+		      int di = *d;
+
+		      while (range > lim
+			     && !fastmap[RE_TRANSLATE (translate, di)])
+			{
+			  di = *(++d);
+			  range--;
+			}
+		    }
 		}
 	      else
 		while (range > lim && !fastmap[*d])
@@ -5244,8 +5251,13 @@
 	      else
 		do
 		  {
+		    /* Avoid compiler whining about comparison being
+		       always true.  */
+		    int di;
+
 		    PREFETCH ();
-		    if (RE_TRANSLATE (translate, *d) != *p++)
+		    di = *d;
+		    if (RE_TRANSLATE (translate, di) != *p++)
 		      {
 			d = dfail;
 			goto fail;