diff options
author | Sean Bright <sean@malleable.com> | 2008-08-10 19:35:50 +0000 |
---|---|---|
committer | Sean Bright <sean@malleable.com> | 2008-08-10 19:35:50 +0000 |
commit | b69c8e6ab5b5d20a964d67e93cda8dc07da61fa4 (patch) | |
tree | b4d1b3f66cf87177cb1c8a8ee596b6a9458f8f6c /main/db1-ast/recno | |
parent | 3ffb39833b25a02108214d7584733bc6b9c334df (diff) |
Another big chunk of changes from the RSW branch. Bunch of stuff from main/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/db1-ast/recno')
-rw-r--r-- | main/db1-ast/recno/rec_delete.c | 10 | ||||
-rw-r--r-- | main/db1-ast/recno/rec_put.c | 18 |
2 files changed, 14 insertions, 14 deletions
diff --git a/main/db1-ast/recno/rec_delete.c b/main/db1-ast/recno/rec_delete.c index fc2047226..f40b5caed 100644 --- a/main/db1-ast/recno/rec_delete.c +++ b/main/db1-ast/recno/rec_delete.c @@ -151,10 +151,10 @@ rec_rdelete(t, nrec) * RET_SUCCESS, RET_ERROR. */ int -__rec_dleaf(t, h, index) +__rec_dleaf(t, h, idx) BTREE *t; PAGE *h; - u_int32_t index; + u_int32_t idx; { RLEAF *rl; indx_t *ip, cnt, offset; @@ -172,7 +172,7 @@ __rec_dleaf(t, h, index) * down, overwriting the deleted record and its index. If the record * uses overflow pages, make them available for reuse. */ - to = rl = GETRLEAF(h, index); + to = rl = GETRLEAF(h, idx); if (rl->flags & P_BIGDATA && __ovfl_delete(t, rl->bytes) == RET_ERROR) return (RET_ERROR); nbytes = NRLEAF(rl); @@ -185,8 +185,8 @@ __rec_dleaf(t, h, index) memmove(from + nbytes, from, (char *)to - from); h->upper += nbytes; - offset = h->linp[index]; - for (cnt = &h->linp[index] - (ip = &h->linp[0]); cnt--; ++ip) + offset = h->linp[idx]; + for (cnt = &h->linp[idx] - (ip = &h->linp[0]); cnt--; ++ip) if (ip[0] < offset) ip[0] += nbytes; for (cnt = &h->linp[NEXTINDEX(h)] - ip; --cnt; ++ip) diff --git a/main/db1-ast/recno/rec_put.c b/main/db1-ast/recno/rec_put.c index 331699867..ba8861297 100644 --- a/main/db1-ast/recno/rec_put.c +++ b/main/db1-ast/recno/rec_put.c @@ -196,7 +196,7 @@ __rec_iput(t, nrec, data, flags) DBT tdata; EPG *e; PAGE *h; - indx_t index, nxtindex; + indx_t idx, nxtindex; pgno_t pg; u_int32_t nbytes; int dflags, status; @@ -227,7 +227,7 @@ __rec_iput(t, nrec, data, flags) return (RET_ERROR); h = e->page; - index = e->index; + idx = e->index; /* * Add the specified key/data pair to the tree. The R_IAFTER and @@ -237,13 +237,13 @@ __rec_iput(t, nrec, data, flags) */ switch (flags) { case R_IAFTER: - ++index; + ++idx; break; case R_IBEFORE: break; default: if (nrec < t->bt_nrecs && - __rec_dleaf(t, h, index) == RET_ERROR) { + __rec_dleaf(t, h, idx) == RET_ERROR) { mpool_put(t->bt_mp, h, 0); return (RET_ERROR); } @@ -257,18 +257,18 @@ __rec_iput(t, nrec, data, flags) */ nbytes = NRLEAFDBT(data->size); if ((u_int32_t) (h->upper - h->lower) < nbytes + sizeof(indx_t)) { - status = __bt_split(t, h, NULL, data, dflags, nbytes, index); + status = __bt_split(t, h, NULL, data, dflags, nbytes, idx); if (status == RET_SUCCESS) ++t->bt_nrecs; return (status); } - if (index < (nxtindex = NEXTINDEX(h))) - memmove(h->linp + index + 1, h->linp + index, - (nxtindex - index) * sizeof(indx_t)); + if (idx < (nxtindex = NEXTINDEX(h))) + memmove(h->linp + idx + 1, h->linp + idx, + (nxtindex - idx) * sizeof(indx_t)); h->lower += sizeof(indx_t); - h->linp[index] = h->upper -= nbytes; + h->linp[idx] = h->upper -= nbytes; dest = (char *)h + h->upper; WR_RLEAF(dest, data, dflags); |