Skip to content

Reform functions #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions btree/bt_close.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ static int bt_meta __P((BTREE *));
* RET_ERROR, RET_SUCCESS
*/
int
__bt_close(dbp)
DB *dbp;
__bt_close(DB *dbp)
{
BTREE *t;
int fd;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
13 changes: 3 additions & 10 deletions btree/bt_conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ static void mswap __P((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;
Expand Down Expand Up @@ -126,10 +123,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;
Expand Down Expand Up @@ -200,8 +194,7 @@ __bt_pgout(t, pg, pp)
* p: page to convert
*/
static void
mswap(pg)
PAGE *pg;
mswap(PAGE *pg)
{
char *p;

Expand Down
16 changes: 5 additions & 11 deletions btree/bt_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ static char sccsid[] = "@(#)bt_debug.c 8.5 (Berkeley) 8/17/94";
* dbp: pointer to the DB
*/
void
__bt_dump(dbp)
DB *dbp;
__bt_dump(DB *dbp)
{
BTREE *t;
PAGE *h;
Expand Down Expand Up @@ -99,8 +98,7 @@ __bt_dump(dbp)
* h: pointer to the PAGE
*/
void
__bt_dmpage(h)
PAGE *h;
__bt_dmpage(PAGE *h)
{
BTMETA *m;
char *sep;
Expand Down Expand Up @@ -133,9 +131,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;
Expand All @@ -154,8 +150,7 @@ __bt_dnpage(dbp, pgno)
* h: pointer to the PAGE
*/
void
__bt_dpage(h)
PAGE *h;
__bt_dpage(PAGE *h)
{
BINTERNAL *bi;
BLEAF *bl;
Expand Down Expand Up @@ -250,8 +245,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;
Expand Down
34 changes: 7 additions & 27 deletions btree/bt_delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ static int __bt_stkacq __P((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;
Expand Down Expand Up @@ -141,10 +138,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;
Expand Down Expand Up @@ -288,9 +282,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;
Expand Down Expand Up @@ -375,9 +367,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;
Expand Down Expand Up @@ -471,11 +461,7 @@ __bt_pdelete(t, h)
* RET_SUCCESS, RET_ERROR.
*/
int
__bt_dleaf(t, key, h, index)
BTREE *t;
const DBT *key;
PAGE *h;
u_int index;
__bt_dleaf(BTREE *t, const DBT *key, PAGE *h, u_int index)
{
BLEAF *bl;
indx_t cnt, *ip, offset;
Expand Down Expand Up @@ -536,11 +522,7 @@ __bt_dleaf(t, key, h, index)
* RET_SUCCESS, RET_ERROR.
*/
static int
__bt_curdel(t, key, h, index)
BTREE *t;
const DBT *key;
PAGE *h;
u_int index;
__bt_curdel(BTREE *t, const DBT *key, PAGE *h, u_int index)
{
CURSOR *c;
EPG e;
Expand Down Expand Up @@ -635,9 +617,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;

Expand Down
6 changes: 1 addition & 5 deletions btree/bt_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ static char sccsid[] = "@(#)bt_get.c 8.6 (Berkeley) 7/20/94";
* 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;
Expand Down
11 changes: 3 additions & 8 deletions btree/bt_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ static int tmp __P((void));
*
*/
DB *
__bt_open(fname, flags, mode, openinfo, dflags)
const char *fname;
int flags, mode, dflags;
const BTREEINFO *openinfo;
__bt_open(virt_fd_t file, const FILEVTABLE *vtable, const BTREEINFO *openinfo, int dflags)
{
struct stat sb;
BTMETA m;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -422,8 +418,7 @@ byteorder()
}

int
__bt_fd(dbp)
const DB *dbp;
__bt_fd(const DB *dbp)
{
BTREE *t;

Expand Down
16 changes: 3 additions & 13 deletions btree/bt_overflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,7 @@ static char sccsid[] = "@(#)bt_overflow.c 8.5 (Berkeley) 7/16/94";
* 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;
Expand Down Expand Up @@ -136,10 +131,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;
Expand Down Expand Up @@ -190,9 +182,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;
Expand Down
8 changes: 2 additions & 6 deletions btree/bt_page.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ static char sccsid[] = "@(#)bt_page.c 8.3 (Berkeley) 7/14/94";
* 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;
Expand All @@ -83,9 +81,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;

Expand Down
11 changes: 2 additions & 9 deletions btree/bt_put.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ static EPG *bt_fast __P((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;
Expand Down Expand Up @@ -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;
Expand Down
17 changes: 3 additions & 14 deletions btree/bt_search.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ static int __bt_sprev __P((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;
Expand Down Expand Up @@ -148,11 +145,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;

Expand Down Expand Up @@ -187,11 +180,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;

Expand Down
Loading