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 Rename the local variable "index" to "idx"...



details:   https://anonhg.NetBSD.org/src/rev/d534785c1147
branches:  trunk
changeset: 519923:d534785c1147
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Dec 30 19:20:40 2001 +0000

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

diffstat:

 lib/libc/db/btree/bt_seq.c |  30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diffs (99 lines):

diff -r 641e7c887dea -r d534785c1147 lib/libc/db/btree/bt_seq.c
--- a/lib/libc/db/btree/bt_seq.c        Sun Dec 30 19:18:23 2001 +0000
+++ b/lib/libc/db/btree/bt_seq.c        Sun Dec 30 19:20:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bt_seq.c,v 1.11 1998/12/09 12:42:47 christos Exp $     */
+/*     $NetBSD: bt_seq.c,v 1.12 2001/12/30 19:20:40 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)bt_seq.c   8.7 (Berkeley) 7/20/94";
 #else
-__RCSID("$NetBSD: bt_seq.c,v 1.11 1998/12/09 12:42:47 christos Exp $");
+__RCSID("$NetBSD: bt_seq.c,v 1.12 2001/12/30 19:20:40 thorpej Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -252,7 +252,7 @@
 {
        CURSOR *c;
        PAGE *h;
-       indx_t index = 0;       /* pacify gcc */
+       indx_t idx = 0; /* pacify gcc */
        pgno_t pg;
        int exact;
 
@@ -290,15 +290,15 @@
                 */
                if (F_ISSET(c, CURS_AFTER))
                        goto usecurrent;
-               index = c->pg.index;
-               if (++index == NEXTINDEX(h)) {
+               idx = c->pg.index;
+               if (++idx == NEXTINDEX(h)) {
                        pg = h->nextpg;
                        mpool_put(t->bt_mp, h, 0);
                        if (pg == P_INVALID)
                                return (RET_SPECIAL);
                        if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
                                return (RET_ERROR);
-                       index = 0;
+                       idx = 0;
                }
                break;
        case R_PREV:                    /* Previous record. */
@@ -313,22 +313,22 @@
                        ep->index = c->pg.index;
                        return (RET_SUCCESS);
                }
-               index = c->pg.index;
-               if (index == 0) {
+               idx = c->pg.index;
+               if (idx == 0) {
                        pg = h->prevpg;
                        mpool_put(t->bt_mp, h, 0);
                        if (pg == P_INVALID)
                                return (RET_SPECIAL);
                        if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
                                return (RET_ERROR);
-                       index = NEXTINDEX(h) - 1;
+                       idx = NEXTINDEX(h) - 1;
                } else
-                       --index;
+                       --idx;
                break;
        }
 
        ep->page = h;
-       ep->index = index;
+       ep->index = idx;
        return (RET_SUCCESS);
 }
 
@@ -445,13 +445,13 @@
  * Parameters:
  *     t:      the tree
  *   pgno:     page number
- *  index:     page index
+ *    idx:     page index
  */
 void
-__bt_setcur(t, pgno, index)
+__bt_setcur(t, pgno, idx)
        BTREE *t;
        pgno_t pgno;
-       u_int index;
+       u_int idx;
 {
        /* Lose any already deleted key. */
        if (t->bt_cursor.key.data != NULL) {
@@ -463,6 +463,6 @@
 
        /* Update the cursor. */
        t->bt_cursor.pg.pgno = pgno;
-       t->bt_cursor.pg.index = index;
+       t->bt_cursor.pg.index = idx;
        F_SET(&t->bt_cursor, CURS_INIT);
 }



Home | Main Index | Thread Index | Old Index