Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/db/btree __bt_search(): Rename the local variable "...



details:   https://anonhg.NetBSD.org/src/rev/641e7c887dea
branches:  trunk
changeset: 519922:641e7c887dea
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Dec 30 19:18:23 2001 +0000

description:
__bt_search(): Rename the local variable "index" to "idx" to avoid
shadowing a global declaration.

diffstat:

 lib/libc/db/btree/bt_search.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (59 lines):

diff -r e9c42ecfe6d8 -r 641e7c887dea lib/libc/db/btree/bt_search.c
--- a/lib/libc/db/btree/bt_search.c     Sun Dec 30 18:52:54 2001 +0000
+++ b/lib/libc/db/btree/bt_search.c     Sun Dec 30 19:18:23 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bt_search.c,v 1.11 1998/12/09 12:42:47 christos Exp $  */
+/*     $NetBSD: bt_search.c,v 1.12 2001/12/30 19:18:23 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)bt_search.c        8.8 (Berkeley) 7/31/94";
 #else
-__RCSID("$NetBSD: bt_search.c,v 1.11 1998/12/09 12:42:47 christos Exp $");
+__RCSID("$NetBSD: bt_search.c,v 1.12 2001/12/30 19:18:23 thorpej Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -77,7 +77,7 @@
        int *exactp;
 {
        PAGE *h;
-       indx_t base, index, lim;
+       indx_t base, idx, lim;
        pgno_t pg;
        int cmp;
 
@@ -89,7 +89,7 @@
                /* Do a binary search on the current page. */
                t->bt_cur.page = h;
                for (base = 0, lim = NEXTINDEX(h); lim; lim >>= 1) {
-                       t->bt_cur.index = index = base + ((u_int32_t)lim >> 1);
+                       t->bt_cur.index = idx = base + ((u_int32_t)lim >> 1);
                        if ((cmp = __bt_cmp(t, key, &t->bt_cur)) == 0) {
                                if (h->flags & P_BLEAF) {
                                        *exactp = 1;
@@ -98,7 +98,7 @@
                                goto next;
                        }
                        if (cmp > 0) {
-                               base = index + 1;
+                               base = idx + 1;
                                --lim;
                        }
                }
@@ -134,10 +134,10 @@
                 * be a parent page for the key.  If a split later occurs, the
                 * inserted page will be to the right of the saved page.
                 */
-               index = base ? base - 1 : base;
+               idx = base ? base - 1 : base;
 
-next:          BT_PUSH(t, h->pgno, index);
-               pg = GETBINTERNAL(h, index)->pgno;
+next:          BT_PUSH(t, h->pgno, idx);
+               pg = GETBINTERNAL(h, idx)->pgno;
                mpool_put(t->bt_mp, h, 0);
        }
 }



Home | Main Index | Thread Index | Old Index