From: Paul Eggert Date: Tue, 15 Mar 2011 01:39:30 +0000 (-0700) Subject: * minibuf.c (Ftry_completion, Fall_completions): Rename or remove locals X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~554^2~86 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=62137a95f36f5d8b1d43e805811c8f7a15cb8f44;p=emacs.git * minibuf.c (Ftry_completion, Fall_completions): Rename or remove locals to avoid shadowing. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6354508250e..2fb5e03ca96 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,8 @@ 2011-03-15 Paul Eggert * minibuf.c (choose_minibuf_frame_1): Now static. + (Ftry_completion, Fall_completions): Rename or remove locals + to avoid shadowing. * marker.c (bytepos_to_charpos): Remove; unused. diff --git a/src/minibuf.c b/src/minibuf.c index caf41115305..8ff861b2403 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1212,7 +1212,7 @@ is used to further constrain the set of candidates. */) && (!SYMBOLP (XCAR (collection)) || NILP (XCAR (collection))))) ? list_table : function_table)); - int index = 0, obsize = 0; + int idx = 0, obsize = 0; int matchcount = 0; int bindcount = -1; Lisp_Object bucket, zero, end, tem; @@ -1231,7 +1231,7 @@ is used to further constrain the set of candidates. */) { collection = check_obarray (collection); obsize = XVECTOR (collection)->size; - bucket = XVECTOR (collection)->contents[index]; + bucket = XVECTOR (collection)->contents[idx]; } while (1) @@ -1262,23 +1262,23 @@ is used to further constrain the set of candidates. */) else XSETFASTINT (bucket, 0); } - else if (++index >= obsize) + else if (++idx >= obsize) break; else { - bucket = XVECTOR (collection)->contents[index]; + bucket = XVECTOR (collection)->contents[idx]; continue; } } else /* if (type == hash_table) */ { - while (index < HASH_TABLE_SIZE (XHASH_TABLE (collection)) - && NILP (HASH_HASH (XHASH_TABLE (collection), index))) - index++; - if (index >= HASH_TABLE_SIZE (XHASH_TABLE (collection))) + while (idx < HASH_TABLE_SIZE (XHASH_TABLE (collection)) + && NILP (HASH_HASH (XHASH_TABLE (collection), idx))) + idx++; + if (idx >= HASH_TABLE_SIZE (XHASH_TABLE (collection))) break; else - elt = eltstring = HASH_KEY (XHASH_TABLE (collection), index++); + elt = eltstring = HASH_KEY (XHASH_TABLE (collection), idx++); } /* Is this element a possible completion? */ @@ -1333,7 +1333,7 @@ is used to further constrain the set of candidates. */) tem = (type == hash_table ? call2 (predicate, elt, HASH_VALUE (XHASH_TABLE (collection), - index - 1)) + idx - 1)) : call1 (predicate, elt)); UNGCPRO; } @@ -1477,7 +1477,7 @@ with a space are ignored unless STRING itself starts with a space. */) : NILP (collection) || (CONSP (collection) && (!SYMBOLP (XCAR (collection)) || NILP (XCAR (collection)))); - int index = 0, obsize = 0; + int idx = 0, obsize = 0; int bindcount = -1; Lisp_Object bucket, tem, zero; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; @@ -1494,7 +1494,7 @@ with a space are ignored unless STRING itself starts with a space. */) { collection = check_obarray (collection); obsize = XVECTOR (collection)->size; - bucket = XVECTOR (collection)->contents[index]; + bucket = XVECTOR (collection)->contents[idx]; } while (1) @@ -1525,23 +1525,23 @@ with a space are ignored unless STRING itself starts with a space. */) else XSETFASTINT (bucket, 0); } - else if (++index >= obsize) + else if (++idx >= obsize) break; else { - bucket = XVECTOR (collection)->contents[index]; + bucket = XVECTOR (collection)->contents[idx]; continue; } } else /* if (type == 3) */ { - while (index < HASH_TABLE_SIZE (XHASH_TABLE (collection)) - && NILP (HASH_HASH (XHASH_TABLE (collection), index))) - index++; - if (index >= HASH_TABLE_SIZE (XHASH_TABLE (collection))) + while (idx < HASH_TABLE_SIZE (XHASH_TABLE (collection)) + && NILP (HASH_HASH (XHASH_TABLE (collection), idx))) + idx++; + if (idx >= HASH_TABLE_SIZE (XHASH_TABLE (collection))) break; else - elt = eltstring = HASH_KEY (XHASH_TABLE (collection), index++); + elt = eltstring = HASH_KEY (XHASH_TABLE (collection), idx++); } /* Is this element a possible completion? */ @@ -1566,8 +1566,6 @@ with a space are ignored unless STRING itself starts with a space. */) { /* Yes. */ Lisp_Object regexps; - Lisp_Object zero; - XSETFASTINT (zero, 0); /* Ignore this element if it fails to match all the regexps. */ { @@ -1603,7 +1601,7 @@ with a space are ignored unless STRING itself starts with a space. */) GCPRO4 (tail, eltstring, allmatches, string); tem = type == 3 ? call2 (predicate, elt, - HASH_VALUE (XHASH_TABLE (collection), index - 1)) + HASH_VALUE (XHASH_TABLE (collection), idx - 1)) : call1 (predicate, elt); UNGCPRO; }