From: Peter Howkins Date: Thu, 28 Jun 2018 03:06:47 +0000 (+0100) Subject: libtt: Change to ANSI function definitions X-Git-Tag: 2.3.0a~364 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=020d592338cb62fda3d95206317255d35de35aea;p=oweals%2Fcde.git libtt: Change to ANSI function definitions --- diff --git a/cde/lib/tt/lib/api/dnd/ttdnd.c b/cde/lib/tt/lib/api/dnd/ttdnd.c index 04873570..18a4b997 100644 --- a/cde/lib/tt/lib/api/dnd/ttdnd.c +++ b/cde/lib/tt/lib/api/dnd/ttdnd.c @@ -172,9 +172,7 @@ _ttdnd_get_contents( * callback, and sends a message for the next chunk if necessary. */ static Tt_callback_action -_ttdnd_continue_transfer(m,p) - Tt_message m; - Tt_pattern p; +_ttdnd_continue_transfer(Tt_message m, Tt_pattern p) { Ttdnd_receive_data_func *receivefunc; int sourceXid; @@ -233,9 +231,7 @@ _ttdnd_continue_transfer(m,p) * from the user's send routine, and fills it into the message. */ static Tt_callback_action -_ttdnd_get_contents_callback(m, p) - Tt_message m; - Tt_pattern p; +_ttdnd_get_contents_callback(Tt_message m, Tt_pattern p) { int chunknumber; int maxchunk; @@ -282,7 +278,7 @@ _ttdnd_get_contents_callback(m, p) * tt messages whenever the tt filedescriptor has input. */ void -_ttdnd_receive() +_ttdnd_receive(void) { Tt_message m; m = tt_message_receive(); diff --git a/cde/lib/tt/mini_isam/isadd1key.c b/cde/lib/tt/mini_isam/isadd1key.c index 9f22fbae..d69ce7d3 100644 --- a/cde/lib/tt/mini_isam/isadd1key.c +++ b/cde/lib/tt/mini_isam/isadd1key.c @@ -46,12 +46,7 @@ extern long *ismaxlong; int -_add1key(fcb, pkeydesc2, record, recnum, newkey) - Fcb *fcb; - Keydesc2 *pkeydesc2; - char *record; - Recno recnum; - char *newkey; +_add1key(Fcb *fcb, Keydesc2 *pkeydesc2, char *record, Recno recnum, char *newkey) { char keybuf[MAXKEYSIZE]; Btree *btree; diff --git a/cde/lib/tt/mini_isam/isaddindex.c b/cde/lib/tt/mini_isam/isaddindex.c index d44e3474..3d65a204 100644 --- a/cde/lib/tt/mini_isam/isaddindex.c +++ b/cde/lib/tt/mini_isam/isaddindex.c @@ -59,9 +59,7 @@ static char sccsid[] = "@(#)isaddindex.c 1.8 89/07/17 Copyr 1988 Sun Micro"; */ int -isaddindex(isfd, keydesc) - int isfd; - struct keydesc *keydesc; +isaddindex(int isfd, struct keydesc *keydesc) { int _amaddindex(); register Fab *fab; diff --git a/cde/lib/tt/mini_isam/isaddprimary.c b/cde/lib/tt/mini_isam/isaddprimary.c index df424018..156960e9 100644 --- a/cde/lib/tt/mini_isam/isaddprimary.c +++ b/cde/lib/tt/mini_isam/isaddprimary.c @@ -65,9 +65,7 @@ Static int _am_addprimary(); */ int -isaddprimary(isfd, keydesc) - int isfd; - struct keydesc *keydesc; +isaddprimary(int isfd, struct keydesc *keydesc) { register Fab *fab; int ret; @@ -94,9 +92,7 @@ isaddprimary(isfd, keydesc) return (ret); /* Successful write */ } -Static int _am_addprimary(fab, keydesc) - register Fab *fab; - struct keydesc *keydesc; +Static int _am_addprimary(register Fab *fab, struct keydesc *keydesc) { return (_amaddprimary(&fab->isfhandle, keydesc, &fab->errcode)); } diff --git a/cde/lib/tt/mini_isam/isalloc.c b/cde/lib/tt/mini_isam/isalloc.c index 765e7ec2..95384895 100644 --- a/cde/lib/tt/mini_isam/isalloc.c +++ b/cde/lib/tt/mini_isam/isalloc.c @@ -56,8 +56,7 @@ extern char *strdup(); * Allocate nbytes. */ -char *_ismalloc(nbytes) - unsigned int nbytes; +char *_ismalloc(unsigned int nbytes) { register char *p; @@ -67,9 +66,7 @@ char *_ismalloc(nbytes) return (p); } -char *_isrealloc(oldaddr, nbytes) - char *oldaddr; - unsigned int nbytes; +char *_isrealloc(char *oldaddr, unsigned int nbytes) { register char *p; @@ -87,8 +84,7 @@ char *_isrealloc(oldaddr, nbytes) */ char * -_isallocstring(str) - char *str; +_isallocstring(char *str) { register char *p; @@ -105,8 +101,7 @@ _isallocstring(str) */ void -_isfreestring(str) - char *str; +_isfreestring(char *str) { assert(str != NULL); free(str); diff --git a/cde/lib/tt/mini_isam/isam.h b/cde/lib/tt/mini_isam/isam.h index 438c902b..eeb1e6e5 100644 --- a/cde/lib/tt/mini_isam/isam.h +++ b/cde/lib/tt/mini_isam/isam.h @@ -57,7 +57,10 @@ extern long ldlong(); extern float ldfloat(); extern double lddbl(); extern short ldshort(); -extern int ldchar(), stchar(), stlong(), stint(), stdbl(), stfloat(); +extern int ldchar(), stchar(), stlong(), stdbl(); +extern int stint(short val, char *p); +extern int stfloat(float f, char *p); + extern int iserrno; /* isam error number code */ extern long isrecnum; /* record number of last call */ diff --git a/cde/lib/tt/mini_isam/isam_impl.h b/cde/lib/tt/mini_isam/isam_impl.h index 4e3a1e28..fbb6b735 100644 --- a/cde/lib/tt/mini_isam/isam_impl.h +++ b/cde/lib/tt/mini_isam/isam_impl.h @@ -162,7 +162,8 @@ typedef struct bytearray { char *data; } Bytearray; -extern Bytearray _bytearr_getempty(), _bytearr_dup(), _bytearr_new(); +extern Bytearray _bytearr_getempty(), _bytearr_dup(); +extern Bytearray _bytearr_new(u_short len, char *data); extern void _bytearr_free(); diff --git a/cde/lib/tt/mini_isam/isamaddindex.c b/cde/lib/tt/mini_isam/isamaddindex.c index 3b9828a6..7ce8a571 100644 --- a/cde/lib/tt/mini_isam/isamaddindex.c +++ b/cde/lib/tt/mini_isam/isamaddindex.c @@ -68,10 +68,7 @@ static void checkavailfd(void); /*ARGSUSED*/ int -_amaddindex(isfhandle, keydesc, errcode) - Bytearray *isfhandle; - struct keydesc *keydesc; - struct errcode *errcode; +_amaddindex(Bytearray *isfhandle, struct keydesc *keydesc, struct errcode *errcode) { Fcb *fcb = NULL; Keydesc2 keydesc2; @@ -195,10 +192,7 @@ _amaddindex(isfhandle, keydesc, errcode) /*ARGSUSED*/ int -_amaddprimary(isfhandle, keydesc, errcode) - Bytearray *isfhandle; - struct keydesc *keydesc; - struct errcode *errcode; +_amaddprimary(Bytearray *isfhandle, struct keydesc *keydesc, struct errcode *errcode) { Fcb *fcb = NULL; Keydesc2 keydesc2; @@ -319,9 +313,7 @@ _amaddprimary(isfhandle, keydesc, errcode) * Check unique constraint, create duplicate serial numbers. */ -int _create_index(fcb, pkeydesc2) - Fcb *fcb; - Keydesc2 *pkeydesc2; +int _create_index(Fcb *fcb, Keydesc2 *pkeydesc2) { Issort *srt; int keylength = pkeydesc2->k2_len; @@ -391,10 +383,7 @@ int _create_index(fcb, pkeydesc2) */ Static void -_readallrecords(fcb, srt, pkeydesc2) - Fcb *fcb; - Issort *srt; - Keydesc2 *pkeydesc2; +_readallrecords(Fcb *fcb, Issort *srt, Keydesc2 *pkeydesc2) { char record [ISMAXRECLEN]; char keybuf [MAXKEYSIZE]; @@ -436,9 +425,7 @@ _readallrecords(fcb, srt, pkeydesc2) */ Static void -_attach_dups_serial(srt, pkeydesc2) - Issort *srt; - Keydesc2 *pkeydesc2; +_attach_dups_serial(Issort *srt, Keydesc2 *pkeydesc2) { int netkeylength = pkeydesc2->k2_len - RECNOSIZE - DUPIDSIZE; char *curkey; @@ -471,10 +458,7 @@ _attach_dups_serial(srt, pkeydesc2) */ Static Blkno -_buildbtree(fcb, pkeydesc2, srt) - Fcb *fcb; - Keydesc2 *pkeydesc2; - Issort *srt; +_buildbtree(Fcb *fcb, Keydesc2 *pkeydesc2, Issort *srt) { Bufhdr *_allockpage(); int depth; @@ -628,9 +612,7 @@ _buildbtree(fcb, pkeydesc2, srt) * Return 1 if there are duplicates in the sorted key object. */ -Static int _duplicate_exist(srt, keylength) - Issort *srt; - int keylength; +Static int _duplicate_exist(Issort *srt, int keylength) { char *curkey; char *lastkey = (char *) 0; diff --git a/cde/lib/tt/mini_isam/isamdelrec.c b/cde/lib/tt/mini_isam/isamdelrec.c index 68a77c23..ee3e2986 100644 --- a/cde/lib/tt/mini_isam/isamdelrec.c +++ b/cde/lib/tt/mini_isam/isamdelrec.c @@ -60,10 +60,7 @@ void _delkeys(); */ int -_amdelrec(isfhandle, recnum, errcode) - Bytearray *isfhandle; - Recno recnum; - struct errcode *errcode; +_amdelrec(Bytearray *isfhandle, Recno recnum, struct errcode *errcode) { Fcb *fcb = NULL; char recbuf[ISMAXRECLEN]; @@ -145,10 +142,7 @@ _amdelrec(isfhandle, recnum, errcode) */ void -_delkeys(fcb, record, recnum) - register Fcb *fcb; - char *record; - Recno recnum; +_delkeys(register Fcb *fcb, char *record, Recno recnum) { int nkeys = fcb->nkeys; register int i; diff --git a/cde/lib/tt/mini_isam/isamerror.c b/cde/lib/tt/mini_isam/isamerror.c index 56ec810a..20aec335 100644 --- a/cde/lib/tt/mini_isam/isamerror.c +++ b/cde/lib/tt/mini_isam/isamerror.c @@ -86,9 +86,7 @@ static struct errstattab { */ void -_amseterrcode(errcode, is_errno) - struct errcode *errcode; - int is_errno; +_amseterrcode(struct errcode *errcode, int is_errno) { register struct errstattab *p; errcode->iserrno = is_errno; diff --git a/cde/lib/tt/mini_isam/isamhooks.c b/cde/lib/tt/mini_isam/isamhooks.c index 6d5b9394..32dddb57 100644 --- a/cde/lib/tt/mini_isam/isamhooks.c +++ b/cde/lib/tt/mini_isam/isamhooks.c @@ -50,7 +50,7 @@ extern struct dlink *pavail; */ void -_isam_entryhook() +_isam_entryhook(void) { isdupl = 0; /* Reset duplicate indicator */ _setiserrno2(0, '0', '0'); @@ -62,7 +62,7 @@ _isam_entryhook() */ void -_isam_exithook() +_isam_exithook(void) { _isdisk_inval(); /* Invalidate all buffers */ } diff --git a/cde/lib/tt/mini_isam/isamopen.c b/cde/lib/tt/mini_isam/isamopen.c index ea625812..e3e8b594 100644 --- a/cde/lib/tt/mini_isam/isamopen.c +++ b/cde/lib/tt/mini_isam/isamopen.c @@ -65,15 +65,9 @@ static char sccsid[] = "@(#)isamopen.c 1.10 89/07/17 Copyr 1988 Sun Micro"; /* ARGSUSED */ int -_amopen(isfname, openmode, varflag, minlen, maxlen, - isfhandle, curpos, errcode) - char *isfname; - enum openmode openmode; - Bool *varflag; - int *minlen, *maxlen; - Bytearray *isfhandle; - Bytearray *curpos; - struct errcode *errcode; +_amopen(char *isfname, enum openmode openmode, Bool *varflag, + int *minlen, int *maxlen, Bytearray *isfhandle, + Bytearray *curpos, struct errcode *errcode) { Fcb *fcb; Bytearray isfhandle0; @@ -182,9 +176,7 @@ _amopen(isfname, openmode, varflag, minlen, maxlen, #define FDNEEDED 3 /* Needs 3 UNIX fd to open a file*/ Fcb * -_openfcb(isfhandle, errcode) - Bytearray *isfhandle; - struct errcode *errcode; +_openfcb(Bytearray *isfhandle, struct errcode *errcode) { Fcb *fcb; Bytearray *isfhandle2; @@ -300,8 +292,7 @@ _openfcb(isfhandle, errcode) */ char * -_getisfname(isfhandle) - Bytearray *isfhandle; +_getisfname(Bytearray *isfhandle) { return (isfhandle->data); } @@ -314,8 +305,7 @@ _getisfname(isfhandle) */ Bytearray -_makeisfhandle(isfname) - char *isfname; +_makeisfhandle(char *isfname) { return (_bytearr_new((u_short)(strlen(isfname) + 1), isfname)); } diff --git a/cde/lib/tt/mini_isam/isamwrite.c b/cde/lib/tt/mini_isam/isamwrite.c index f28f319e..eee8a687 100644 --- a/cde/lib/tt/mini_isam/isamwrite.c +++ b/cde/lib/tt/mini_isam/isamwrite.c @@ -66,13 +66,8 @@ extern long *ismaxlong; */ int -_amwrite(isfhandle, record, reclen, curpos, recnum, errcode) - Bytearray *isfhandle; - char *record; - int reclen; - Bytearray *curpos; - Recno *recnum; - struct errcode *errcode; +_amwrite(Bytearray *isfhandle, char *record, int reclen, + Bytearray *curpos, Recno *recnum, struct errcode *errcode) { Fcb *fcb = NULL; Recno recnum2; @@ -166,10 +161,7 @@ _amwrite(isfhandle, record, reclen, curpos, recnum, errcode) * Returns ISOK, or EDUPS. */ -int _addkeys (fcb, record, recnum) - register Fcb *fcb; - char *record; - Recno recnum; +int _addkeys (register Fcb *fcb, char *record, Recno recnum) { int nkeys = fcb->nkeys; register int i; @@ -185,11 +177,7 @@ int _addkeys (fcb, record, recnum) } Static int -_addkeys2 (fcb, record, recnum, curpos) - Fcb *fcb; - char *record; - Recno recnum; - Bytearray *curpos; +_addkeys2 (Fcb *fcb, char *record, Recno recnum, Bytearray *curpos) { int nkeys = fcb->nkeys; register int i; diff --git a/cde/lib/tt/mini_isam/isapplmr.c b/cde/lib/tt/mini_isam/isapplmr.c index ff009aca..4f0ffabd 100644 --- a/cde/lib/tt/mini_isam/isapplmr.c +++ b/cde/lib/tt/mini_isam/isapplmr.c @@ -55,9 +55,7 @@ static char sccsid[] = "@(#)isapplmr.c 1.5 89/07/17 Copyr 1988 Sun Micro"; */ int -_isapplmr(isfd, buffer) - int isfd; - char *buffer; +_isapplmr(int isfd, char *buffer) { register Fab *fab; Fcb *fcb = NULL; diff --git a/cde/lib/tt/mini_isam/isapplmw.c b/cde/lib/tt/mini_isam/isapplmw.c index bdf70abd..33b35f7b 100644 --- a/cde/lib/tt/mini_isam/isapplmw.c +++ b/cde/lib/tt/mini_isam/isapplmw.c @@ -54,9 +54,7 @@ static char sccsid[] = "@(#)isapplmw.c 1.5 89/07/17 Copyr 1988 Sun Micro"; */ int -_isapplmw(isfd, magicstring) - int isfd; - char *magicstring; +_isapplmw(int isfd, char *magicstring) { register Fab *fab; int ret; diff --git a/cde/lib/tt/mini_isam/isbsearch.c b/cde/lib/tt/mini_isam/isbsearch.c index d6aca7bc..0114013e 100644 --- a/cde/lib/tt/mini_isam/isbsearch.c +++ b/cde/lib/tt/mini_isam/isbsearch.c @@ -45,12 +45,7 @@ static char sccsid[] = "@(#)isbsearch.c 1.3 89/07/17 Copyr 1988 Sun Micro"; */ -char *_isbsearch (key,table,nelems,keylen,cmpf) - char *key; - char *table; - int nelems; - int keylen; - int (*cmpf) (); +char *_isbsearch (char *key, char *table, int nelems, int keylen, int (*cmpf) ()) { register int len,l1,result; /* current length of array to search */ register char *p,*low; diff --git a/cde/lib/tt/mini_isam/isbtree.c b/cde/lib/tt/mini_isam/isbtree.c index eda08752..dbc5a95c 100644 --- a/cde/lib/tt/mini_isam/isbtree.c +++ b/cde/lib/tt/mini_isam/isbtree.c @@ -53,9 +53,7 @@ extern int _iskeycmp(); */ Btree * - _isbtree_create(fcb, pkeydesc2) -Fcb *fcb; -Keydesc2 *pkeydesc2; + _isbtree_create(Fcb *fcb, Keydesc2 *pkeydesc2) { register Btree *p; @@ -76,8 +74,7 @@ Keydesc2 *pkeydesc2; */ void -_isbtree_destroy(btree) - register Btree *btree; +_isbtree_destroy(register Btree *btree) { register int i; @@ -95,9 +92,7 @@ _isbtree_destroy(btree) */ void -_isbtree_search(btree, key) - register Btree *btree; -char *key; /* Search for this key */ +_isbtree_search( register Btree *btree, char *key) { Keydesc2 *pkeydesc2 = btree->keydesc2; Blkno rootblkno = pkeydesc2->k2_rootnode; @@ -149,8 +144,7 @@ char *key; /* Search for this key */ */ char * -_isbtree_current(btree) - register Btree *btree; +_isbtree_current(register Btree *btree) { int curpos; @@ -169,8 +163,7 @@ _isbtree_current(btree) */ char * -_isbtree_next(btree) - register Btree *btree; +_isbtree_next(register Btree *btree) { int curpos; int depth = btree->depth; diff --git a/cde/lib/tt/mini_isam/isbuild.c b/cde/lib/tt/mini_isam/isbuild.c index 949422eb..5520feff 100644 --- a/cde/lib/tt/mini_isam/isbuild.c +++ b/cde/lib/tt/mini_isam/isbuild.c @@ -81,11 +81,7 @@ static int _ambuild(); */ int -isbuild(isfname, recordlength, primkey, mode) - char *isfname; - int recordlength; - struct keydesc *primkey; - int mode; +isbuild(char *isfname, int recordlength, struct keydesc *primkey, int mode) { Fab *fab; Isfd isfd; @@ -191,18 +187,12 @@ isbuild(isfname, recordlength, primkey, mode) /* ARGSUSED */ static int -_ambuild(isfname, openmode, varflag, minlen, maxlen, primkey, - owner, group, umask, isfhandle, curpos, errcode) - char *isfname; - enum openmode openmode; - Bool varflag; - int minlen, maxlen; - struct keydesc *primkey; - int owner, group; - Bytearray *isfhandle; - Bytearray *curpos; - struct errcode *errcode; - int umask; +_ambuild(char *isfname, enum openmode openmode, Bool varflag, + int minlen, int maxlen, struct keydesc *primkey, + int owner, int group, int umask, + Bytearray *isfhandle, Bytearray *curpos, + struct errcode *errcode) + { Fcb *fcb = NULL; Bytearray *isfhandle2; diff --git a/cde/lib/tt/mini_isam/isbytearray.c b/cde/lib/tt/mini_isam/isbytearray.c index e7bbce36..3924998d 100644 --- a/cde/lib/tt/mini_isam/isbytearray.c +++ b/cde/lib/tt/mini_isam/isbytearray.c @@ -51,7 +51,7 @@ static char sccsid[] = "@(#)isbytearray.c 1.3 89/07/17 Copyr 1988 Sun Micro"; */ Bytearray -_bytearr_getempty() +_bytearr_getempty(void) { static Bytearray empty_bytearray = { 0, NULL}; @@ -65,9 +65,7 @@ _bytearr_getempty() */ Bytearray -_bytearr_new(len, data) - u_short len; - char *data; +_bytearr_new(u_short len, char *data) { Bytearray bytearray; @@ -85,8 +83,7 @@ _bytearr_new(len, data) */ Bytearray -_bytearr_dup(old) - Bytearray *old; +_bytearr_dup(Bytearray *old) { return (_bytearr_new(old->length, old->data)); } @@ -98,8 +95,7 @@ _bytearr_dup(old) */ void -_bytearr_free(barray) - register Bytearray *barray; +_bytearr_free(register Bytearray *barray) { if (barray->data) free(barray->data); @@ -115,8 +111,7 @@ _bytearr_free(barray) */ int -_bytearr_cmp(l,r) - register Bytearray *l, *r; +_bytearr_cmp(register Bytearray *l, register Bytearray *r) { if (l->length == r->length) return (memcmp(l->data, r->data, (int)l->length)); diff --git a/cde/lib/tt/mini_isam/ischange1key.c b/cde/lib/tt/mini_isam/ischange1key.c index 22bebbfc..9ab54f10 100644 --- a/cde/lib/tt/mini_isam/ischange1key.c +++ b/cde/lib/tt/mini_isam/ischange1key.c @@ -46,13 +46,8 @@ static char sccsid[] = "@(#)ischange1key.c 1.3 89/07/17 Copyr 1988 Sun Micro"; extern long *ismaxlong; int -_change1key(fcb, pkeydesc2, record, oldrecord, recnum, newkey) - Fcb *fcb; - Keydesc2 *pkeydesc2; - char *record; - char *oldrecord; - Recno recnum; - char *newkey; +_change1key(Fcb *fcb, Keydesc2 *pkeydesc2, char *record, + char *oldrecord, Recno recnum, char *newkey) { char keybuf1[MAXKEYSIZE]; char keybuf2[MAXKEYSIZE]; diff --git a/cde/lib/tt/mini_isam/isclose.c b/cde/lib/tt/mini_isam/isclose.c index b08563f4..fb9af76c 100644 --- a/cde/lib/tt/mini_isam/isclose.c +++ b/cde/lib/tt/mini_isam/isclose.c @@ -57,8 +57,7 @@ static char sccsid[] = "@(#)isclose.c 1.8 89/07/17 Copyr 1988 Sun Micro"; */ int -isclose(isfd) - int isfd; +isclose(int isfd) { Fab *fab; Fcb *fcb; diff --git a/cde/lib/tt/mini_isam/iscurpos.c b/cde/lib/tt/mini_isam/iscurpos.c index 41c7fa06..d0b4b59c 100644 --- a/cde/lib/tt/mini_isam/iscurpos.c +++ b/cde/lib/tt/mini_isam/iscurpos.c @@ -53,10 +53,7 @@ static char sccsid[] = "@(#)iscurpos.c 1.5 89/07/17 Copyr 1988 Sun Micro"; */ int -isgetcurpos(isfd, len, buf) - int isfd; - int *len; - char **buf; +isgetcurpos(int isfd, int *len, char **buf) { Fab *fab; u_short total_len; @@ -94,9 +91,7 @@ isgetcurpos(isfd, len, buf) */ int -issetcurpos(isfd, buf) - int isfd; - char *buf; +issetcurpos(int isfd, char *buf) { Fab *fab; u_short len; diff --git a/cde/lib/tt/mini_isam/isdatconv.c b/cde/lib/tt/mini_isam/isdatconv.c index d3167f2d..fe154811 100644 --- a/cde/lib/tt/mini_isam/isdatconv.c +++ b/cde/lib/tt/mini_isam/isdatconv.c @@ -53,8 +53,7 @@ static char sccsid[] = "@(#)isdatconv.c 1.5 89/07/17 Copyr 1988 Sun Micro"; /* ldlong() - Load a long integer from a potentially unaligned address */ long -ldlong(p) - register char *p; +ldlong(register char *p) { int i; #if LONG_BIT == 64 @@ -73,9 +72,7 @@ ldlong(p) /* stlong() - Store a long integer at a potentially unaligned address */ int -stlong(val, p) - register long val; - register char *p; +stlong(register long val, register char *p) { int i; p += LONGSIZE; @@ -89,8 +86,7 @@ stlong(val, p) /* ldint() - Load a short integer from a potentially unaligned address */ short -ldint(p) - register char *p; +ldint(register char *p) { register unsigned int val; @@ -104,8 +100,7 @@ ldint(p) /* ldunshort - load a unshort integer : for 64K record length */ u_short -ldunshort(p) - register char *p; +ldunshort(register char *p) { register unsigned int val; @@ -118,9 +113,7 @@ ldunshort(p) /* stint() - Store a short integer at a potentially unaligned address */ int -stint(val, p) - register short val; - register char *p; +stint(register short val, register char *p) { p += SHORTSIZE; *--p = val & 255; @@ -132,10 +125,7 @@ stint(val, p) /* ldchar() - Load character field */ int -ldchar(src, len, dst) - char *src; - register char *dst; - int len; +ldchar(char *src, int len, register char *dst) { register char *p; @@ -158,10 +148,7 @@ ldchar(src, len, dst) } int -stchar(src, dst, len) - register char *src; - register char *dst; - register int len; +stchar(register char *src, register char *dst, register int len) { register char c; @@ -184,10 +171,7 @@ stchar(src, dst, len) /* ldchar2() - Load character field (C style, NULL padded) */ int -ldchar2(src, len, dst) - char *src; - register char *dst; - int len; +ldchar2(char *src, int len, register char *dst) { register char *p; @@ -201,10 +185,7 @@ ldchar2(src, len, dst) } int -stchar2(src, dst, len) - register char *src; - register char *dst; - register int len; +stchar2(register char *src, register char *dst, register int len) { register char c; @@ -227,8 +208,7 @@ stchar2(src, dst, len) /* ldfloat() - Load a float number from a potentially unaligned address */ float -ldfloat(p) - register char *p; +ldfloat(register char *p) { union { float fval; @@ -247,10 +227,9 @@ ldfloat(p) /* stfloat() - Store a float number at a potentially unaligned address */ +/* f, Bug - it is passed as double */ int -stfloat(f, p) - float f; /* Bug - it is passed as double */ - register char *p; +stfloat(float f, register char *p) { register unsigned val; union { @@ -275,8 +254,7 @@ stfloat(f, p) /* ldbld() - Load a double float number from a potentially unaligned address */ double -lddbl(p) - register char *p; +lddbl(register char *p) { double val; @@ -287,9 +265,7 @@ lddbl(p) /* stdbl() - Store a double float number at a potentially unaligned address */ int -stdbl(val, p) - double val; - register char *p; +stdbl(double val, register char *p) { memcpy ( p,(char *)&val, DOUBLESIZE); return 0; @@ -300,8 +276,7 @@ stdbl(val, p) /* ldbld() - Load a double float number from a potentially unaligned address */ double -lddbl(p) - register char *p; +lddbl(register char *p) { union { double rval; @@ -322,9 +297,7 @@ lddbl(p) /* stdbl() - Store a double float number at a potentially unaligned address */ int -stdbl(val, p) - double val; - register char *p; +stdbl(double val, register char *p) { union { double rval; diff --git a/cde/lib/tt/mini_isam/isdel1key.c b/cde/lib/tt/mini_isam/isdel1key.c index 38a25cc2..17bea630 100644 --- a/cde/lib/tt/mini_isam/isdel1key.c +++ b/cde/lib/tt/mini_isam/isdel1key.c @@ -44,11 +44,7 @@ static char sccsid[] = "@(#)isdel1key.c 1.3 89/07/17 Copyr 1988 Sun Micro"; #include "isam_impl.h" void -_del1key(fcb, pkeydesc2, record, recnum) - Fcb *fcb; - Keydesc2 *pkeydesc2; - char *record; - Recno recnum; +_del1key(Fcb *fcb, Keydesc2 *pkeydesc2, char *record, Recno recnum) { char keybuf[MAXKEYSIZE]; Btree *btree; diff --git a/cde/lib/tt/mini_isam/isdelcurr.c b/cde/lib/tt/mini_isam/isdelcurr.c index 815befdc..21a153a9 100644 --- a/cde/lib/tt/mini_isam/isdelcurr.c +++ b/cde/lib/tt/mini_isam/isdelcurr.c @@ -65,8 +65,7 @@ static int _amdelcurr(); */ int -isdelcurr(isfd) - int isfd; +isdelcurr(int isfd) { int _am_delcurr(); register Fab *fab; @@ -115,11 +114,8 @@ isdelcurr(isfd) */ static int -_amdelcurr(isfhandle, curpos, recnum, errcode) - Bytearray *isfhandle; - Bytearray *curpos; - Recno *recnum; - struct errcode *errcode; +_amdelcurr(Bytearray *isfhandle, Bytearray *curpos, Recno *recnum, + struct errcode *errcode) { Fcb *fcb = NULL; Crp *crp; diff --git a/cde/lib/tt/mini_isam/isdelrec.c b/cde/lib/tt/mini_isam/isdelrec.c index a5492868..cde1f335 100644 --- a/cde/lib/tt/mini_isam/isdelrec.c +++ b/cde/lib/tt/mini_isam/isdelrec.c @@ -63,9 +63,7 @@ static char sccsid[] = "@(#)isdelrec.c 1.8 89/07/17 Copyr 1988 Sun Micro"; */ int -isdelrec(isfd, recnum) - int isfd; - long recnum; +isdelrec(int isfd, long recnum) { int _amdelrec(); register Fab *fab; diff --git a/cde/lib/tt/mini_isam/isdiskbufs2.c b/cde/lib/tt/mini_isam/isdiskbufs2.c index 1929b186..1385e62d 100644 --- a/cde/lib/tt/mini_isam/isdiskbufs2.c +++ b/cde/lib/tt/mini_isam/isdiskbufs2.c @@ -94,12 +94,9 @@ static int maxavailn; /* Stop flushing when +/* unixfd, .rec, .ind., .var */ Bufhdr * -_isdisk_fix(fcb, unixfd, blkno, mode) - Fcb *fcb; - int unixfd; /* .rec, .ind., .var */ - Blkno blkno; - int mode; +_isdisk_fix(Fcb *fcb, int unixfd, Blkno blkno, int mode) { register Bufhdr *p, *p2; struct dlink *hashl; @@ -199,8 +196,7 @@ _isdisk_fix(fcb, unixfd, blkno, mode) } void -_isdisk_unfix (p) - register Bufhdr *p; +_isdisk_unfix (register Bufhdr *p) { if (!(p->isb_flags & ISB_FIXED)) assert(p->isb_flags & ISB_FIXED); @@ -221,14 +217,13 @@ _isdisk_unfix (p) } void -_isdisk_commit1 (p) - Bufhdr *p; +_isdisk_commit1 (Bufhdr *p) { _commit1buffer(p); } void -_isdisk_commit() +_isdisk_commit(void) { register Bufhdr *p; struct dlink *e; @@ -241,7 +236,7 @@ _isdisk_commit() } void -_isdisk_rollback() +_isdisk_rollback(void) { register Bufhdr *p; struct dlink *e; @@ -257,9 +252,7 @@ _isdisk_rollback() } Bufhdr * -_isdisk_refix(p, newmode) - Bufhdr *p; - int newmode; +_isdisk_refix(Bufhdr *p, int newmode) { Blkno blkno = p->isb_blkno; Fcb *fcb = p->isb_fcb; @@ -276,7 +269,7 @@ _isdisk_refix(p, newmode) } void -_isdisk_sync() +_isdisk_sync(void) { extern time_t _istimeget(); register Bufhdr *p; @@ -291,7 +284,7 @@ _isdisk_sync() } void -_isdisk_inval() +_isdisk_inval(void) { extern time_t _istimeget(); register Bufhdr *p; @@ -318,7 +311,7 @@ _isdisk_inval() #if ISDEBUG -_isdisk_dumphd() +_isdisk_dumphd(void) { register Bufhdr *p; int i; @@ -332,8 +325,7 @@ _isdisk_dumphd() p->isb_oldcopy?(p->isb_oldcopy - bufhdrs):-1); } -aclistdump(lh) - struct dlink *lh; +aclistdump(struct dlink *lh) { register Bufhdr *p; struct dlink *e; @@ -347,8 +339,7 @@ aclistdump(lh) } } -flistdump(lh) - struct dlink *lh; +flistdump(struct dlink *lh) { register Bufhdr *p; struct dlink *e; @@ -368,7 +359,7 @@ flistdump(lh) /*------------------------ Local functions ---------------------------------*/ Static void -_disk_init() +_disk_init(void) { static Bool initialized = FALSE; register int i; @@ -403,7 +394,7 @@ _disk_init() /* _getavail() - get available buffer in disk */ Static Bufhdr * -_getavail() +_getavail(void) { register Bufhdr *p; register struct dlink *q; @@ -424,10 +415,7 @@ _getavail() /* _findblock() - Find block in buffer pool */ Static Bufhdr * -_findblock(fcb, unixfd, blkno) - Fcb *fcb; - int unixfd; - Blkno blkno; +_findblock(Fcb *fcb, int unixfd, Blkno blkno) { register Bufhdr *p; struct dlink *lh, *e; @@ -449,8 +437,7 @@ _findblock(fcb, unixfd, blkno) /* _commit1buffer() - Commit changes to buffer */ Static void -_commit1buffer(p) - register Bufhdr *p; +_commit1buffer(register Bufhdr *p) { assert(p->isb_flags & ISB_WFIXED); /* Fixed for read buffers should */ /* go through _isdisk_unfix() */ @@ -470,8 +457,7 @@ _commit1buffer(p) /* _rollback1buffer() - Rollback changes to buffer */ Static void -_rollback1buffer(p) - register Bufhdr *p; +_rollback1buffer(register Bufhdr *p) { register Bufhdr *p2; @@ -501,8 +487,7 @@ _rollback1buffer(p) /* _makenodata() - make buffer available with no data in it*/ Static void -_makenodata(p) - register Bufhdr *p; +_makenodata(register Bufhdr *p) { assert(p->isb_flags & ISB_READ); @@ -513,8 +498,7 @@ _makenodata(p) /* _flush1buffer() - flush buffer to disk */ Static void -_flush1buffer(p) - register Bufhdr *p; +_flush1buffer(register Bufhdr *p) { assert(p->isb_flags & ISB_CHANGE); diff --git a/cde/lib/tt/mini_isam/isdlink.c b/cde/lib/tt/mini_isam/isdlink.c index 2b2be789..1961df88 100644 --- a/cde/lib/tt/mini_isam/isdlink.c +++ b/cde/lib/tt/mini_isam/isdlink.c @@ -43,9 +43,8 @@ #include "isam_impl.h" /* _isdln_base_insert () - Insert element into list (at the front) -----------*/ -void _isdln_base_insert (base,l,e) - register char *base; - register struct dlink *l,*e; +void _isdln_base_insert (register char *base, register struct dlink *l, + register struct dlink *e) { e->dln_forward = l->dln_forward; l->dln_forward = (char *)e - base; @@ -55,9 +54,8 @@ void _isdln_base_insert (base,l,e) } /* _isdln_base_append () - Append element to list (at the end) -------------*/ -void _isdln_base_append (base,l,e) - register char *base; - register struct dlink *l,*e; +void _isdln_base_append (register char *base, register struct dlink *l, + register struct dlink *e) { e->dln_backward = l->dln_backward; l->dln_backward = (char *)e - base; @@ -67,18 +65,14 @@ void _isdln_base_append (base,l,e) } /* _isdln_base_remove () - Remove element from list -------------------------*/ -void _isdln_base_remove (base,e) - register char *base; - register struct dlink *e; +void _isdln_base_remove (register char *base, register struct dlink *e) { ((struct dlink *)(base + e->dln_backward))->dln_forward = e->dln_forward; ((struct dlink *)(base + e->dln_forward))->dln_backward = e->dln_backward; } /* _isdln_base_first () - Return first element of the list -------------------*/ -struct dlink * _isdln_base_first(base,l) - register char *base; - register struct dlink *l; +struct dlink * _isdln_base_first(register char *base, register struct dlink *l) { struct dlink *val = (struct dlink *)(base + l->dln_forward); @@ -92,33 +86,25 @@ struct dlink * _isdln_base_first(base,l) } /* _isdln_base_next () - Return next element in the list --------------------*/ -struct dlink * _isdln_base_next(base,l) - register char *base; - register struct dlink *l; +struct dlink * _isdln_base_next(register char *base, register struct dlink *l) { return (((struct dlink *)(base + l->dln_forward))); } /* _isdln_base_prev () - Return previous element in the list ----------------*/ -struct dlink * _isdln_base_prev(base,l) - register char *base; - register struct dlink *l; +struct dlink * _isdln_base_prev(register char *base, register struct dlink *l) { return (((struct dlink *)(base + l->dln_backward))); } /* _isdln_base_makeempty () - Make head of empty list -----------------------*/ -void _isdln_base_makeempty(base,l) - register char *base; - register struct dlink *l; +void _isdln_base_makeempty(register char *base, register struct dlink *l) { l->dln_forward = l->dln_backward = (char *)l - base; } /* _isdln_base_isempty () - Test if list is empty---------------------------*/ -int _isdln_base_isempty(base,l) - register char *base; - register struct dlink *l; +int _isdln_base_isempty(register char *base, register struct dlink *l) { return (l->dln_forward == (char *)l - base && l->dln_backward == (char *)l - base); diff --git a/cde/lib/tt/mini_isam/iserase.c b/cde/lib/tt/mini_isam/iserase.c index 56bdc3a9..5c58c967 100644 --- a/cde/lib/tt/mini_isam/iserase.c +++ b/cde/lib/tt/mini_isam/iserase.c @@ -65,8 +65,7 @@ static int _amerase(); */ int -iserase(isfname) - char *isfname; +iserase(char isfname) { Isfd isfd, isfd_nfs; Fab *fab, *fab_nfs; @@ -113,9 +112,7 @@ iserase(isfname) */ static int -_amerase(isfhandle, errcode) - Bytearray *isfhandle; - struct errcode *errcode; +_amerase(Bytearray *isfhandle, struct errcode *errcode) { Fcb *fcb; char *isfname = _getisfname(isfhandle); @@ -154,8 +151,7 @@ _amerase(isfhandle, errcode) Static void -_unlink_datfile(isfname) - char *isfname; +_unlink_datfile(char *isfname) { char namebuf[MAXPATHLEN]; @@ -167,8 +163,7 @@ _unlink_datfile(isfname) Static void -_unlink_indfile(isfname) - char *isfname; +_unlink_indfile(char *isfname) { char namebuf[MAXPATHLEN]; @@ -180,8 +175,7 @@ _unlink_indfile(isfname) Static void -_unlink_varfile(isfname) - char *isfname; +_unlink_varfile(char *isfname) { char namebuf[MAXPATHLEN]; diff --git a/cde/lib/tt/mini_isam/iserror.c b/cde/lib/tt/mini_isam/iserror.c index e07b5b4c..356d5e5c 100644 --- a/cde/lib/tt/mini_isam/iserror.c +++ b/cde/lib/tt/mini_isam/iserror.c @@ -116,8 +116,7 @@ _isam_warning(char *msg) } /* Set user specified fatal_error handler */ -int (*_isfatal_error_set_func(func))() - int (*func)(); +int (*_isfatal_error_set_func(int(*func)()))() { int (*oldfunc)(); diff --git a/cde/lib/tt/mini_isam/isfab.c b/cde/lib/tt/mini_isam/isfab.c index fd297497..d8684b90 100644 --- a/cde/lib/tt/mini_isam/isfab.c +++ b/cde/lib/tt/mini_isam/isfab.c @@ -50,15 +50,13 @@ static char sccsid[] = "@(#)isfab.c 1.8 89/07/17 Copyr 1988 Sun Micro"; * Fab_new() creates an File access block (fab object) that is used * for all subsequent operations in this file. Return a pointer to * the fab object, or NULL in the case of an error. + + * isfname, Local path on the host + * varlen, 0/1 flag */ Fab * -_fab_new(isfname, openmode, - varlen, minreclen, maxreclen) - char *isfname; /* Local path on the host */ - enum openmode openmode; - Bool varlen; /* 0/1 flag */ - int minreclen, maxreclen; +_fab_new(char *isfname, enum openmode openmode, Bool varlen, int minreclen, int maxreclen) { register Fab *fab; @@ -88,8 +86,7 @@ _fab_new(isfname, openmode, } void -_fab_destroy(fab) - register Fab *fab; +_fab_destroy(register Fab *fab) { assert(fab != NULL); assert(fab->isfname != NULL); diff --git a/cde/lib/tt/mini_isam/isfcb.c b/cde/lib/tt/mini_isam/isfcb.c index 2f6c72fd..9d993c20 100644 --- a/cde/lib/tt/mini_isam/isfcb.c +++ b/cde/lib/tt/mini_isam/isfcb.c @@ -56,15 +56,15 @@ Static int _open_datfile(), _open_indfile(), _open_varfile(); * * Return 0 if create is successful, or -1 if any error. In the case of *an error, the errcode block is set. + * + * crdat, 0/1 flag + * crind, 0/1 flag + * crvar, 0/1 flag */ Fcb * -_isfcb_create(isfname, crdat, crind, crvar, owner, group, u_mask, errcode) - char *isfname; - int crdat, crind, crvar; /* 0/1 flags */ - int owner, group; - struct errcode *errcode; - int u_mask; +_isfcb_create(char *isfname, int crdat, int crind, int crvar, + int owner, int group, int u_mask, struct errcode *errcode) { register Fcb *fcb; int dat_fd = -1; @@ -156,10 +156,7 @@ _isfcb_create(isfname, crdat, crind, crvar, owner, group, u_mask, errcode) */ void -_isfcb_setreclength(fcb, varflag, minreclen, maxreclen) - register Fcb *fcb; - Bool varflag; - int minreclen, maxreclen; +_isfcb_setreclength(register Fcb *fcb, Bool varflag, int minreclen, int maxreclen) { fcb->varflag = varflag; fcb->minreclen = minreclen; @@ -183,9 +180,7 @@ _isfcb_setreclength(fcb, varflag, minreclen, maxreclen) */ Fcb * -_isfcb_open(isfname, errcode) - char *isfname; - struct errcode *errcode; +_isfcb_open(char *isfname, struct errcode *errcode) { register Fcb *fcb; int dat_fd = -1; @@ -242,8 +237,7 @@ _isfcb_open(isfname, errcode) */ int -_isfcb_nfds(fcb) - register Fcb *fcb; +_isfcb_nfds(register Fcb *fcb) { register int count = 0; @@ -267,8 +261,7 @@ _isfcb_nfds(fcb) */ void -_isfcb_remove(fcb) - register Fcb *fcb; +_isfcb_remove(register Fcb *fcb) { if (fcb->datfd) _remove_datfile(fcb->isfname); @@ -287,8 +280,7 @@ _isfcb_remove(fcb) */ void -_isfcb_close(fcb) - register Fcb *fcb; +_isfcb_close(register Fcb *fcb) { assert (fcb != NULL); assert (fcb->isfname != NULL); @@ -312,8 +304,7 @@ _isfcb_close(fcb) */ int -_isfcb_cntlpg_w(fcb) - register Fcb *fcb; +_isfcb_cntlpg_w(register Fcb *fcb) { char cntl_page[ISCNTLSIZE]; int dat_fd = fcb->datfd; @@ -402,8 +393,7 @@ _isfcb_cntlpg_w(fcb) */ int -_isfcb_cntlpg_w2(fcb) - register Fcb *fcb; +_isfcb_cntlpg_w2(register Fcb *fcb) { char cntl_page[CP_VAREND_OFF+CP_VAREND_LEN]; int dat_fd = fcb->datfd; @@ -462,8 +452,7 @@ _isfcb_cntlpg_w2(fcb) */ int -_isfcb_cntlpg_r(fcb) - register Fcb *fcb; +_isfcb_cntlpg_r(register Fcb *fcb) { char cntl_page[ISCNTLSIZE]; int dat_fd = fcb->datfd; @@ -563,8 +552,7 @@ _isfcb_cntlpg_r(fcb) */ int -_isfcb_cntlpg_r2(fcb) - register Fcb *fcb; +_isfcb_cntlpg_r2(register Fcb *fcb) { char cntl_page[CP_VAREND_OFF+CP_VAREND_LEN]; int dat_fd = fcb->datfd; @@ -637,8 +625,7 @@ _isfcb_cntlpg_r2(fcb) */ Static int -_create_datfile(isfname) - char *isfname; +_create_datfile(char *isfname) { int fd; char namebuf[MAXPATHLEN]; @@ -664,8 +651,7 @@ _create_datfile(isfname) */ Static int -_create_indfile(isfname) - char *isfname; +_create_indfile(char *isfname) { int fd; char namebuf[MAXPATHLEN]; @@ -691,8 +677,7 @@ _create_indfile(isfname) */ Static int -_create_varfile(isfname) - char *isfname; +_create_varfile(char *isfname) { int fd; char namebuf[MAXPATHLEN]; @@ -719,8 +704,7 @@ _create_varfile(isfname) */ Static void -_remove_datfile(isfname) - char *isfname; +_remove_datfile(char *isfname) { char namebuf[MAXPATHLEN]; @@ -737,8 +721,7 @@ _remove_datfile(isfname) */ Static void -_remove_indfile(isfname) - char *isfname; +_remove_indfile(char *isfname) { char namebuf[MAXPATHLEN]; @@ -755,8 +738,7 @@ _remove_indfile(isfname) */ Static void -_remove_varfile(isfname) - char *isfname; +_remove_varfile(char *isfname) { char namebuf[MAXPATHLEN]; @@ -774,9 +756,7 @@ _remove_varfile(isfname) */ Static int -_open_datfile(isfname, rdonly) - char *isfname; - Bool *rdonly; +_open_datfile(char *isfname, Bool *rdonly) { char namebuf[MAXPATHLEN]; int ret; @@ -813,9 +793,7 @@ _open_datfile(isfname, rdonly) */ Static int -_open_indfile(isfname, rdonly) - char *isfname; - Bool rdonly; +_open_indfile(char *isfname, Bool rdonly) { int fd; char namebuf[MAXPATHLEN]; @@ -841,9 +819,7 @@ _open_indfile(isfname, rdonly) */ Static int -_open_varfile(isfname, rdonly) - char *isfname; - Bool rdonly; +_open_varfile(char *isfname, Bool rdonly) { int fd; char namebuf[MAXPATHLEN]; @@ -863,8 +839,7 @@ _open_varfile(isfname, rdonly) } int -_check_isam_magic(fcb) - Fcb *fcb; +_check_isam_magic(Fcb *fcb) { char magicbuffer[CP_MAGIC_LEN]; @@ -888,8 +863,7 @@ _check_isam_magic(fcb) */ int -_open2_indfile(fcb) - Fcb *fcb; +_open2_indfile(Fcb *fcb) { char namebuf[MAXPATHLEN]; struct stat buf; diff --git a/cde/lib/tt/mini_isam/isfcbindex.c b/cde/lib/tt/mini_isam/isfcbindex.c index 92ceb5c3..3fdbbaf0 100644 --- a/cde/lib/tt/mini_isam/isfcbindex.c +++ b/cde/lib/tt/mini_isam/isfcbindex.c @@ -52,9 +52,7 @@ Static int _keypart2cmp(); */ int -_isfcb_primkeyadd(fcb, keydesc2) - Fcb *fcb; - Keydesc2 *keydesc2; +_isfcb_primkeyadd(Fcb *fcb, Keydesc2 *keydesc2) { /* * Assign keyid. @@ -74,8 +72,7 @@ _isfcb_primkeyadd(fcb, keydesc2) */ int -_isfcb_primkeydel(fcb) - Fcb *fcb; +_isfcb_primkeydel(Fcb *fcb) { if (FCB_NOPRIMARY_KEY(fcb)) return (EBADARG); @@ -93,9 +90,7 @@ _isfcb_primkeydel(fcb) */ int -_isfcb_altkeyadd(fcb, keydesc2) - Fcb *fcb; - Keydesc2 *keydesc2; +_isfcb_altkeyadd(Fcb *fcb, Keydesc2 *keydesc2) { assert (fcb->nkeys < MAXNKEYS); @@ -126,9 +121,7 @@ _isfcb_altkeyadd(fcb, keydesc2) */ Keydesc2 * -_isfcb_findkey(fcb, keydesc2) - register Fcb *fcb; - Keydesc2 *keydesc2; +_isfcb_findkey(register Fcb *fcb, Keydesc2 *keydesc2) { int nkeys = fcb->nkeys; register Keydesc2 *kp2; @@ -162,9 +155,7 @@ _isfcb_findkey(fcb, keydesc2) */ int -_isfcb_altkeydel(fcb, keydesc2) - register Fcb *fcb; - Keydesc2 *keydesc2; +_isfcb_altkeydel(register Fcb *fcb, Keydesc2 *keydesc2) { int nkeys = fcb->nkeys; register int i, j; @@ -209,8 +200,7 @@ _isfcb_altkeydel(fcb, keydesc2) /* compare key parts */ Static int -_keypart2cmp(l,r) - register struct keypart2 *l, *r; +_keypart2cmp(register struct keypart2 *l, register struct keypart2 *r) { return !(l->kp2_type == r->kp2_type && l->kp2_start == r->kp2_start && l->kp2_leng == r->kp2_leng); @@ -224,9 +214,7 @@ _keypart2cmp(l,r) */ Keydesc2 * -_isfcb_indfindkey(fcb, keyid) - register Fcb *fcb; - int keyid; +_isfcb_indfindkey(register Fcb *fcb, int keyid) { int nkeys = fcb->nkeys; register Keydesc2 *keys = fcb->keys; diff --git a/cde/lib/tt/mini_isam/isfcbwatchfd.c b/cde/lib/tt/mini_isam/isfcbwatchfd.c index bca1dc0b..8346191b 100644 --- a/cde/lib/tt/mini_isam/isfcbwatchfd.c +++ b/cde/lib/tt/mini_isam/isfcbwatchfd.c @@ -68,7 +68,7 @@ static int _in_use = 0; /* Current number of */ int -_watchfd_incr(n) +_watchfd_incr(int n) { _in_use += n; assert(_in_use <= _limit); @@ -85,7 +85,7 @@ _watchfd_incr(n) */ int -_watchfd_decr(n) +_watchfd_decr(int n) { _in_use -= n; assert(_in_use >= 0); @@ -100,7 +100,7 @@ _watchfd_decr(n) */ int -_watchfd_check() +_watchfd_check(void) { return (_limit - _in_use); } @@ -113,8 +113,7 @@ _watchfd_check() */ int -_watchfd_max_set(n) - int n; +_watchfd_max_set(int n) { int oldlimit = _limit; @@ -143,7 +142,7 @@ _watchfd_max_set(n) */ int -_watchfd_max_get() +_watchfd_max_get(void) { return (_limit); } diff --git a/cde/lib/tt/mini_isam/isfd.c b/cde/lib/tt/mini_isam/isfd.c index d6e400da..33ea2973 100644 --- a/cde/lib/tt/mini_isam/isfd.c +++ b/cde/lib/tt/mini_isam/isfd.c @@ -55,8 +55,7 @@ static Fab *isfdtab[MAXISFD]; /* Table of pointers */ */ Isfd -_isfd_insert(fab) - Fab *fab; +_isfd_insert(Fab *fab) { register Isfd i; @@ -82,8 +81,7 @@ _isfd_insert(fab) */ Fab * -_isfd_find(isfd) - register Isfd isfd; +_isfd_find(register Isfd isfd) { if (isfd < 0 || isfd >= MAXISFD || isfdtab[isfd] == NULL) return (NULL); @@ -98,8 +96,7 @@ _isfd_find(isfd) */ void -_isfd_delete(isfd) - register Isfd isfd; +_isfd_delete(register Isfd isfd) { if (isfd >= 0 && isfd < MAXISFD) isfdtab[isfd] = NULL; diff --git a/cde/lib/tt/mini_isam/isfileio.c b/cde/lib/tt/mini_isam/isfileio.c index 3edd09ee..c1df7ec6 100644 --- a/cde/lib/tt/mini_isam/isfileio.c +++ b/cde/lib/tt/mini_isam/isfileio.c @@ -54,12 +54,7 @@ static Blkno _getblkno(); */ void -_cp_tofile(fcb, unixfd, data, pos, len) - Fcb *fcb; - int unixfd; - char *data; - long pos; - int len; +_cp_tofile(Fcb *fcb, int unixfd, char *data, long pos, int len) { int offset; /* Offset within a page */ Blkno blkno; @@ -93,12 +88,7 @@ _cp_tofile(fcb, unixfd, data, pos, len) */ void -_cp_fromfile(fcb, unixfd, data, pos, len) - Fcb *fcb; - int unixfd; - char *data; - long pos; - int len; +_cp_fromfile(Fcb *fcb, int unixfd, char *data, long pos, int len) { int offset; /* Offset within a page */ Blkno blkno; @@ -130,10 +120,7 @@ _cp_fromfile(fcb, unixfd, data, pos, len) */ Blkno -_extend_file(fcb, unixfd, oldsize) - Fcb *fcb; - int unixfd; - Blkno oldsize; +_extend_file(Fcb *fcb, int unixfd, Blkno oldsize) { Bufhdr *bufhdr; char buf[ISPAGESIZE]; @@ -158,8 +145,7 @@ _extend_file(fcb, unixfd, oldsize) */ Static int -_getoffset(pos) - long pos; +_getoffset(long pos) { return ((int)(pos % ISPAGESIZE)); } @@ -171,8 +157,7 @@ _getoffset(pos) */ Static Blkno -_getblkno(pos) - long pos; +_getblkno(long pos) { return ((int)(pos / ISPAGESIZE)); } diff --git a/cde/lib/tt/mini_isam/isfixrec.c b/cde/lib/tt/mini_isam/isfixrec.c index b0d16dd0..68d20e9d 100644 --- a/cde/lib/tt/mini_isam/isfixrec.c +++ b/cde/lib/tt/mini_isam/isfixrec.c @@ -64,11 +64,7 @@ static void remove_from_chain(); /* used by _flrec_wrrec() */ /*ARGSUSED*/ int -_flrec_write(fcb, record, recnum, reclen) - register Fcb *fcb; - char *record; - Recno *recnum; - int reclen; +_flrec_write(register Fcb *fcb, char *record, Recno *recnum, int reclen) { Recno recnum2; long rec_position; @@ -131,11 +127,7 @@ _flrec_write(fcb, record, recnum, reclen) */ int -_flrec_read(fcb, record, recnum, reclen) - register Fcb *fcb; - char *record; - Recno recnum; - int *reclen; +_flrec_read(register Fcb *fcb, char *record, Recno recnum, int *reclen) { long rec_position; char delflag; @@ -173,9 +165,7 @@ _flrec_read(fcb, record, recnum, reclen) */ long -_fl_getpos(fcb, recnum) - Fcb *fcb; - Recno recnum; +_fl_getpos(Fcb *fcb, Recno recnum) { return ((long)(ISCNTLSIZE + (fcb->minreclen + 1) * (recnum -1))); } @@ -196,11 +186,7 @@ _fl_getpos(fcb, recnum) /*ARGSUSED*/ int -_flrec_rewrite(fcb, record, recnum, reclen) - register Fcb *fcb; - char *record; - Recno recnum; - int reclen; +_flrec_rewrite(register Fcb *fcb, char *record, Recno recnum, int reclen) { long rec_position; char delflag; @@ -242,9 +228,7 @@ _flrec_rewrite(fcb, record, recnum, reclen) */ int -_flrec_delete(fcb, recnum) - register Fcb *fcb; - Recno recnum; +_flrec_delete(register Fcb *fcb, Recno recnum) { long rec_position; char delflag; @@ -301,11 +285,7 @@ _flrec_delete(fcb, recnum) /*ARGSUSED*/ int -_flrec_wrrec(fcb, record, recnum, reclen) - register Fcb *fcb; - char *record; - Recno recnum; - int reclen; +_flrec_wrrec(register Fcb *fcb, char *record, Recno recnum, int reclen) { long rec_position; char delflag; @@ -392,9 +372,7 @@ _flrec_wrrec(fcb, record, recnum, reclen) */ static void -remove_from_chain(fcb, recnum) - Fcb *fcb; - Recno recnum; +remove_from_chain(Fcb *fcb, Recno recnum) { char recnobuf1 [RECNOSIZE] , recnobuf2 [RECNOSIZE]; long pos1, pos2; diff --git a/cde/lib/tt/mini_isam/isfname.c b/cde/lib/tt/mini_isam/isfname.c index c3a51462..dfc3cd82 100644 --- a/cde/lib/tt/mini_isam/isfname.c +++ b/cde/lib/tt/mini_isam/isfname.c @@ -54,8 +54,7 @@ char *_lastelement(); */ void -_makedat_isfname(isfname) - char *isfname; +_makedat_isfname(char *isfname) { /* Append .rec */ (void) strcat(isfname, DAT_SUFFIX); @@ -69,8 +68,7 @@ _makedat_isfname(isfname) */ void -_makeind_isfname(isfname) - char *isfname; +_makeind_isfname(char *isfname) { /* Append .ind */ (void) strcat(isfname, IND_SUFFIX); @@ -84,8 +82,7 @@ _makeind_isfname(isfname) */ void -_makevar_isfname(isfname) - char *isfname; +_makevar_isfname(char *isfname) { /* Append .var */ (void) strcat(isfname, VAR_SUFFIX); @@ -99,8 +96,7 @@ _makevar_isfname(isfname) */ void -_removelast(path) - char *path; +_removelast(char *path) { register char *p; @@ -116,8 +112,7 @@ _removelast(path) */ char * -_lastelement(path) - char *path; +_lastelement(char *path) { register char *p; diff --git a/cde/lib/tt/mini_isam/isindexconv.c b/cde/lib/tt/mini_isam/isindexconv.c index ba369afb..f50d782a 100644 --- a/cde/lib/tt/mini_isam/isindexconv.c +++ b/cde/lib/tt/mini_isam/isindexconv.c @@ -42,9 +42,7 @@ static char sccsid[] = "@(#)isindexconv.c 1.3 89/07/17 Copyr 1988 Sun Micro"; #include "isam_impl.h" void -stkey(pkeydesc2, p) - Keydesc2 *pkeydesc2; - char *p; +stkey(Keydesc2 *pkeydesc2, char *p) { int i; register struct keypart2 *ppart; @@ -82,9 +80,7 @@ stkey(pkeydesc2, p) } void -ldkey(pkeydesc2,p) - register struct keydesc2 *pkeydesc2; - register char *p; +ldkey(register struct keydesc2 *pkeydesc2, register char *p) { int i; register struct keypart2 *ppart; diff --git a/cde/lib/tt/mini_isam/isindexinfo.c b/cde/lib/tt/mini_isam/isindexinfo.c index 9fdbed0b..68b425f5 100644 --- a/cde/lib/tt/mini_isam/isindexinfo.c +++ b/cde/lib/tt/mini_isam/isindexinfo.c @@ -61,10 +61,7 @@ static char sccsid[] = "@(#)isindexinfo.c 1.2 91/05/16 Copyr 1988 Sun Micro"; #define dibuf ((struct dictinfo *)buffer) int -isindexinfo(isfd, buffer, number) - int isfd; - struct keydesc *buffer; - int number; +isindexinfo(int isfd, struct keydesc *buffer, int number) { register Fab *fab; int ret; diff --git a/cde/lib/tt/mini_isam/isindfreel.c b/cde/lib/tt/mini_isam/isindfreel.c index 8b0f95b4..053a6db9 100644 --- a/cde/lib/tt/mini_isam/isindfreel.c +++ b/cde/lib/tt/mini_isam/isindfreel.c @@ -51,8 +51,7 @@ extern Bufhdr *_isdisk_fix(); */ Blkno -_isindfreel_alloc(fcb) - Fcb *fcb; +_isindfreel_alloc(Fcb *fcb) { Bufhdr *pbhdr; char *p; @@ -97,9 +96,7 @@ _isindfreel_alloc(fcb) */ void -_isindfreel_free(fcb, blkno) - Fcb *fcb; - Blkno blkno; +_isindfreel_free(Fcb *fcb, Blkno blkno) { Bufhdr *pbhdr; char *p; diff --git a/cde/lib/tt/mini_isam/iskeyaux.c b/cde/lib/tt/mini_isam/iskeyaux.c index 63ab9ad6..42783878 100644 --- a/cde/lib/tt/mini_isam/iskeyaux.c +++ b/cde/lib/tt/mini_isam/iskeyaux.c @@ -51,10 +51,7 @@ Blkno _isgetfreekpage(); */ void -_iskey_extract (pkeydesc2, recp, keyp) - Keydesc2 * pkeydesc2; - char *recp; - char *keyp; +_iskey_extract (Keydesc2 *pkeydesc2, char *recp, char *keyp) { register int i; register struct keypart2 *ppart; @@ -86,14 +83,12 @@ _iskey_extract (pkeydesc2, recp, keyp) * _allockpage() * * Allocate an initialize new key page. + * + * blkno, Output parameter */ Bufhdr * -_allockpage(fcb, capac, level, blkno) - Fcb *fcb; - int capac; - int level; - Blkno *blkno; /* Output parameter */ +_allockpage(Fcb *fcb, int capac, int level, Blkno *blkno) { Bufhdr *pbufhdr; char *p; diff --git a/cde/lib/tt/mini_isam/iskeycalc.c b/cde/lib/tt/mini_isam/iskeycalc.c index d4fc8146..3b305b60 100644 --- a/cde/lib/tt/mini_isam/iskeycalc.c +++ b/cde/lib/tt/mini_isam/iskeycalc.c @@ -44,8 +44,7 @@ static char sccsid[] = "@(#)iskeycalc.c 1.3 89/07/17 Copyr 1988 Sun Micro"; /* getkeysperleaf() - Calculate number of keys per leaf node */ int -getkeysperleaf (keylen) - int keylen; +getkeysperleaf (int keylen) { int n; @@ -56,8 +55,7 @@ getkeysperleaf (keylen) /* getkeyspernode() - Calculate number of keys per non-leaf node */ int -getkeyspernode (keylen) - int keylen; +getkeyspernode (int keylen) { int n; @@ -69,8 +67,7 @@ getkeyspernode (keylen) /* le_odd(n) - Get next lower or equal odd number */ int -le_odd(n) - int n; +le_odd(int n) { return ((n - 1) | 1); } diff --git a/cde/lib/tt/mini_isam/iskeycmp.c b/cde/lib/tt/mini_isam/iskeycmp.c index 0691349a..00cc1ed4 100644 --- a/cde/lib/tt/mini_isam/iskeycmp.c +++ b/cde/lib/tt/mini_isam/iskeycmp.c @@ -50,12 +50,11 @@ static int _ncurtab; /* Number of entries */ * _iskeycmp_set() * * Set key decriptor and number of parts for subsequent key comparison.s + * nparts, Use only so many parts */ void -_iskeycmp_set (pkeydesc2, nparts) - Keydesc2 *pkeydesc2; - int nparts; /* Use only so many parts */ +_iskeycmp_set (Keydesc2 *pkeydesc2, int nparts) { _ncurtab = nparts; _curtab = pkeydesc2->k2_part; @@ -69,8 +68,7 @@ _iskeycmp_set (pkeydesc2, nparts) */ int -_iskeycmp(lkey, rkey) - char *lkey, *rkey; +_iskeycmp(char *lkey, char *rkey) { int i, ret; register struct keypart2 *p; diff --git a/cde/lib/tt/mini_isam/iskeyvalid.c b/cde/lib/tt/mini_isam/iskeyvalid.c index 57aa9f02..789a6a7d 100644 --- a/cde/lib/tt/mini_isam/iskeyvalid.c +++ b/cde/lib/tt/mini_isam/iskeyvalid.c @@ -54,9 +54,7 @@ static int _check_typelen(); */ int -_validate_keydesc(keydesc, minreclen) - register struct keydesc *keydesc; - int minreclen; +_validate_keydesc(register struct keydesc *keydesc, int minreclen) { int nparts; register int i; @@ -99,9 +97,7 @@ _validate_keydesc(keydesc, minreclen) */ static int -_check_typelen(type, length) - int type; - int length; +_check_typelen(int type, int length) { switch (type) { case INTTYPE: diff --git a/cde/lib/tt/mini_isam/isminmax.c b/cde/lib/tt/mini_isam/isminmax.c index 71be79a0..496a6fa1 100644 --- a/cde/lib/tt/mini_isam/isminmax.c +++ b/cde/lib/tt/mini_isam/isminmax.c @@ -75,9 +75,7 @@ static float *isminfloat = (float *)isminfloatarr; */ void -_iskey_fillmax(pkeydesc2, keybuf) - struct keydesc2 *pkeydesc2; - register char *keybuf; +_iskey_fillmax(struct keydesc2 *pkeydesc2, register char *keybuf) { register int i; register struct keypart2 *ppart; @@ -143,9 +141,7 @@ _iskey_fillmax(pkeydesc2, keybuf) */ void -_iskey_fillmin(pkeydesc2, keybuf) - struct keydesc2 *pkeydesc2; - register char *keybuf; +_iskey_fillmin(struct keydesc2 *pkeydesc2, register char *keybuf) { register int i; register struct keypart2 *ppart; diff --git a/cde/lib/tt/mini_isam/ismngfcb.c b/cde/lib/tt/mini_isam/ismngfcb.c index bfec60ff..eee44698 100644 --- a/cde/lib/tt/mini_isam/ismngfcb.c +++ b/cde/lib/tt/mini_isam/ismngfcb.c @@ -75,9 +75,7 @@ static mrused_last = 0; /* stamp generator */ */ void -_mngfcb_insert(fcb, isfhandle) - Fcb *fcb; - Bytearray *isfhandle; +_mngfcb_insert(Fcb *fcb, Bytearray *isfhandle) { int hashval = _hashisfhandle(isfhandle); register int ind; @@ -114,8 +112,7 @@ _mngfcb_insert(fcb, isfhandle) */ Fcb * -_mngfcb_find(isfhandle) - Bytearray *isfhandle; +_mngfcb_find(Bytearray *isfhandle) { int hashval = _hashisfhandle(isfhandle); register int ind; @@ -150,8 +147,7 @@ _mngfcb_find(isfhandle) */ void -_mngfcb_delete(isfhandle) - Bytearray *isfhandle; +_mngfcb_delete(Bytearray *isfhandle) { int hashval = _hashisfhandle(isfhandle); register int ind; @@ -187,7 +183,7 @@ _mngfcb_delete(isfhandle) */ Bytearray * -_mngfcb_victim() +_mngfcb_victim(void) { int victim_ind = -1; long victim_time = 0; /* Assign to shut up lint */ @@ -214,8 +210,7 @@ _mngfcb_victim() */ Static int -_hashisfhandle(isfhandle) - Bytearray *isfhandle; +_hashisfhandle(Bytearray *isfhandle) { register char *p; register unsigned h, g; diff --git a/cde/lib/tt/mini_isam/isopen.c b/cde/lib/tt/mini_isam/isopen.c index 95487d8a..82f43df7 100644 --- a/cde/lib/tt/mini_isam/isopen.c +++ b/cde/lib/tt/mini_isam/isopen.c @@ -72,9 +72,7 @@ static int _am_open(); */ int -isopen(isfname, mode) - char *isfname; - int mode; +isopen(char *isfname, int mode) { Fab *fab; Isfd isfd; @@ -119,8 +117,7 @@ isopen(isfname, mode) return ((int)isfd); /* Successful isopen() */ } -Static int _am_open(fab) - register Fab *fab; +Static int _am_open(register Fab *fab) { return (_amopen(fab->isfname, fab->openmode, &fab->varlength, &fab->minreclen, &fab->maxreclen, &fab->isfhandle, diff --git a/cde/lib/tt/mini_isam/ispageio.c b/cde/lib/tt/mini_isam/ispageio.c index 0e43164f..de219c60 100644 --- a/cde/lib/tt/mini_isam/ispageio.c +++ b/cde/lib/tt/mini_isam/ispageio.c @@ -50,9 +50,7 @@ static char sccsid[] = "@(#)ispageio.c 1.3 89/07/17 Copyr 1988 Sun Micro"; */ void -_isseekpg(fd, pgno) - int fd; - Blkno pgno; +_isseekpg(int fd, Blkno pgno) { long offset = pgno * ISPAGESIZE; @@ -67,9 +65,7 @@ _isseekpg(fd, pgno) */ void -_isreadpg(fd, buf) - int fd; - char *buf; +_isreadpg(int fd, char *buf) { if (read(fd, buf, ISPAGESIZE) != ISPAGESIZE) _isfatal_error("read failed"); @@ -82,9 +78,7 @@ _isreadpg(fd, buf) */ void -_iswritepg(fd, buf) - int fd; - char *buf; +_iswritepg(int fd, char *buf) { if (write(fd, buf, ISPAGESIZE) != ISPAGESIZE) _isfatal_error("write failed"); diff --git a/cde/lib/tt/mini_isam/isperm.c b/cde/lib/tt/mini_isam/isperm.c index 2b3cf6d1..33506c75 100644 --- a/cde/lib/tt/mini_isam/isperm.c +++ b/cde/lib/tt/mini_isam/isperm.c @@ -49,8 +49,7 @@ static char sccsid[] = "@(#)isperm.c 1.3 89/07/17 Copyr 1988 Sun Micro"; */ enum openmode -_getopenmode(mode) - int mode; +_getopenmode(int mode) { switch (mode & ISOPENMODE) { case ISINPUT: @@ -71,8 +70,7 @@ _getopenmode(mode) */ enum readmode -_getreadmode(mode) - int mode; +_getreadmode(int mode) { switch (mode & ISREADMODE) { case ISFIRST: diff --git a/cde/lib/tt/mini_isam/isread.c b/cde/lib/tt/mini_isam/isread.c index 1813fb19..7d418e21 100644 --- a/cde/lib/tt/mini_isam/isread.c +++ b/cde/lib/tt/mini_isam/isread.c @@ -71,10 +71,7 @@ static int _amread(); */ int -isread(isfd, record, mode) - int isfd; - char *record; - int mode; +isread(int isfd, char *record, int mode) { register Fab *fab; int reclen; @@ -150,14 +147,9 @@ isread(isfd, record, mode) */ static int -_amread(isfhandle, record, reclen, readmode, curpos, recnum, errcode) - Bytearray *isfhandle; - enum readmode readmode; - char *record; - int *reclen; - Bytearray *curpos; - Recno *recnum; - struct errcode *errcode; +_amread(Bytearray *isfhandle, char *record, int *reclen, + enum readmode readmode, Bytearray *curpos, Recno *recnum, + struct errcode *errcode) { Fcb *fcb = NULL; Recno recnum2; diff --git a/cde/lib/tt/mini_isam/isrename.c b/cde/lib/tt/mini_isam/isrename.c index 810a2144..0411b510 100644 --- a/cde/lib/tt/mini_isam/isrename.c +++ b/cde/lib/tt/mini_isam/isrename.c @@ -68,8 +68,7 @@ static int _amrename(); */ int -isrename(oldname, newname) - char *oldname, *newname; +isrename(char *oldname, char *newname) { Isfd isfd, isfd2; Fab *fab; @@ -145,8 +144,7 @@ isrename(oldname, newname) */ Static void -_removelast2(path) - char *path; +_removelast2(char *path) { register char *p; @@ -169,10 +167,7 @@ _removelast2(path) static int -_amrename(isfhandle, newname, errcode) - Bytearray *isfhandle; - char *newname; - struct errcode *errcode; +_amrename(Bytearray *isfhandle, char *newname, struct errcode *errcode) { Fcb *fcb; char *isfname = _getisfname(isfhandle); @@ -210,10 +205,9 @@ _amrename(isfhandle, newname, errcode) } +/* newname, with no prefix */ Static void -_rename_datfile(isfname, newname) - char *isfname; - char *newname; /* with no prefix */ +_rename_datfile(char *isfname, char *newname) { char namebuf[MAXPATHLEN]; char newbuf[MAXPATHLEN]; @@ -239,10 +233,9 @@ _rename_datfile(isfname, newname) (void)rename(namebuf, newbuf); } +/* newname, with no prefix */ Static void -_rename_indfile(isfname, newname) - char *isfname; - char *newname; /* with no prefix */ +_rename_indfile(char *isfname, char *newname) { char namebuf[MAXPATHLEN]; char newbuf[MAXPATHLEN]; @@ -268,10 +261,9 @@ _rename_indfile(isfname, newname) (void)rename(namebuf, newbuf); } +/* newname, with no prefix */ Static void -_rename_varfile(isfname, newname) - char *isfname; - char *newname; /* with no prefix */ +_rename_varfile(char *isfname, char *newname) { char namebuf[MAXPATHLEN]; char newbuf[MAXPATHLEN]; diff --git a/cde/lib/tt/mini_isam/isrepair.c b/cde/lib/tt/mini_isam/isrepair.c index 041b3e00..65ed171b 100644 --- a/cde/lib/tt/mini_isam/isrepair.c +++ b/cde/lib/tt/mini_isam/isrepair.c @@ -69,9 +69,7 @@ Static int typeletter(); Static rp_readcntlpg(); static int isnoprintf(const char *, ...); -isrepair(isfname, verbose) - char *isfname; - int verbose; +isrepair(char *isfname, int verbose) { extern char *rp_readrecord_v(), *rp_readrecord_f(); char cntlpg[ISCNTLSIZE]; @@ -345,9 +343,7 @@ static char recordbuffer[ISMAXRECLEN + LONGSIZE]; /* rp_readcntlpg() - Read the control page */ Static -rp_readcntlpg(datfd, cntlpg) - int datfd; - char *cntlpg; +rp_readcntlpg(int datfd, char *cntlpg) { if (read (datfd, cntlpg, ISCNTLSIZE) != ISCNTLSIZE) return (ISERROR); @@ -357,10 +353,7 @@ rp_readcntlpg(datfd, cntlpg) /* rp_readrecord_f() - Read a record from .rec file */ Static char * -rp_readrecord_f(datfd, offset, reclen) - int datfd; - long offset; - int reclen; +rp_readrecord_f(int datfd, long offset, int reclen) { if (lseek(datfd, offset, 0) != offset) return ((char *) NULL); @@ -376,10 +369,7 @@ rp_readrecord_f(datfd, offset, reclen) /* rp_readrecord_v() - Read a record from .rec file */ Static char * -rp_readrecord_v(datfd, varfd, offset, minreclen, maxreclen) - int datfd, varfd; - long offset; - int minreclen, maxreclen; +rp_readrecord_v(int datfd, int varfd, long offset, int minreclen, int maxreclen) { long tailoff; char frameheadbuf [2 * SHORTSIZE]; @@ -462,8 +452,7 @@ cmd_error(const char *str, int (*print)(const char *, ...)) } static int -typeletter(type) - int type; +typeletter(int type) { switch (type) { case INTTYPE: diff --git a/cde/lib/tt/mini_isam/isrewcurr.c b/cde/lib/tt/mini_isam/isrewcurr.c index c0e4dda8..12c42d2f 100644 --- a/cde/lib/tt/mini_isam/isrewcurr.c +++ b/cde/lib/tt/mini_isam/isrewcurr.c @@ -71,9 +71,7 @@ static int _amrewcurr(), _changekeys2(); */ int -isrewcurr(isfd, record) - int isfd; - char *record; +isrewcurr(int isfd, char *record) { register Fab *fab; int reclen; @@ -134,13 +132,8 @@ isrewcurr(isfd, record) */ static int -_amrewcurr(isfhandle, record, reclen, curpos, recnum, errcode) - Bytearray *isfhandle; - char *record; - int reclen; - Recno *recnum; - Bytearray *curpos; - struct errcode *errcode; +_amrewcurr(Bytearray *isfhandle, char *record, int reclen, + Bytearray *curpos, Recno *recnum, struct errcode *errcode) { Fcb *fcb; Crp *crp; @@ -242,12 +235,8 @@ _amrewcurr(isfhandle, record, reclen, curpos, recnum, errcode) } Static int -_changekeys2(fcb, record, oldrecord, recnum, curpos) - Fcb *fcb; - char *record; - char *oldrecord; - Recno recnum; - Bytearray *curpos; +_changekeys2(Fcb *fcb, char *record, char *oldrecord, + Recno recnum, Bytearray *curpos) { int nkeys = fcb->nkeys; register int i; diff --git a/cde/lib/tt/mini_isam/isrewrec.c b/cde/lib/tt/mini_isam/isrewrec.c index dd55349d..5a10d2ac 100644 --- a/cde/lib/tt/mini_isam/isrewrec.c +++ b/cde/lib/tt/mini_isam/isrewrec.c @@ -70,10 +70,7 @@ static int _amrewrec(), _changekeys(); */ int -isrewrec(isfd, recnum, record) - int isfd; - long recnum; - char *record; +isrewrec(int isfd, long recnum, char *record) { register Fab *fab; int reclen; @@ -131,12 +128,8 @@ isrewrec(isfd, recnum, record) */ static int -_amrewrec(isfhandle, record, reclen, recnum, errcode) - Bytearray *isfhandle; - char *record; - int reclen; - Recno recnum; - struct errcode *errcode; +_amrewrec(Bytearray *isfhandle, char *record, int reclen, Recno recnum, + struct errcode *errcode) { Fcb *fcb; char oldrecbuf[ISMAXRECLEN]; @@ -214,11 +207,7 @@ _amrewrec(isfhandle, record, reclen, recnum, errcode) } static int -_changekeys (fcb, record, oldrecord, recnum) - Fcb *fcb; - char *record; - char *oldrecord; - Recno recnum; +_changekeys (Fcb *fcb, char *record, char *oldrecord, Recno recnum) { int nkeys = fcb->nkeys; register int i; diff --git a/cde/lib/tt/mini_isam/issignals.c b/cde/lib/tt/mini_isam/issignals.c index 3e06c0a4..ae3f2fc9 100644 --- a/cde/lib/tt/mini_isam/issignals.c +++ b/cde/lib/tt/mini_isam/issignals.c @@ -65,9 +65,8 @@ static sigset_t oldmask; static sigset_t allsignals; -_issignals_cntl(opt) - int opt; /* 1 will enable masking */ - /* 0 will disable masking */ +/* opt, 1 will enable masking, 0 will disable masking */ +_issignals_cntl(int opt) { int oldmask = do_mask; diff --git a/cde/lib/tt/mini_isam/issort.c b/cde/lib/tt/mini_isam/issort.c index c4a7380a..d8ce30eb 100644 --- a/cde/lib/tt/mini_isam/issort.c +++ b/cde/lib/tt/mini_isam/issort.c @@ -52,10 +52,7 @@ extern char *_isunix_malloc(); */ Issort * -_issort_create(reclen,nrecs,compfunc) - int reclen; - int nrecs; - int (*compfunc)(); +_issort_create(int reclen, int nrecs, int (*compfunc)()) { Issort *p; @@ -82,8 +79,7 @@ _issort_create(reclen,nrecs,compfunc) */ void -_issort_destroy(srt) - Issort *srt; +_issort_destroy(Issort *srt) { assert(srt->ist_array != (char *) 0); @@ -98,9 +94,7 @@ _issort_destroy(srt) */ void -_issort_insert(srt,record) - register Issort *srt; - char *record; +_issort_insert(register Issort *srt, char *record) { assert(srt->ist_nrecs < srt->ist_allocrecs); @@ -117,8 +111,7 @@ _issort_insert(srt,record) */ void -_issort_sort(srt) - Issort *srt; +_issort_sort(Issort *srt) { if (srt->ist_nrecs > 1) qsort(srt->ist_array,srt->ist_nrecs,srt->ist_reclength,srt->ist_compf); @@ -133,8 +126,7 @@ _issort_sort(srt) */ void -_issort_rewind(srt) - Issort *srt; +_issort_rewind(Issort *srt) { srt->ist_currec = 0; } @@ -146,8 +138,7 @@ _issort_rewind(srt) */ char * -_issort_read(srt) - register Issort *srt; +_issort_read(register Issort *srt) { return((srt->ist_currec < srt->ist_nrecs) ? (srt->ist_array + srt->ist_currec++ * srt->ist_reclength) : diff --git a/cde/lib/tt/mini_isam/isstart.c b/cde/lib/tt/mini_isam/isstart.c index 161ada2a..6379da9b 100644 --- a/cde/lib/tt/mini_isam/isstart.c +++ b/cde/lib/tt/mini_isam/isstart.c @@ -67,12 +67,8 @@ static int _amstart(); */ int -isstart(isfd, keydesc, length, record, mode) - int isfd; - struct keydesc *keydesc; - int length; - char *record; - int mode; +isstart(int isfd, struct keydesc *keydesc, int length, char *record, + int mode) { register Fab *fab; int reclen; @@ -160,17 +156,9 @@ isstart(isfd, keydesc, length, record, mode) /* ARGSUSED */ static int -_amstart(isfhandle, record, reclen, readmode, - keydesc, keylen, curpos, recnum, errcode) - Bytearray *isfhandle; - enum readmode readmode; - char *record; - int *reclen; - Bytearray *curpos; - Recno *recnum; - struct errcode *errcode; - struct keydesc *keydesc; - int keylen; +_amstart(Bytearray *isfhandle, char *record, int *reclen, + enum readmode readmode, struct keydesc *keydesc, int keylen, + Bytearray *curpos, Recno *recnum, struct errcode *errcode) { Fcb *fcb; Recno recnum2; diff --git a/cde/lib/tt/mini_isam/issync.c b/cde/lib/tt/mini_isam/issync.c index 7a6c60cc..3b00dd2e 100644 --- a/cde/lib/tt/mini_isam/issync.c +++ b/cde/lib/tt/mini_isam/issync.c @@ -53,7 +53,7 @@ static char sccsid[] = "@(#)issync.c 1.7 89/07/17 Copyr 1988 Sun Micro"; */ int -issync() +issync(void) { return iscntl(ALLISFD, ISCNTL_FSYNC); } @@ -63,14 +63,13 @@ issync() */ int -isfsync(isfd) - int isfd; +isfsync(int isfd) { return iscntl(isfd, ISCNTL_FSYNC); } -_issync() +int _issync(void) { int i; @@ -80,8 +79,7 @@ _issync() return (ISOK); } -_isfsync(isfd) - int isfd; +int _isfsync(int isfd) { register Fab *fab; Fcb *fcb; diff --git a/cde/lib/tt/mini_isam/isvarrec.c b/cde/lib/tt/mini_isam/isvarrec.c index f8433673..28a0c190 100644 --- a/cde/lib/tt/mini_isam/isvarrec.c +++ b/cde/lib/tt/mini_isam/isvarrec.c @@ -67,11 +67,7 @@ static _istail_read(); /*ARGSUSED*/ int -_vlrec_write(fcb, record, recnum, reclen) - register Fcb *fcb; - char *record; - Recno *recnum; - int reclen; +_vlrec_write(register Fcb *fcb, char *record, Recno *recnum, int reclen) { Recno recnum2; long rec_position; @@ -141,11 +137,7 @@ _vlrec_write(fcb, record, recnum, reclen) */ int -_vlrec_read(fcb, record, recnum, reclen) - register Fcb *fcb; - char *record; - Recno recnum; - int *reclen; +_vlrec_read(register Fcb *fcb, char *record, Recno recnum, int *reclen) { long rec_position; long tailoff; @@ -193,9 +185,7 @@ _vlrec_read(fcb, record, recnum, reclen) */ long -_vl_getpos(fcb, recnum) - Fcb *fcb; - Recno recnum; +_vl_getpos(Fcb *fcb, Recno recnum) { return ((long)(ISCNTLSIZE + (fcb->minreclen + LONGSIZE) * (recnum -1))); } @@ -216,11 +206,7 @@ _vl_getpos(fcb, recnum) /*ARGSUSED*/ int -_vlrec_rewrite(fcb, record, recnum, reclen) - register Fcb *fcb; - char *record; - Recno recnum; - int reclen; +_vlrec_rewrite(register Fcb *fcb, char *record, Recno recnum, int reclen) { long rec_position; long tailoff; @@ -272,9 +258,7 @@ _vlrec_rewrite(fcb, record, recnum, reclen) */ int -_vlrec_delete(fcb, recnum) - register Fcb *fcb; - Recno recnum; +_vlrec_delete(register Fcb *fcb, Recno recnum) { long rec_position; long tailoff; @@ -338,11 +322,7 @@ _vlrec_delete(fcb, recnum) /*ARGSUSED*/ int -_vlrec_wrrec(fcb, record, recnum, reclen) - register Fcb *fcb; - char *record; - Recno recnum; - int reclen; +_vlrec_wrrec(register Fcb *fcb, char *record, Recno recnum, int reclen) { long rec_position; long tailoff; @@ -437,9 +417,7 @@ _vlrec_wrrec(fcb, record, recnum, reclen) */ static void -remove_from_chain2(fcb, recnum) - Fcb *fcb; - Recno recnum; +remove_from_chain2(Fcb *fcb, Recno recnum) { char recnobuf1 [RECNOSIZE] , recnobuf2 [RECNOSIZE]; long pos1, pos2; @@ -474,10 +452,7 @@ remove_from_chain2(fcb, recnum) /* Insert tail into .var file. Return offset in .var file */ -long _istail_insert(fcb, tailp, taillen) - Fcb *fcb; - char *tailp; - int taillen; +long _istail_insert(Fcb *fcb, char *tailp, int taillen) { char frameheadbuf [2 * SHORTSIZE]; int framelen; @@ -518,9 +493,7 @@ long _istail_insert(fcb, tailp, taillen) /* Remove tail from .var file */ /* ARGSUSED */ -Static void _istail_delete(fcb, offset) - Fcb *fcb; - long offset; +Static void _istail_delete(Fcb *fcb, long offset) { /* * Don't do anything in NetISAM 1.0. The tails are lost, the space @@ -531,10 +504,7 @@ Static void _istail_delete(fcb, offset) /* Read tail from .var file */ -Static _istail_read(fcb, offset, buffer) - Fcb *fcb; - long offset; - char *buffer; +Static _istail_read(Fcb *fcb, long offset, char *buffer) { char frameheadbuf [2 * SHORTSIZE]; int taillen; @@ -556,11 +526,7 @@ Static _istail_read(fcb, offset, buffer) /* Rewrite tail. Returns -1 if the new tail is longer than the original frame */ -int _istail_modify(fcb, offset, tailp, taillen) - Fcb *fcb; - long offset; - int taillen; - char *tailp; +int _istail_modify(Fcb *fcb, long offset, char *tailp, int taillen) { char frameheadbuf [2 * SHORTSIZE]; int framelen; diff --git a/cde/lib/tt/mini_isam/iswrite.c b/cde/lib/tt/mini_isam/iswrite.c index 93b03fbe..478be771 100644 --- a/cde/lib/tt/mini_isam/iswrite.c +++ b/cde/lib/tt/mini_isam/iswrite.c @@ -71,9 +71,7 @@ static int _am_write(); */ int -iswrite(isfd, record) - int isfd; - char *record; +iswrite(int isfd, char *record) { int _am_write(); register Fab *fab; @@ -123,12 +121,8 @@ iswrite(isfd, record) } -Static int _am_write(fab, record, reclen, curpos, recnum) - register Fab *fab; - char *record; - int reclen; - Bytearray *curpos; - Recno *recnum; +Static int _am_write(register Fab *fab, char *record, int reclen, + Bytearray *curpos, Recno *recnum) { return (_amwrite(&fab->isfhandle, record, reclen, curpos, recnum, &fab->errcode)); diff --git a/cde/lib/tt/mini_isam/iswrrec.c b/cde/lib/tt/mini_isam/iswrrec.c index 2844b09f..afaa8985 100644 --- a/cde/lib/tt/mini_isam/iswrrec.c +++ b/cde/lib/tt/mini_isam/iswrrec.c @@ -70,10 +70,7 @@ static int _amwrrec(); */ int -iswrrec(isfd, recnum, record) - int isfd; - long recnum; - char *record; +iswrrec(int isfd, long recnum, char *record) { register Fab *fab; int reclen; @@ -131,12 +128,8 @@ iswrrec(isfd, recnum, record) */ static int -_amwrrec(isfhandle, record, reclen, recnum, errcode) - Bytearray *isfhandle; - char *record; - int reclen; - Recno recnum; - struct errcode *errcode; +_amwrrec(Bytearray *isfhandle, char *record, int reclen, Recno recnum, + struct errcode *errcode) { Fcb *fcb = NULL; int err;