From: Paul Eggert Date: Tue, 15 Mar 2011 18:40:00 +0000 (-0700) Subject: * regex.c (FREE_VAR): Rewrite so as not to use empty "else", X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~554^2~64 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=952db0d7ad3872dd675d23f7e60ae3298a8d8d52;p=emacs.git * regex.c (FREE_VAR): Rewrite so as not to use empty "else", which gcc can warn about. --- diff --git a/src/ChangeLog b/src/ChangeLog index 2bcca8b0562..e533b07d41a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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. diff --git a/src/regex.c b/src/regex.c index 0187a103b32..9c950a42b22 100644 --- a/src/regex.c +++ b/src/regex.c @@ -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); \