diff options
author | Xin LI <delphij@FreeBSD.org> | 2009-03-03 02:16:12 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2009-03-03 02:16:12 +0000 |
commit | 4c66e4b64b1055c1d43ace08b78f84597fc982bc (patch) | |
tree | e43f113728d88c5ddee8f31f68f971a133ef892f /lib/libc/db/btree/bt_seq.c | |
parent | 0ac22237f12015101ffe02a37786a092603c1f03 (diff) |
Rename variable 'index' to 'idx' to avoid name collision with index(3),
this commit does not affect any object code.
Obtained from: OpenBSD
Verified with: md5(1)
Notes
Notes:
svn path=/head/; revision=189292
Diffstat (limited to 'lib/libc/db/btree/bt_seq.c')
-rw-r--r-- | lib/libc/db/btree/bt_seq.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/libc/db/btree/bt_seq.c b/lib/libc/db/btree/bt_seq.c index 3093c91e053e..a0679426af71 100644 --- a/lib/libc/db/btree/bt_seq.c +++ b/lib/libc/db/btree/bt_seq.c @@ -232,7 +232,7 @@ __bt_seqadv(BTREE *t, EPG *ep, int flags) { CURSOR *c; PAGE *h; - indx_t index; + indx_t idx; pgno_t pg; int exact; @@ -270,15 +270,15 @@ __bt_seqadv(BTREE *t, EPG *ep, int flags) */ 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. */ @@ -293,22 +293,22 @@ usecurrent: F_CLR(c, CURS_AFTER | CURS_BEFORE); 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); } @@ -421,13 +421,10 @@ __bt_first(BTREE *t, const DBT *key, EPG *erval, int *exactp) * Parameters: * t: the tree * pgno: page number - * index: page index + * idx: page index */ void -__bt_setcur(t, pgno, index) - BTREE *t; - pgno_t pgno; - u_int index; +__bt_setcur(BTREE *t, pgno_t pgno, u_int idx) { /* Lose any already deleted key. */ if (t->bt_cursor.key.data != NULL) { @@ -439,6 +436,6 @@ __bt_setcur(t, pgno, index) /* 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); } |