diff options
author | delphij <delphij@FreeBSD.org> | 2009-03-02 23:47:18 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2009-03-02 23:47:18 +0000 |
commit | 7fd77a056c7750353e5b351f39749ba813255b32 (patch) | |
tree | 5a67c3be623d7be485fac882eb4ef91bd1e65262 /lib/libc/db/btree | |
parent | 63f98fcc6a46518f1e430026c32dd9c31dff0a84 (diff) | |
download | FreeBSD-src-7fd77a056c7750353e5b351f39749ba813255b32.zip FreeBSD-src-7fd77a056c7750353e5b351f39749ba813255b32.tar.gz |
Diff reduction against OpenBSD: ANSI'fy prototypes.
(This is part of a larger changeset which is intended to reduce diff only,
thus some prototypes were left intact since they will be changed in the
future).
Verified with: md5(1)
Diffstat (limited to 'lib/libc/db/btree')
-rw-r--r-- | lib/libc/db/btree/bt_close.c | 10 | ||||
-rw-r--r-- | lib/libc/db/btree/bt_conv.c | 13 | ||||
-rw-r--r-- | lib/libc/db/btree/bt_debug.c | 16 | ||||
-rw-r--r-- | lib/libc/db/btree/bt_delete.c | 22 | ||||
-rw-r--r-- | lib/libc/db/btree/bt_get.c | 6 | ||||
-rw-r--r-- | lib/libc/db/btree/bt_open.c | 15 | ||||
-rw-r--r-- | lib/libc/db/btree/bt_overflow.c | 16 | ||||
-rw-r--r-- | lib/libc/db/btree/bt_page.c | 8 | ||||
-rw-r--r-- | lib/libc/db/btree/bt_put.c | 11 | ||||
-rw-r--r-- | lib/libc/db/btree/bt_search.c | 17 | ||||
-rw-r--r-- | lib/libc/db/btree/bt_seq.c | 22 | ||||
-rw-r--r-- | lib/libc/db/btree/bt_split.c | 48 | ||||
-rw-r--r-- | lib/libc/db/btree/bt_utils.c | 17 |
13 files changed, 52 insertions, 169 deletions
diff --git a/lib/libc/db/btree/bt_close.c b/lib/libc/db/btree/bt_close.c index 46abf07..1f85992 100644 --- a/lib/libc/db/btree/bt_close.c +++ b/lib/libc/db/btree/bt_close.c @@ -61,8 +61,7 @@ static int bt_meta(BTREE *); * RET_ERROR, RET_SUCCESS */ int -__bt_close(dbp) - DB *dbp; +__bt_close(DB *dbp) { BTREE *t; int fd; @@ -116,9 +115,7 @@ __bt_close(dbp) * RET_SUCCESS, RET_ERROR. */ int -__bt_sync(dbp, flags) - const DB *dbp; - u_int flags; +__bt_sync(const DB *dbp, u_int flags) { BTREE *t; int status; @@ -159,8 +156,7 @@ __bt_sync(dbp, flags) * RET_ERROR, RET_SUCCESS */ static int -bt_meta(t) - BTREE *t; +bt_meta(BTREE *t) { BTMETA m; void *p; diff --git a/lib/libc/db/btree/bt_conv.c b/lib/libc/db/btree/bt_conv.c index 1f13faa..ba4a38b 100644 --- a/lib/libc/db/btree/bt_conv.c +++ b/lib/libc/db/btree/bt_conv.c @@ -56,10 +56,7 @@ static void mswap(PAGE *); * h: page to convert */ void -__bt_pgin(t, pg, pp) - void *t; - pgno_t pg; - void *pp; +__bt_pgin(void *t, pgno_t pg, void *pp) { PAGE *h; indx_t i, top; @@ -124,10 +121,7 @@ __bt_pgin(t, pg, pp) } void -__bt_pgout(t, pg, pp) - void *t; - pgno_t pg; - void *pp; +__bt_pgout(void *t, pgno_t pg, void *pp) { PAGE *h; indx_t i, top; @@ -198,8 +192,7 @@ __bt_pgout(t, pg, pp) * p: page to convert */ static void -mswap(pg) - PAGE *pg; +mswap(PAGE *pg) { char *p; diff --git a/lib/libc/db/btree/bt_debug.c b/lib/libc/db/btree/bt_debug.c index 19ccaca..5275bb7 100644 --- a/lib/libc/db/btree/bt_debug.c +++ b/lib/libc/db/btree/bt_debug.c @@ -53,8 +53,7 @@ __FBSDID("$FreeBSD$"); * dbp: pointer to the DB */ void -__bt_dump(dbp) - DB *dbp; +__bt_dump(DB *dbp) { BTREE *t; PAGE *h; @@ -97,8 +96,7 @@ __bt_dump(dbp) * h: pointer to the PAGE */ void -__bt_dmpage(h) - PAGE *h; +__bt_dmpage(PAGE *h) { BTMETA *m; char *sep; @@ -131,9 +129,7 @@ __bt_dmpage(h) * n: page number to dump. */ void -__bt_dnpage(dbp, pgno) - DB *dbp; - pgno_t pgno; +__bt_dnpage(DB *dbp, pgno_t pgno) { BTREE *t; PAGE *h; @@ -152,8 +148,7 @@ __bt_dnpage(dbp, pgno) * h: pointer to the PAGE */ void -__bt_dpage(h) - PAGE *h; +__bt_dpage(PAGE *h) { BINTERNAL *bi; BLEAF *bl; @@ -249,8 +244,7 @@ __bt_dpage(h) * dbp: pointer to the DB */ void -__bt_stat(dbp) - DB *dbp; +__bt_stat(DB *dbp) { extern u_long bt_cache_hit, bt_cache_miss, bt_pfxsaved, bt_rootsplit; extern u_long bt_sortsplit, bt_split; diff --git a/lib/libc/db/btree/bt_delete.c b/lib/libc/db/btree/bt_delete.c index f520f78..5eeea47 100644 --- a/lib/libc/db/btree/bt_delete.c +++ b/lib/libc/db/btree/bt_delete.c @@ -58,10 +58,7 @@ static int __bt_stkacq(BTREE *, PAGE **, CURSOR *); * Return RET_SPECIAL if the key is not found. */ int -__bt_delete(dbp, key, flags) - const DB *dbp; - const DBT *key; - u_int flags; +__bt_delete(const DB *dbp, const DBT *key, u_int flags) { BTREE *t; CURSOR *c; @@ -139,10 +136,7 @@ __bt_delete(dbp, key, flags) * 0 on success, 1 on failure */ static int -__bt_stkacq(t, hp, c) - BTREE *t; - PAGE **hp; - CURSOR *c; +__bt_stkacq(BTREE *t, PAGE **hp, CURSOR *c) { BINTERNAL *bi; EPG *e; @@ -286,9 +280,7 @@ ret: mpool_put(t->bt_mp, h, 0); * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found. */ static int -__bt_bdelete(t, key) - BTREE *t; - const DBT *key; +__bt_bdelete(BTREE *t, const DBT *key) { EPG *e; PAGE *h; @@ -373,9 +365,7 @@ loop: if ((e = __bt_search(t, key, &exact)) == NULL) * mpool_put's the page */ static int -__bt_pdelete(t, h) - BTREE *t; - PAGE *h; +__bt_pdelete(BTREE *t, PAGE *h) { BINTERNAL *bi; PAGE *pg; @@ -633,9 +623,7 @@ dup2: c->pg.pgno = e.page->pgno; * h: page to be deleted */ static int -__bt_relink(t, h) - BTREE *t; - PAGE *h; +__bt_relink(BTREE *t, PAGE *h) { PAGE *pg; diff --git a/lib/libc/db/btree/bt_get.c b/lib/libc/db/btree/bt_get.c index 95d8e00..77fae30 100644 --- a/lib/libc/db/btree/bt_get.c +++ b/lib/libc/db/btree/bt_get.c @@ -58,11 +58,7 @@ __FBSDID("$FreeBSD$"); * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found. */ int -__bt_get(dbp, key, data, flags) - const DB *dbp; - const DBT *key; - DBT *data; - u_int flags; +__bt_get(const DB *dbp, const DBT *key, DBT *data, u_int flags) { BTREE *t; EPG *e; diff --git a/lib/libc/db/btree/bt_open.c b/lib/libc/db/btree/bt_open.c index 92ac140..749b7cd 100644 --- a/lib/libc/db/btree/bt_open.c +++ b/lib/libc/db/btree/bt_open.c @@ -87,10 +87,7 @@ static int tmp(void); * */ DB * -__bt_open(fname, flags, mode, openinfo, dflags) - const char *fname; - int flags, mode, dflags; - const BTREEINFO *openinfo; +__bt_open(const char *fname, int flags, int mode, const BTREEINFO *openinfo, int dflags) { struct stat sb; BTMETA m; @@ -350,8 +347,7 @@ err: if (t) { * RET_ERROR, RET_SUCCESS */ static int -nroot(t) - BTREE *t; +nroot(BTREE *t) { PAGE *meta, *root; pgno_t npg; @@ -384,7 +380,7 @@ nroot(t) } static int -tmp() +tmp(void) { sigset_t set, oset; int fd; @@ -405,7 +401,7 @@ tmp() } static int -byteorder() +byteorder(void) { u_int32_t x; u_char *p; @@ -423,8 +419,7 @@ byteorder() } int -__bt_fd(dbp) - const DB *dbp; +__bt_fd(const DB *dbp) { BTREE *t; diff --git a/lib/libc/db/btree/bt_overflow.c b/lib/libc/db/btree/bt_overflow.c index 4058ca9..e618c8c 100644 --- a/lib/libc/db/btree/bt_overflow.c +++ b/lib/libc/db/btree/bt_overflow.c @@ -75,12 +75,7 @@ __FBSDID("$FreeBSD$"); * RET_ERROR, RET_SUCCESS */ int -__ovfl_get(t, p, ssz, buf, bufsz) - BTREE *t; - void *p; - size_t *ssz; - void **buf; - size_t *bufsz; +__ovfl_get(BTREE *t, void *p, size_t *ssz, void **buf, size_t *bufsz) { PAGE *h; pgno_t pg; @@ -134,10 +129,7 @@ __ovfl_get(t, p, ssz, buf, bufsz) * RET_ERROR, RET_SUCCESS */ int -__ovfl_put(t, dbt, pg) - BTREE *t; - const DBT *dbt; - pgno_t *pg; +__ovfl_put(BTREE *t, const DBT *dbt, pgno_t *pg) { PAGE *h, *last; void *p; @@ -188,9 +180,7 @@ __ovfl_put(t, dbt, pg) * RET_ERROR, RET_SUCCESS */ int -__ovfl_delete(t, p) - BTREE *t; - void *p; +__ovfl_delete(BTREE *t, void *p) { PAGE *h; pgno_t pg; diff --git a/lib/libc/db/btree/bt_page.c b/lib/libc/db/btree/bt_page.c index 67aedf6..face4b1 100644 --- a/lib/libc/db/btree/bt_page.c +++ b/lib/libc/db/btree/bt_page.c @@ -55,9 +55,7 @@ __FBSDID("$FreeBSD$"); * mpool_put's the page. */ int -__bt_free(t, h) - BTREE *t; - PAGE *h; +__bt_free(BTREE *t, PAGE *h) { /* Insert the page at the head of the free list. */ h->prevpg = P_INVALID; @@ -81,9 +79,7 @@ __bt_free(t, h) * Pointer to a page, NULL on error. */ PAGE * -__bt_new(t, npg) - BTREE *t; - pgno_t *npg; +__bt_new(BTREE *t, pgno_t *npg) { PAGE *h; diff --git a/lib/libc/db/btree/bt_put.c b/lib/libc/db/btree/bt_put.c index f1416e7..4e3248c 100644 --- a/lib/libc/db/btree/bt_put.c +++ b/lib/libc/db/btree/bt_put.c @@ -62,11 +62,7 @@ static EPG *bt_fast(BTREE *, const DBT *, const DBT *, int *); * tree and R_NOOVERWRITE specified. */ int -__bt_put(dbp, key, data, flags) - const DB *dbp; - DBT *key; - const DBT *data; - u_int flags; +__bt_put(const DB *dbp, DBT *key, const DBT *data, u_int flags) { BTREE *t; DBT tkey, tdata; @@ -264,10 +260,7 @@ u_long bt_cache_hit, bt_cache_miss; * EPG for new record or NULL if not found. */ static EPG * -bt_fast(t, key, data, exactp) - BTREE *t; - const DBT *key, *data; - int *exactp; +bt_fast(BTREE *t, const DBT *key, const DBT *data, int *exactp) { PAGE *h; u_int32_t nbytes; diff --git a/lib/libc/db/btree/bt_search.c b/lib/libc/db/btree/bt_search.c index 9413e6e..73c0ffe 100644 --- a/lib/libc/db/btree/bt_search.c +++ b/lib/libc/db/btree/bt_search.c @@ -61,10 +61,7 @@ static int __bt_sprev(BTREE *, PAGE *, const DBT *, int *); * the bt_cur field of the tree. A pointer to the field is returned. */ EPG * -__bt_search(t, key, exactp) - BTREE *t; - const DBT *key; - int *exactp; +__bt_search(BTREE *t, const DBT *key, int *exactp) { PAGE *h; indx_t base, index, lim; @@ -146,11 +143,7 @@ next: BT_PUSH(t, h->pgno, index); * If an exact match found. */ static int -__bt_snext(t, h, key, exactp) - BTREE *t; - PAGE *h; - const DBT *key; - int *exactp; +__bt_snext(BTREE *t, PAGE *h, const DBT *key, int *exactp) { EPG e; @@ -185,11 +178,7 @@ __bt_snext(t, h, key, exactp) * If an exact match found. */ static int -__bt_sprev(t, h, key, exactp) - BTREE *t; - PAGE *h; - const DBT *key; - int *exactp; +__bt_sprev(BTREE *t, PAGE *h, const DBT *key, int *exactp) { EPG e; diff --git a/lib/libc/db/btree/bt_seq.c b/lib/libc/db/btree/bt_seq.c index 51cd6e9..3093c91 100644 --- a/lib/libc/db/btree/bt_seq.c +++ b/lib/libc/db/btree/bt_seq.c @@ -72,10 +72,7 @@ static int __bt_seqset(BTREE *, EPG *, DBT *, int); * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. */ int -__bt_seq(dbp, key, data, flags) - const DB *dbp; - DBT *key, *data; - u_int flags; +__bt_seq(const DB *dbp, DBT *key, DBT *data, u_int flags) { BTREE *t; EPG e; @@ -147,11 +144,7 @@ __bt_seq(dbp, key, data, flags) * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. */ static int -__bt_seqset(t, ep, key, flags) - BTREE *t; - EPG *ep; - DBT *key; - int flags; +__bt_seqset(BTREE *t, EPG *ep, DBT *key, int flags) { PAGE *h; pgno_t pg; @@ -235,10 +228,7 @@ __bt_seqset(t, ep, key, flags) * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. */ static int -__bt_seqadv(t, ep, flags) - BTREE *t; - EPG *ep; - int flags; +__bt_seqadv(BTREE *t, EPG *ep, int flags) { CURSOR *c; PAGE *h; @@ -337,11 +327,7 @@ usecurrent: F_CLR(c, CURS_AFTER | CURS_BEFORE); * or RET_SPECIAL if no such key exists. */ static int -__bt_first(t, key, erval, exactp) - BTREE *t; - const DBT *key; - EPG *erval; - int *exactp; +__bt_first(BTREE *t, const DBT *key, EPG *erval, int *exactp) { PAGE *h; EPG *ep, save; diff --git a/lib/libc/db/btree/bt_split.c b/lib/libc/db/btree/bt_split.c index dc27917..20d37a0 100644 --- a/lib/libc/db/btree/bt_split.c +++ b/lib/libc/db/btree/bt_split.c @@ -47,10 +47,10 @@ __FBSDID("$FreeBSD$"); #include "btree.h" static int bt_broot(BTREE *, PAGE *, PAGE *, PAGE *); -static PAGE *bt_page (BTREE *, PAGE *, PAGE **, PAGE **, indx_t *, size_t); +static PAGE *bt_page(BTREE *, PAGE *, PAGE **, PAGE **, indx_t *, size_t); static int bt_preserve(BTREE *, pgno_t); -static PAGE *bt_psplit (BTREE *, PAGE *, PAGE *, PAGE *, indx_t *, size_t); -static PAGE *bt_root (BTREE *, PAGE *, PAGE **, PAGE **, indx_t *, size_t); +static PAGE *bt_psplit(BTREE *, PAGE *, PAGE *, PAGE *, indx_t *, size_t); +static PAGE *bt_root(BTREE *, PAGE *, PAGE **, PAGE **, indx_t *, size_t); static int bt_rroot(BTREE *, PAGE *, PAGE *, PAGE *); static recno_t rec_total(PAGE *); @@ -74,13 +74,8 @@ u_long bt_rootsplit, bt_split, bt_sortsplit, bt_pfxsaved; * RET_ERROR, RET_SUCCESS */ int -__bt_split(t, sp, key, data, flags, ilen, argskip) - BTREE *t; - PAGE *sp; - const DBT *key, *data; - int flags; - size_t ilen; - u_int32_t argskip; +__bt_split(BTREE *t, PAGE *sp, const DBT *key, const DBT *data, int flags, + size_t ilen, u_int32_t argskip) { BINTERNAL *bi; BLEAF *bl, *tbl; @@ -336,11 +331,7 @@ err2: mpool_put(t->bt_mp, l, 0); * Pointer to page in which to insert or NULL on error. */ static PAGE * -bt_page(t, h, lp, rp, skip, ilen) - BTREE *t; - PAGE *h, **lp, **rp; - indx_t *skip; - size_t ilen; +bt_page(BTREE *t, PAGE *h, PAGE **lp, PAGE **rp, indx_t *skip, size_t ilen) { PAGE *l, *r, *tp; pgno_t npg; @@ -441,11 +432,7 @@ bt_page(t, h, lp, rp, skip, ilen) * Pointer to page in which to insert or NULL on error. */ static PAGE * -bt_root(t, h, lp, rp, skip, ilen) - BTREE *t; - PAGE *h, **lp, **rp; - indx_t *skip; - size_t ilen; +bt_root(BTREE *t, PAGE *h, PAGE **lp, PAGE **rp, indx_t *skip, size_t ilen) { PAGE *l, *r, *tp; pgno_t lnpg, rnpg; @@ -488,9 +475,7 @@ bt_root(t, h, lp, rp, skip, ilen) * RET_ERROR, RET_SUCCESS */ static int -bt_rroot(t, h, l, r) - BTREE *t; - PAGE *h, *l, *r; +bt_rroot(BTREE *t, PAGE *h, PAGE *l, PAGE *r) { char *dest; @@ -528,9 +513,7 @@ bt_rroot(t, h, l, r) * RET_ERROR, RET_SUCCESS */ static int -bt_broot(t, h, l, r) - BTREE *t; - PAGE *h, *l, *r; +bt_broot(BTREE *t, PAGE *h, PAGE *l, PAGE *r) { BINTERNAL *bi; BLEAF *bl; @@ -605,11 +588,7 @@ bt_broot(t, h, l, r) * Pointer to page in which to insert. */ static PAGE * -bt_psplit(t, h, l, r, pskip, ilen) - BTREE *t; - PAGE *h, *l, *r; - indx_t *pskip; - size_t ilen; +bt_psplit(BTREE *t, PAGE *h, PAGE *l, PAGE *r, indx_t *pskip, size_t ilen) { BINTERNAL *bi; BLEAF *bl; @@ -783,9 +762,7 @@ bt_psplit(t, h, l, r, pskip, ilen) * RET_SUCCESS, RET_ERROR. */ static int -bt_preserve(t, pg) - BTREE *t; - pgno_t pg; +bt_preserve(BTREE *t, pgno_t pg) { PAGE *h; @@ -811,8 +788,7 @@ bt_preserve(t, pg) * all the way back to bt_split/bt_rroot and it's not very clean. */ static recno_t -rec_total(h) - PAGE *h; +rec_total(PAGE *h) { recno_t recs; indx_t nxt, top; diff --git a/lib/libc/db/btree/bt_utils.c b/lib/libc/db/btree/bt_utils.c index e32854f..9321106 100644 --- a/lib/libc/db/btree/bt_utils.c +++ b/lib/libc/db/btree/bt_utils.c @@ -62,11 +62,7 @@ __FBSDID("$FreeBSD$"); * RET_SUCCESS, RET_ERROR. */ int -__bt_ret(t, e, key, rkey, data, rdata, copy) - BTREE *t; - EPG *e; - DBT *key, *rkey, *data, *rdata; - int copy; +__bt_ret(BTREE *t, EPG *e, DBT *key, DBT *rkey, DBT *data, DBT *rdata, int copy) { BLEAF *bl; void *p; @@ -148,10 +144,7 @@ dataonly: * > 0 if k1 is > record */ int -__bt_cmp(t, k1, e) - BTREE *t; - const DBT *k1; - EPG *e; +__bt_cmp(BTREE *t, const DBT *k1, EPG *e) { BINTERNAL *bi; BLEAF *bl; @@ -211,8 +204,7 @@ __bt_cmp(t, k1, e) * > 0 if a is > b */ int -__bt_defcmp(a, b) - const DBT *a, *b; +__bt_defcmp(const DBT *a, const DBT *b) { size_t len; u_char *p1, *p2; @@ -241,8 +233,7 @@ __bt_defcmp(a, b) * Number of bytes needed to distinguish b from a. */ size_t -__bt_defpfx(a, b) - const DBT *a, *b; +__bt_defpfx(const DBT *a, const DBT *b) { u_char *p1, *p2; size_t cnt, len; |