]> git.eshelyaron.com Git - emacs.git/commitdiff
* regex.c (FREE_VAR): Rewrite so as not to use empty "else",
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Mar 2011 18:40:00 +0000 (11:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Mar 2011 18:40:00 +0000 (11:40 -0700)
which gcc can warn about.

src/ChangeLog
src/regex.c

index 2bcca8b0562bc046945cdf47d73f659cbf45f5a2..e533b07d41a040d2bb796690d696c77f104a9313 100644 (file)
@@ -5,6 +5,8 @@
        (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
        (regex_compile, re_search_2, re_match_2_internal):
        Remove unused local vars.
+       (FREE_VAR): Rewrite so as not to use empty "else",
+       which gcc can warn about.
 
        * search.c (boyer_moore): Rename locals to avoid shadowing.
        * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE): Likewise.
index 0187a103b326415feb490a297a71a7ca5338b425..9c950a42b22385f77ef5bc5ab5b84de36ba80d65 100644 (file)
@@ -4666,7 +4666,14 @@ static int bcmp_translate _RE_ARGS((re_char *s1, re_char *s2,
 
 /* Free everything we malloc.  */
 #ifdef MATCH_MAY_ALLOCATE
-# define FREE_VAR(var) if (var) { REGEX_FREE (var); var = NULL; } else
+# define FREE_VAR(var)                                                 \
+  do {                                                                 \
+    if (var)                                                           \
+      {                                                                        \
+       REGEX_FREE (var);                                               \
+       var = NULL;                                                     \
+      }                                                                        \
+  } while (0)
 # define FREE_VARIABLES()                                              \
   do {                                                                 \
     REGEX_FREE_STACK (fail_stack.stack);                               \