]> git.eshelyaron.com Git - emacs.git/commitdiff
(re_search_2, re_match_2_internal): Convert second arg
authorEli Zaretskii <eliz@gnu.org>
Sun, 24 Apr 2005 16:41:14 +0000 (16:41 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sun, 24 Apr 2005 16:41:14 +0000 (16:41 +0000)
of RE_TRANSLATE to int, to shut up GCC warnings.

src/ChangeLog
src/regex.c

index 4de54bcb7b1205d5f938fddc952a8688a1e5a928..e239b41a66fb6e9993fb1d47909e6d35bf741abd 100644 (file)
@@ -1,5 +1,8 @@
 2005-04-24  Eli Zaretskii  <eliz@gnu.org>
 
+       * regex.c (re_search_2, re_match_2_internal): Convert second arg
+       of RE_TRANSLATE to int, to shut up GCC warnings.
+
        * fileio.c (Fcopy_file): Doc fix.
        [MSDOS]: Fix call to emacs_open: buffer_file_type not defined and
        not needed.
index a223f1707657dd278bf540443bebda88dde150f3..44feee4cddf0c65d9e28a7d849893d9da2a11f0f 100644 (file)
@@ -4290,12 +4290,19 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
                        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 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
              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;