Author: delphij Date: Mon Mar 2 23:47:18 2009 New Revision: 189291 URL: http://svn.freebsd.org/changeset/base/189291
Log: 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) Modified: head/lib/libc/db/btree/bt_close.c head/lib/libc/db/btree/bt_conv.c head/lib/libc/db/btree/bt_debug.c head/lib/libc/db/btree/bt_delete.c head/lib/libc/db/btree/bt_get.c head/lib/libc/db/btree/bt_open.c head/lib/libc/db/btree/bt_overflow.c head/lib/libc/db/btree/bt_page.c head/lib/libc/db/btree/bt_put.c head/lib/libc/db/btree/bt_search.c head/lib/libc/db/btree/bt_seq.c head/lib/libc/db/btree/bt_split.c head/lib/libc/db/btree/bt_utils.c head/lib/libc/db/db/db.c head/lib/libc/db/hash/hash.c head/lib/libc/db/hash/hash_bigkey.c head/lib/libc/db/hash/hash_buf.c head/lib/libc/db/hash/hash_log2.c head/lib/libc/db/hash/hash_page.c head/lib/libc/db/mpool/mpool.c head/lib/libc/db/recno/rec_close.c head/lib/libc/db/recno/rec_delete.c head/lib/libc/db/recno/rec_get.c head/lib/libc/db/recno/rec_open.c head/lib/libc/db/recno/rec_put.c head/lib/libc/db/recno/rec_search.c head/lib/libc/db/recno/rec_seq.c head/lib/libc/db/recno/rec_utils.c Modified: head/lib/libc/db/btree/bt_close.c ============================================================================== --- head/lib/libc/db/btree/bt_close.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_close.c Mon Mar 2 23:47:18 2009 (r189291) @@ -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; Modified: head/lib/libc/db/btree/bt_conv.c ============================================================================== --- head/lib/libc/db/btree/bt_conv.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_conv.c Mon Mar 2 23:47:18 2009 (r189291) @@ -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; Modified: head/lib/libc/db/btree/bt_debug.c ============================================================================== --- head/lib/libc/db/btree/bt_debug.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_debug.c Mon Mar 2 23:47:18 2009 (r189291) @@ -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; Modified: head/lib/libc/db/btree/bt_delete.c ============================================================================== --- head/lib/libc/db/btree/bt_delete.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_delete.c Mon Mar 2 23:47:18 2009 (r189291) @@ -58,10 +58,7 @@ static int __bt_stkacq(BTREE *, PAGE **, * 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, &exac * 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; Modified: head/lib/libc/db/btree/bt_get.c ============================================================================== --- head/lib/libc/db/btree/bt_get.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_get.c Mon Mar 2 23:47:18 2009 (r189291) @@ -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; Modified: head/lib/libc/db/btree/bt_open.c ============================================================================== --- head/lib/libc/db/btree/bt_open.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_open.c Mon Mar 2 23:47:18 2009 (r189291) @@ -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; Modified: head/lib/libc/db/btree/bt_overflow.c ============================================================================== --- head/lib/libc/db/btree/bt_overflow.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_overflow.c Mon Mar 2 23:47:18 2009 (r189291) @@ -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; Modified: head/lib/libc/db/btree/bt_page.c ============================================================================== --- head/lib/libc/db/btree/bt_page.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_page.c Mon Mar 2 23:47:18 2009 (r189291) @@ -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; Modified: head/lib/libc/db/btree/bt_put.c ============================================================================== --- head/lib/libc/db/btree/bt_put.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_put.c Mon Mar 2 23:47:18 2009 (r189291) @@ -62,11 +62,7 @@ static EPG *bt_fast(BTREE *, const DBT * * 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; Modified: head/lib/libc/db/btree/bt_search.c ============================================================================== --- head/lib/libc/db/btree/bt_search.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_search.c Mon Mar 2 23:47:18 2009 (r189291) @@ -61,10 +61,7 @@ static int __bt_sprev(BTREE *, PAGE *, c * 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; Modified: head/lib/libc/db/btree/bt_seq.c ============================================================================== --- head/lib/libc/db/btree/bt_seq.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_seq.c Mon Mar 2 23:47:18 2009 (r189291) @@ -72,10 +72,7 @@ static int __bt_seqset(BTREE *, EPG *, D * 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_ * 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; Modified: head/lib/libc/db/btree/bt_split.c ============================================================================== --- head/lib/libc/db/btree/bt_split.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_split.c Mon Mar 2 23:47:18 2009 (r189291) @@ -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_sortsp * 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; Modified: head/lib/libc/db/btree/bt_utils.c ============================================================================== --- head/lib/libc/db/btree/bt_utils.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/btree/bt_utils.c Mon Mar 2 23:47:18 2009 (r189291) @@ -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; Modified: head/lib/libc/db/db/db.c ============================================================================== --- head/lib/libc/db/db/db.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/db/db.c Mon Mar 2 23:47:18 2009 (r189291) @@ -42,12 +42,10 @@ __FBSDID("$FreeBSD$"); #include <db.h> +static int __dberr(void); + DB * -dbopen(fname, flags, mode, type, openinfo) - const char *fname; - int flags, mode; - DBTYPE type; - const void *openinfo; +dbopen(const char *fname, int flags, int mode, DBTYPE type, const void *openinfo) { #define DB_FLAGS (DB_LOCK | DB_SHMEM | DB_TXN) @@ -72,7 +70,7 @@ dbopen(fname, flags, mode, type, openinf } static int -__dberr() +__dberr(void) { return (RET_ERROR); } @@ -84,14 +82,13 @@ __dberr() * dbp: pointer to the DB structure. */ void -__dbpanic(dbp) - DB *dbp; +__dbpanic(DB *dbp) { /* The only thing that can succeed is a close. */ - dbp->del = (int (*)())__dberr; - dbp->fd = (int (*)())__dberr; - dbp->get = (int (*)())__dberr; - dbp->put = (int (*)())__dberr; - dbp->seq = (int (*)())__dberr; - dbp->sync = (int (*)())__dberr; + dbp->del = (int (*)(const struct __db *, const DBT*, u_int))__dberr; + dbp->fd = (int (*)(const struct __db *))__dberr; + dbp->get = (int (*)(const struct __db *, const DBT*, DBT *, u_int))__dberr; + dbp->put = (int (*)(const struct __db *, DBT *, const DBT *, u_int))__dberr; + dbp->seq = (int (*)(const struct __db *, DBT *, DBT *, u_int))__dberr; + dbp->sync = (int (*)(const struct __db *, u_int))__dberr; } Modified: head/lib/libc/db/hash/hash.c ============================================================================== --- head/lib/libc/db/hash/hash.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/hash/hash.c Mon Mar 2 23:47:18 2009 (r189291) @@ -92,11 +92,11 @@ int hash_accesses, hash_collisions, hash /************************** INTERFACE ROUTINES ***************************/ /* OPEN/CLOSE */ -extern DB * -__hash_open(file, flags, mode, info, dflags) - const char *file; - int flags, mode, dflags; - const HASHINFO *info; /* Special directives for create */ +/* ARGSUSED */ +DB * +__hash_open(const char *file, int flags, int mode, + const HASHINFO *info, /* Special directives for create */ + int dflags) { HTAB *hashp; struct stat statbuf; @@ -249,8 +249,7 @@ error0: } static int -hash_close(dbp) - DB *dbp; +hash_close(DB *dbp) { HTAB *hashp; int retval; @@ -265,8 +264,7 @@ hash_close(dbp) } static int -hash_fd(dbp) - const DB *dbp; +hash_fd(const DB *dbp) { HTAB *hashp; @@ -283,10 +281,7 @@ hash_fd(dbp) /************************** LOCAL CREATION ROUTINES **********************/ static HTAB * -init_hash(hashp, file, info) - HTAB *hashp; - const char *file; - const HASHINFO *info; +init_hash(HTAB *hashp, const char *file, const HASHINFO *info) { struct stat statbuf; int nelem; @@ -350,9 +345,7 @@ init_hash(hashp, file, info) * Returns 0 on No Error */ static int -init_htab(hashp, nelem) - HTAB *hashp; - int nelem; +init_htab(HTAB *hashp, int nelem) { int nbuckets, nsegs; int l2; @@ -396,8 +389,7 @@ init_htab(hashp, nelem) * structure, freeing all allocated space. */ static int -hdestroy(hashp) - HTAB *hashp; +hdestroy(HTAB *hashp) { int i, save_errno; @@ -456,9 +448,7 @@ hdestroy(hashp) * -1 ERROR */ static int -hash_sync(dbp, flags) - const DB *dbp; - u_int32_t flags; +hash_sync(const DB *dbp, u_int32_t flags) { HTAB *hashp; @@ -485,8 +475,7 @@ hash_sync(dbp, flags) * -1 indicates that errno should be set */ static int -flush_meta(hashp) - HTAB *hashp; +flush_meta(HTAB *hashp) { HASHHDR *whdrp; #if BYTE_ORDER == LITTLE_ENDIAN @@ -533,11 +522,7 @@ flush_meta(hashp) * -1 to indicate an internal ERROR (i.e. out of memory, etc) */ static int -hash_get(dbp, key, data, flag) - const DB *dbp; - const DBT *key; - DBT *data; - u_int32_t flag; +hash_get(const DB *dbp, const DBT *key, DBT *data, u_int32_t flag) { HTAB *hashp; @@ -550,11 +535,7 @@ hash_get(dbp, key, data, flag) } static int -hash_put(dbp, key, data, flag) - const DB *dbp; - DBT *key; - const DBT *data; - u_int32_t flag; +hash_put(const DB *dbp, DBT *key, const DBT *data, u_int32_t flag) { HTAB *hashp; @@ -573,10 +554,8 @@ hash_put(dbp, key, data, flag) } static int -hash_delete(dbp, key, flag) - const DB *dbp; - const DBT *key; - u_int32_t flag; /* Ignored */ +hash_delete(const DB *dbp, const DBT *key, + u_int32_t flag) /* Ignored */ { HTAB *hashp; @@ -596,10 +575,7 @@ hash_delete(dbp, key, flag) * Assume that hashp has been set in wrapper routine. */ static int -hash_access(hashp, action, key, val) - HTAB *hashp; - ACTION action; - DBT *key, *val; +hash_access(HTAB *hashp, ACTION action, DBT *key, DBT *val) { BUFHEAD *rbufp; BUFHEAD *bufp, *save_bufp; @@ -725,10 +701,7 @@ found: } static int -hash_seq(dbp, key, data, flag) - const DB *dbp; - DBT *key, *data; - u_int32_t flag; +hash_seq(const DB *dbp, DBT *key, DBT *data, u_int32_t flag) { u_int32_t bucket; BUFHEAD *bufp; @@ -814,9 +787,8 @@ hash_seq(dbp, key, data, flag) * 0 ==> OK * -1 ==> Error */ -extern int -__expand_table(hashp) - HTAB *hashp; +int +__expand_table(HTAB *hashp) { u_int32_t old_bucket, new_bucket; int dirsize, new_segnum, spare_ndx; @@ -870,9 +842,7 @@ __expand_table(hashp) * fails, then this routine can go away. */ static void * -hash_realloc(p_ptr, oldsize, newsize) - SEGMENT **p_ptr; - int oldsize, newsize; +hash_realloc(SEGMENT **p_ptr, int oldsize, int newsize) { void *p; @@ -885,11 +855,8 @@ hash_realloc(p_ptr, oldsize, newsize) return (p); } -extern u_int32_t -__call_hash(hashp, k, len) - HTAB *hashp; - char *k; - int len; +u_int32_t +__call_hash(HTAB *hashp, char *k, int len) { int n, bucket; @@ -906,9 +873,7 @@ __call_hash(hashp, k, len) * Returns 0 on success */ static int -alloc_segs(hashp, nsegs) - HTAB *hashp; - int nsegs; +alloc_segs(HTAB *hashp, int nsegs) { int i; SEGMENT store; @@ -940,8 +905,7 @@ alloc_segs(hashp, nsegs) * Hashp->hdr needs to be byteswapped. */ static void -swap_header_copy(srcp, destp) - HASHHDR *srcp, *destp; +swap_header_copy(HASHHDR *srcp, HASHHDR *destp) { int i; @@ -969,8 +933,7 @@ swap_header_copy(srcp, destp) } static void -swap_header(hashp) - HTAB *hashp; +swap_header(HTAB *hashp) { HASHHDR *hdrp; int i; Modified: head/lib/libc/db/hash/hash_bigkey.c ============================================================================== --- head/lib/libc/db/hash/hash_bigkey.c Mon Mar 2 23:26:30 2009 (r189290) +++ head/lib/libc/db/hash/hash_bigkey.c Mon Mar 2 23:47:18 2009 (r189291) @@ -82,11 +82,8 @@ static int collect_data(HTAB *, BUFHEAD * 0 ==> OK *-1 ==> ERROR */ -extern int -__big_insert(hashp, bufp, key, val) - HTAB *hashp; - BUFHEAD *bufp; - const DBT *key, *val; +int +__big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val) { u_int16_t *p; int key_size, n, val_size; @@ -182,10 +179,8 @@ __big_insert(hashp, bufp, key, val) * 0 => OK *-1 => ERROR */ -extern int -__big_delete(hashp, bufp) - HTAB *hashp; - BUFHEAD *bufp; +int +__big_delete(HTAB *hashp, BUFHEAD *bufp) { BUFHEAD *last_bfp, *rbufp; u_int16_t *bp, pageno; @@ -261,13 +256,8 @@ __big_delete(hashp, bufp) * -2 means key not found and this is big key/data * -3 error */ -extern int -__find_bigpair(hashp, bufp, ndx, key, size) - HTAB *hashp; - BUFHEAD *bufp; - int ndx; - char *key; - int size; +int +__find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size) { u_int16_t *bp; char *p; @@ -313,10 +303,8 @@ __find_bigpair(hashp, bufp, ndx, key, si * of the pair; 0 if there isn't any (i.e. big pair is the last key in the * bucket) */ -extern u_int16_t -__find_last_page(hashp, bpp) - HTAB *hashp; - BUFHEAD **bpp; +u_int16_t +__find_last_page(HTAB *hashp, BUFHEAD **bpp) { BUFHEAD *bufp; u_int16_t *bp, pageno; @@ -354,13 +342,8 @@ __find_last_page(hashp, bpp) * Return the data for the key/data pair that begins on this page at this * index (index should always be 1). */ -extern int -__big_return(hashp, bufp, ndx, val, set_current) - HTAB *hashp; - BUFHEAD *bufp; - int ndx; - DBT *val; - int set_current; +int +__big_return(HTAB *hashp, BUFHEAD *bufp, int ndx, DBT *val, int set_current) { BUFHEAD *save_p; u_int16_t *bp, len, off, save_addr; @@ -446,10 +429,7 @@ __big_return(hashp, bufp, ndx, val, set_ * allocate a buffer and copy the data as you recurse up. */ static int -collect_data(hashp, bufp, len, set) - HTAB *hashp; - BUFHEAD *bufp; - int len, set; +collect_data(HTAB *hashp, BUFHEAD *bufp, int len, int set) { u_int16_t *bp; char *p; @@ -501,12 +481,8 @@ collect_data(hashp, bufp, len, set) /* * Fill in the key and data for this big pair. */ -extern int -__big_keydata(hashp, bufp, key, val, set) - HTAB *hashp; - BUFHEAD *bufp; - DBT *key, *val; - int set; +int +__big_keydata(HTAB *hashp, BUFHEAD *bufp, DBT *key, DBT *val, int set) { key->size = collect_key(hashp, bufp, 0, val, set); if (key->size == -1) @@ -520,12 +496,7 @@ __big_keydata(hashp, bufp, key, val, set * collect the data, allocate a buffer and copy the key as you recurse up. */ static int -collect_key(hashp, bufp, len, val, set) - HTAB *hashp; - BUFHEAD *bufp; - int len; - DBT *val; - int set; +collect_key(HTAB *hashp, BUFHEAD *bufp, int len, DBT *val, int set) { BUFHEAD *xbp; char *p; @@ -564,16 +535,14 @@ collect_key(hashp, bufp, len, val, set) * 0 => OK * -1 => error */ -extern int -__big_split(hashp, op, np, big_keyp, addr, obucket, ret) - HTAB *hashp; - BUFHEAD *op; /* Pointer to where to put keys that go in old bucket */ - BUFHEAD *np; /* Pointer to new bucket page */ - /* Pointer to first page containing the big key/data */ - BUFHEAD *big_keyp; - int addr; /* Address of big_keyp */ - u_int32_t obucket;/* Old Bucket */ - SPLIT_RETURN *ret; +int +__big_split(HTAB *hashp, + BUFHEAD *op, /* Pointer to where to put keys that go in old bucket */ + BUFHEAD *np, /* Pointer to new bucket page */ + BUFHEAD *big_keyp, /* Pointer to first page containing the big key/data */ + int addr, /* Address of big_keyp */ + u_int32_t obucket, /* Old Bucket */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"