From: Paul Eggert Date: Tue, 15 Mar 2011 18:13:15 +0000 (-0700) Subject: * search.c (boyer_moore): Rename locals to avoid shadowing. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~554^2~68 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1f3561e4ca0b2338e162de9ae29caa814ae3a457;p=emacs.git * search.c (boyer_moore): Rename locals to avoid shadowing. * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE): Likewise. --- diff --git a/src/ChangeLog b/src/ChangeLog index a74b15aea6f..9793b5692f8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2011-03-15 Paul Eggert + * search.c (boyer_moore): Rename locals to avoid shadowing. + * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE): Likewise. + * search.c (simple_search): Remove unused var. * dired.c (compile_pattern): Move decl from here ... diff --git a/src/character.h b/src/character.h index bbf5550c711..ad1577a5c90 100644 --- a/src/character.h +++ b/src/character.h @@ -377,10 +377,10 @@ along with GNU Emacs. If not, see . */ if (STRING_MULTIBYTE (STRING)) \ { \ unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \ - int len; \ + int ptrlen; \ \ - OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \ - BYTEIDX += len; \ + OUTPUT = STRING_CHAR_AND_LENGTH (ptr, ptrlen); \ + BYTEIDX += ptrlen; \ } \ else \ { \ diff --git a/src/search.c b/src/search.c index dbc82bdb3d9..9869a7aad55 100644 --- a/src/search.c +++ b/src/search.c @@ -1725,17 +1725,17 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat, /* Setup translate_prev_byte1/2/3/4 from CHAR_BASE. Only a byte following them are the target of translation. */ unsigned char str[MAX_MULTIBYTE_LENGTH]; - int len = CHAR_STRING (char_base, str); + int cblen = CHAR_STRING (char_base, str); - translate_prev_byte1 = str[len - 2]; - if (len > 2) + translate_prev_byte1 = str[cblen - 2]; + if (cblen > 2) { - translate_prev_byte2 = str[len - 3]; - if (len > 3) + translate_prev_byte2 = str[cblen - 3]; + if (cblen > 3) { - translate_prev_byte3 = str[len - 4]; - if (len > 4) - translate_prev_byte4 = str[len - 5]; + translate_prev_byte3 = str[cblen - 4]; + if (cblen > 4) + translate_prev_byte4 = str[cblen - 5]; } } }