libstand cleanup

Alexey Slynko slynko at tronet.ru
Tue Nov 22 13:13:49 PST 2005


Hi,

1) Ansify function definitions
2) Fix wrong function parameters
3) Add Parameters: comment in some places
4) Add exit() prototype to stand.h (requested by /sys/boot/common/panic.c)
Index: __main.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/__main.c,v
retrieving revision 1.1
diff -u -r1.1 __main.c
--- __main.c	17 Jun 2003 02:51:36 -0000	1.1
+++ __main.c	22 Nov 2005 20:14:40 -0000
@@ -35,6 +35,6 @@
 void __main(void);
 
 void
-__main()
+__main(void)
 {
 }
Index: arp.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/arp.c,v
retrieving revision 1.3
diff -u -r1.3 arp.c
--- arp.c	25 Oct 2004 19:38:45 -0000	1.3
+++ arp.c	22 Nov 2005 20:24:52 -0000
@@ -71,9 +71,7 @@
 
 /* Broadcast an ARP packet, asking who has addr on interface d */
 u_char *
-arpwhohas(d, addr)
-	struct iodesc *d;
-	struct in_addr addr;
+arpwhohas(struct iodesc *d, struct in_addr addr)
 {
 	int i;
 	struct ether_arp *ah;
@@ -149,10 +147,7 @@
 }
 
 static ssize_t
-arpsend(d, pkt, len)
-	struct iodesc *d;
-	void *pkt;
-	size_t len;
+arpsend(struct iodesc *d, void *pkt, size_t len)
 {
 
 #ifdef ARP_DEBUG
@@ -168,11 +163,7 @@
  * else -1 (and errno == 0)
  */
 static ssize_t
-arprecv(d, pkt, len, tleft)
-	struct iodesc *d;
-	void *pkt;
-	size_t len;
-	time_t tleft;
+arprecv(struct iodesc *d, void *pkt, size_t len, time_t tleft)
 {
 	ssize_t n;
 	struct ether_arp *ah;
@@ -256,11 +247,12 @@
 /*
  * Convert an ARP request into a reply and send it.
  * Notes:  Re-uses buffer.  Pad to length = 46.
+ *
+ * Parameters:
+ *	pkt:	the request
  */
 void
-arp_reply(d, pkt)
-	struct iodesc *d;
-	void *pkt;		/* the request */
+arp_reply(struct iodesc *d, void *pkt)
 {
 	struct ether_arp *arp = pkt;
 
Index: bootp.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/bootp.c,v
retrieving revision 1.4
diff -u -r1.4 bootp.c
--- bootp.c	25 Oct 2004 19:38:45 -0000	1.4
+++ bootp.c	22 Nov 2005 20:42:42 -0000
@@ -82,9 +82,7 @@
 
 /* Fetch required bootp infomation */
 void
-bootp(sock, flag)
-	int sock;
-	int flag;
+bootp(int sock, int flag)
 {
 	struct iodesc *d;
 	struct bootp *bp;
@@ -254,10 +252,7 @@
 
 /* Transmit a bootp request */
 static ssize_t
-bootpsend(d, pkt, len)
-	struct iodesc *d;
-	void *pkt;
-	size_t len;
+bootpsend(struct iodesc *d, void *pkt, size_t len)
 {
 	struct bootp *bp;
 
@@ -278,11 +273,7 @@
 }
 
 static ssize_t
-bootprecv(d, pkt, len, tleft)
-struct iodesc *d;
-void *pkt;
-size_t len;
-time_t tleft;
+bootprecv(struct iodesc *d, void *pkt, size_t len, time_t tleft)
 {
 	ssize_t n;
 	struct bootp *bp;
@@ -337,9 +328,7 @@
 }
 
 static int
-vend_rfc1048(cp, len)
-	u_char *cp;
-	u_int len;
+vend_rfc1048(u_char *cp, u_int len)
 {
 	u_char *ep;
 	int size;
@@ -396,8 +385,7 @@
 
 #ifdef BOOTP_VEND_CMU
 static void
-vend_cmu(cp)
-	u_char *cp;
+vend_cmu(u_char *cp)
 {
 	struct cmu_vend *vp;
 
Index: bootparam.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/bootparam.c,v
retrieving revision 1.1
diff -u -r1.1 bootparam.c
--- bootparam.c	17 Jun 2003 02:51:37 -0000	1.1
+++ bootparam.c	22 Nov 2005 20:46:51 -0000
@@ -101,8 +101,7 @@
  * know about us (don't want to broadcast a getport call).
  */
 int
-bp_whoami(sockfd)
-	int sockfd;
+bp_whoami(int sockfd)
 {
 	/* RPC structures for PMAPPROC_CALLIT */
 	struct args {
@@ -230,11 +229,7 @@
  *	server pathname
  */
 int
-bp_getfile(sockfd, key, serv_addr, pathname)
-	int sockfd;
-	char *key;
-	char *pathname;
-	struct in_addr *serv_addr;
+bp_getfile(int sockfd, char *key, struct in_addr *serv_addr, char *pathname)
 {
 	struct {
 		n_long	h[RPC_HEADER_WORDS];
@@ -326,10 +321,7 @@
 
 
 int
-xdr_string_encode(pkt, str, len)
-	char **pkt;
-	char *str;
-	int len;
+xdr_string_encode(char **pkt, char *str, int len)
 {
 	u_int32_t *lenp;
 	char *datap;
@@ -347,11 +339,12 @@
 	return (0);
 }
 
+/*
+ * Parameters:
+ *	len_p:	bufsize - 1
+ */
 int
-xdr_string_decode(pkt, str, len_p)
-	char **pkt;
-	char *str;
-	int *len_p;		/* bufsize - 1 */
+xdr_string_decode(char **pkt, char *str, int *len_p)
 {
 	u_int32_t *lenp;
 	char *datap;
@@ -376,11 +369,12 @@
 	return (0);
 }
 
-
+/*
+ * Parameters:
+ *	ia:	network order
+ */
 int
-xdr_inaddr_encode(pkt, ia)
-	char **pkt;
-	struct in_addr ia;		/* network order */
+xdr_inaddr_encode(char **pkt, struct in_addr ia)
 {
 	struct xdr_inaddr *xi;
 	u_char *cp;
@@ -410,10 +404,12 @@
 	return (0);
 }
 
+/*
+ * Parameters:
+ *	ia:	network order
+ */
 int
-xdr_inaddr_decode(pkt, ia)
-	char **pkt;
-	struct in_addr *ia;		/* network order */
+xdr_inaddr_decode(char **pkt, struct in_addr *ia)
 {
 	struct xdr_inaddr *xi;
 	u_char *cp;
Index: bswap.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/bswap.c,v
retrieving revision 1.2
diff -u -r1.2 bswap.c
--- bswap.c	17 Jun 2003 04:26:51 -0000	1.2
+++ bswap.c	22 Nov 2005 20:15:05 -0000
@@ -12,8 +12,7 @@
 #undef bswap64
 
 u_int32_t
-bswap32(x)
-    u_int32_t x;
+bswap32(u_int32_t x)
 {
 	return  ((x << 24) & 0xff000000 ) |
 			((x <<  8) & 0x00ff0000 ) |
@@ -22,8 +21,7 @@
 }
 
 u_int64_t
-bswap64(x)
-    u_int64_t x;
+bswap64(u_int64_t x)
 {  
 	u_int32_t *p = (u_int32_t*)&x;
 	u_int32_t t;
@@ -32,4 +30,3 @@
 	p[1] = t;
 	return x;
 }   
-
Index: cd9660.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/cd9660.c,v
retrieving revision 1.5
diff -u -r1.5 cd9660.c
--- cd9660.c	27 Aug 2005 20:23:05 -0000	1.5
+++ cd9660.c	22 Nov 2005 20:56:19 -0000
@@ -119,15 +119,13 @@
 
 /* XXX these should be in the system headers */
 static __inline int
-isonum_722(p)
-	u_char *p;
+isonum_722(u_char *p)
 {
 	return (*p << 8)|p[1];
 }
 
 static __inline int
-isonum_732(p)
-	u_char *p;
+isonum_732(u_char *p)
 {
 	return (*p << 24)|(p[1] << 16)|(p[2] << 8)|p[3];
 }
Index: closeall.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/closeall.c,v
retrieving revision 1.1
diff -u -r1.1 closeall.c
--- closeall.c	17 Jun 2003 02:51:37 -0000	1.1
+++ closeall.c	22 Nov 2005 20:19:57 -0000
@@ -67,7 +67,7 @@
 #include "stand.h"
 
 void
-closeall()
+closeall(void)
 {
 	int i;
 
Index: dev.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/dev.c,v
retrieving revision 1.1
diff -u -r1.1 dev.c
--- dev.c	17 Jun 2003 02:51:37 -0000	1.1
+++ dev.c	22 Nov 2005 20:20:35 -0000
@@ -41,22 +41,19 @@
 #include "stand.h"
 
 int
-nodev()
+nodev(void)
 {
 	return (ENXIO);
 }
 
 void
-nullsys()
+nullsys(void)
 {
 }
 
 /* ARGSUSED */
 int
-noioctl(f, cmd, data)
-	struct open_file *f;
-	u_long cmd;
-	void *data;
+noioctl(struct open_file *f, u_long cmd, void *data)
 {
 	return (EINVAL);
 }
Index: ether.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/ether.c,v
retrieving revision 1.2
diff -u -r1.2 ether.c
--- ether.c	25 Oct 2004 19:38:45 -0000	1.2
+++ ether.c	22 Nov 2005 20:26:22 -0000
@@ -56,12 +56,7 @@
 
 /* Caller must leave room for ethernet header in front!! */
 ssize_t
-sendether(d, pkt, len, dea, etype)
-	struct iodesc *d;
-	void *pkt;
-	size_t len;
-	u_char *dea;
-	int etype;
+sendether(struct iodesc *d, void *pkt, size_t len, u_char *dea, int etype)
 {
 	ssize_t n;
 	struct ether_header *eh;
@@ -92,12 +87,8 @@
  * NOTE: Caller must leave room for the Ether header.
  */
 ssize_t
-readether(d, pkt, len, tleft, etype)
-	struct iodesc *d;
-	void *pkt;
-	size_t len;
-	time_t tleft;
-	u_int16_t *etype;
+readether(struct iodesc *d, void *pkt, size_t len, time_t tleft,
+	  u_int16_t *etype)
 {
 	ssize_t n;
 	struct ether_header *eh;
@@ -135,8 +126,7 @@
  */
 static char digits[] = "0123456789abcdef";
 char *
-ether_sprintf(ap)
-        u_char *ap;
+ether_sprintf(u_char *ap)
 {
 	int i;
 	static char etherbuf[18];
Index: fstat.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/fstat.c,v
retrieving revision 1.2
diff -u -r1.2 fstat.c
--- fstat.c	25 Oct 2004 19:38:45 -0000	1.2
+++ fstat.c	22 Nov 2005 20:21:55 -0000
@@ -39,9 +39,7 @@
 #include "stand.h"
 
 int
-fstat(fd, sb)
-	int fd;
-	struct stat *sb;
+fstat(int fd, struct stat *sb)
 {
 	struct open_file *f = &files[fd];
 
Index: getopt.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/getopt.c,v
retrieving revision 1.2
diff -u -r1.2 getopt.c
--- getopt.c	17 Jun 2003 04:26:51 -0000	1.2
+++ getopt.c	22 Nov 2005 20:15:53 -0000
@@ -51,10 +51,7 @@
  *	Parse argc/argv argument vector.
  */
 int
-getopt(nargc, nargv, ostr)
-	int nargc;
-	char * const *nargv;
-	const char *ostr;
+getopt(int nargc, char * const *nargv, const char *ostr)
 {
 	static char *place = EMSG;		/* option letter processing */
 	char *oli;				/* option letter list index */
Index: in_cksum.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/in_cksum.c,v
retrieving revision 1.2
diff -u -r1.2 in_cksum.c
--- in_cksum.c	17 Jun 2003 04:26:51 -0000	1.2
+++ in_cksum.c	22 Nov 2005 20:31:04 -0000
@@ -53,9 +53,7 @@
  * In particular, it should not be this one.
  */
 int
-in_cksum(p, len)
-	void *p;
-	int len;
+in_cksum(void *p, int len)
 {
 	int sum = 0, oddbyte = 0, v = 0;
 	u_char *cp = p;
Index: inet_ntoa.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/inet_ntoa.c,v
retrieving revision 1.2
diff -u -r1.2 inet_ntoa.c
--- inet_ntoa.c	17 Jun 2003 04:26:51 -0000	1.2
+++ inet_ntoa.c	22 Nov 2005 20:26:42 -0000
@@ -44,8 +44,7 @@
  * to base 256 d.d.d.d representation.
  */
 char *
-inet_ntoa(in)
-	struct in_addr in;
+inet_ntoa(struct in_addr in)
 {
 	static const char fmt[] = "%u.%u.%u.%u";
 	static char ret[sizeof "255.255.255.255"];
Index: ioctl.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/ioctl.c,v
retrieving revision 1.2
diff -u -r1.2 ioctl.c
--- ioctl.c	25 Oct 2004 19:38:45 -0000	1.2
+++ ioctl.c	22 Nov 2005 20:21:06 -0000
@@ -68,10 +68,7 @@
 #include "stand.h"
 
 int
-ioctl(fd, cmd, arg)
-	int fd;
-	u_long cmd;
-	char *arg;
+ioctl(int fd, u_long cmd, char *arg)
 {
 	struct open_file *f = &files[fd];
 
Index: net.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/net.c,v
retrieving revision 1.4
diff -u -r1.4 net.c
--- net.c	25 Oct 2004 19:38:45 -0000	1.4
+++ net.c	22 Nov 2005 20:33:18 -0000
@@ -71,14 +71,10 @@
  * zero errno to indicate it isn't done yet.
  */
 ssize_t
-sendrecv(d, sproc, sbuf, ssize, rproc, rbuf, rsize)
-	struct iodesc *d;
-	ssize_t (*sproc)(struct iodesc *, void *, size_t);
-	void *sbuf;
-	size_t ssize;
-	ssize_t (*rproc)(struct iodesc *, void *, size_t, time_t);
-	void *rbuf;
-	size_t rsize;
+sendrecv(struct iodesc *d, ssize_t (*sproc)(struct iodesc *, void *, size_t),
+	 void *sbuf, size_t ssize,
+	 ssize_t (*rproc)(struct iodesc *, void *, size_t, time_t), void *rbuf,
+	 size_t rsize)
 {
 	ssize_t cc;
 	time_t t, tmo, tlast;
@@ -136,8 +132,7 @@
  * Return values are in network order.
  */
 n_long
-inet_addr(cp)
-	char *cp;
+inet_addr(char *cp)
 {
 	u_long val;
 	int n;
@@ -214,16 +209,14 @@
 }
 
 char *
-inet_ntoa(ia)
-	struct in_addr ia;
+inet_ntoa(struct in_addr ia)
 {
 	return (intoa(ia.s_addr));
 }
 
 /* Similar to inet_ntoa() */
 char *
-intoa(addr)
-	n_long addr;
+intoa(n_long addr)
 {
 	char *cp;
 	u_int byte;
@@ -253,9 +246,7 @@
 }
 
 static char *
-number(s, n)
-	char *s;
-	int *n;
+number(char *s, int *n)
 {
 	for (*n = 0; isdigit(*s); s++)
 		*n = (*n * 10) + *s - '0';
@@ -263,8 +254,7 @@
 }
 
 n_long
-ip_convertaddr(p)
-	char *p;
+ip_convertaddr(char *p)
 {
 #define IP_ANYADDR	0
 	n_long addr = 0, n;
Index: netif.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/netif.c,v
retrieving revision 1.2
diff -u -r1.2 netif.c
--- netif.c	25 Oct 2004 19:38:45 -0000	1.2
+++ netif.c	22 Nov 2005 20:36:30 -0000
@@ -57,7 +57,7 @@
  */
 
 void
-netif_init()
+netif_init(void)
 {
 	struct netif_driver *drv;
 	int d, i;
@@ -74,9 +74,7 @@
 }
 
 int
-netif_match(nif, machdep_hint)
-	struct netif *nif;
-	void *machdep_hint;
+netif_match(struct netif *nif, void *machdep_hint)
 {
 	struct netif_driver *drv = nif->nif_driver;
 
@@ -89,8 +87,7 @@
 }
 
 struct netif *
-netif_select(machdep_hint)
-	void *machdep_hint;
+netif_select(void *machdep_hint)
 {
 	int d, u, unit_done, s;
 	struct netif_driver *drv;
@@ -160,9 +157,7 @@
 }
 
 int
-netif_probe(nif, machdep_hint)
-	struct netif *nif;
-	void *machdep_hint;
+netif_probe(struct netif *nif, void *machdep_hint)
 {
 	struct netif_driver *drv = nif->nif_driver;
 
@@ -174,10 +169,7 @@
 }
 
 void
-netif_attach(nif, desc, machdep_hint)
-	struct netif *nif;
-	struct iodesc *desc;
-	void *machdep_hint;
+netif_attach(struct netif *nif, struct iodesc *desc, void *machdep_hint)
 {
 	struct netif_driver *drv = nif->nif_driver;
 
@@ -197,8 +189,7 @@
 }
 
 void
-netif_detach(nif)
-	struct netif *nif;
+netif_detach(struct netif *nif)
 {
 	struct netif_driver *drv = nif->nif_driver;
 
@@ -215,11 +206,7 @@
 }
 
 ssize_t
-netif_get(desc, pkt, len, timo)
-	struct iodesc *desc;
-	void *pkt;
-	size_t len;
-	time_t timo;
+netif_get(struct iodesc *desc, void *pkt, size_t len, time_t timo)
 {
 #ifdef NETIF_DEBUG
 	struct netif *nif = desc->io_netif;
@@ -246,10 +233,7 @@
 }
 
 ssize_t
-netif_put(desc, pkt, len)
-	struct iodesc *desc;
-	void *pkt;
-	size_t len;
+netif_put(struct iodesc *desc, void *pkt, size_t len)
 {
 #ifdef NETIF_DEBUG
 	struct netif *nif = desc->io_netif;
@@ -276,8 +260,7 @@
 }
 
 struct iodesc *
-socktodesc(sock)
-	int sock;
+socktodesc(int sock)
 {
 	if (sock >= SOPEN_MAX) {
 		errno = EBADF;
@@ -287,8 +270,7 @@
 }
 
 int
-netif_open(machdep_hint)
-	void *machdep_hint;
+netif_open(void *machdep_hint)
 {
 	int fd;
 	struct iodesc *s;
@@ -319,8 +301,7 @@
 }
 
 int
-netif_close(sock)
-	int sock;
+netif_close(int sock)
 {
 	if (sock >= SOPEN_MAX) {
 		errno = EBADF;
Index: nfs.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/nfs.c,v
retrieving revision 1.3
diff -u -r1.3 nfs.c
--- nfs.c	25 Oct 2004 19:38:45 -0000	1.3
+++ nfs.c	22 Nov 2005 20:55:41 -0000
@@ -146,10 +146,7 @@
  * Return zero or error number.
  */
 int
-nfs_getrootfh(d, path, fhp)
-	struct iodesc *d;
-	char *path;
-	u_char *fhp;
+nfs_getrootfh(struct iodesc *d, char *path, u_char *fhp)
 {
 	int len;
 	struct args {
@@ -205,10 +202,7 @@
  * Return zero or error number.
  */
 int
-nfs_lookupfh(d, name, newfd)
-	struct nfs_iodesc *d;
-	const char *name;
-	struct nfs_iodesc *newfd;
+nfs_lookupfh(struct nfs_iodesc *d, const char *name, struct nfs_iodesc *newfd)
 {
 	int len, rlen;
 	struct args {
@@ -271,9 +265,7 @@
  * Get the destination of a symbolic link.
  */
 int
-nfs_readlink(d, buf)
-	struct nfs_iodesc *d;
-	char *buf;
+nfs_readlink(struct nfs_iodesc *d, char *buf)
 {
 	struct {
 		n_long	h[RPC_HEADER_WORDS];
@@ -318,11 +310,7 @@
  * Return transfer count or -1 (and set errno)
  */
 ssize_t
-nfs_readdata(d, off, addr, len)
-	struct nfs_iodesc *d;
-	off_t off;
-	void *addr;
-	size_t len;
+nfs_readdata(struct nfs_iodesc *d, off_t off, void *addr, size_t len)
 {
 	struct nfs_read_args *args;
 	struct nfs_read_repl *repl;
@@ -380,9 +368,7 @@
  * return zero or error number
  */
 int
-nfs_open(upath, f)
-	const char *upath;
-	struct open_file *f;
+nfs_open(const char *upath, struct open_file *f)
 {
 	struct iodesc *desc;
 	struct nfs_iodesc *currfd;
@@ -556,8 +542,7 @@
 }
 
 int
-nfs_close(f)
-	struct open_file *f;
+nfs_close(struct open_file *f)
 {
 	struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
 
@@ -575,13 +560,12 @@
 
 /*
  * read a portion of a file
+ *
+ * Parameters:
+ *	resid:	out
  */
 int
-nfs_read(f, buf, size, resid)
-	struct open_file *f;
-	void *buf;
-	size_t size;
-	size_t *resid;	/* out */
+nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid)
 {
 	struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
 	ssize_t cc;
@@ -623,22 +607,18 @@
 
 /*
  * Not implemented.
+ *
+ * Parameters:
+ *	resid:	out
  */
 int
-nfs_write(f, buf, size, resid)
-	struct open_file *f;
-	void *buf;
-	size_t size;
-	size_t *resid;	/* out */
+nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid)
 {
 	return (EROFS);
 }
 
 off_t
-nfs_seek(f, offset, where)
-	struct open_file *f;
-	off_t offset;
-	int where;
+nfs_seek(struct open_file *f, off_t offset, int where)
 {
 	struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata;
 	n_long size = ntohl(d->fa.fa_size);
@@ -665,9 +645,7 @@
 	0, S_IFREG, S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK, 0 };
 
 int
-nfs_stat(f, sb)
-	struct open_file *f;
-	struct stat *sb;
+nfs_stat(struct open_file *f, struct stat *sb)
 {
 	struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
 	n_long ftype, mode;
Index: printf.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/printf.c,v
retrieving revision 1.5
diff -u -r1.5 printf.c
--- printf.c	18 Apr 2005 07:55:09 -0000	1.5
+++ printf.c	22 Nov 2005 20:16:24 -0000
@@ -155,9 +155,7 @@
  * buffer.
  */
 static char *
-ksprintn(ul, base, lenp)
-	u_long ul;
-	int base, *lenp;
+ksprintn(u_long ul, int base, int *lenp)
 {					/* A long in base 8, plus NULL. */
 	static char buf[sizeof(long) * NBBY / 3 + 2];
 	char *p;
Index: qdivrem.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/qdivrem.c,v
retrieving revision 1.3
diff -u -r1.3 qdivrem.c
--- qdivrem.c	25 Oct 2004 19:38:45 -0000	1.3
+++ qdivrem.c	22 Nov 2005 20:19:26 -0000
@@ -82,8 +82,7 @@
  * leading zeros).
  */
 u_quad_t
-__qdivrem(uq, vq, arq)
-	u_quad_t uq, vq, *arq;
+__qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq)
 {
 	union uu tmp;
 	digit *u, *v, *q;
@@ -283,8 +282,7 @@
  */
 
 u_quad_t
-__udivdi3(a, b)
-	u_quad_t a, b;
+__udivdi3(u_quad_t a, u_quad_t b)
 {
 
 	return (__qdivrem(a, b, (u_quad_t *)0));
@@ -294,8 +292,7 @@
  * Return remainder after dividing two unsigned quads.
  */
 u_quad_t
-__umoddi3(a, b)
-	u_quad_t a, b;
+__umoddi3(u_quad_t a, u_quad_t b)
 {
 	u_quad_t r;
 
Index: random.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/random.c,v
retrieving revision 1.3
diff -u -r1.3 random.c
--- random.c	25 Oct 2004 19:38:45 -0000	1.3
+++ random.c	22 Nov 2005 20:17:36 -0000
@@ -40,8 +40,7 @@
 static u_long randseed = 1;
 
 void
-srandom(seed)
-	u_long seed;
+srandom(u_long seed)
 {
 	randseed = seed;
 }
@@ -52,7 +51,7 @@
  * [0, 2^31 - 1].
  */
 u_long
-random()
+random(void)
 {
 	long x, hi, lo, t;
 
Index: rarp.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/rarp.c,v
retrieving revision 1.2
diff -u -r1.2 rarp.c
--- rarp.c	25 Oct 2004 19:38:45 -0000	1.2
+++ rarp.c	22 Nov 2005 20:43:42 -0000
@@ -61,8 +61,7 @@
  * Ethernet (Reverse) Address Resolution Protocol (see RFC 903, and 826).
  */
 int
-rarp_getipaddress(sock)
-	int sock;
+rarp_getipaddress(int sock)
 {
 	struct iodesc *d;
 	struct ether_arp *ap;
@@ -135,10 +134,7 @@
  * Broadcast a RARP request (i.e. who knows who I am)
  */
 static ssize_t
-rarpsend(d, pkt, len)
-	struct iodesc *d;
-	void *pkt;
-	size_t len;
+rarpsend(struct iodesc *d, void *pkt, size_t len)
 {
 
 #ifdef RARP_DEBUG
@@ -154,11 +150,7 @@
  * else -1 (and errno == 0)
  */
 static ssize_t
-rarprecv(d, pkt, len, tleft)
-	struct iodesc *d;
-	void *pkt;
-	size_t len;
-	time_t tleft;
+rarprecv(struct iodesc *d, void *pkt, size_t len, time_t tleft)
 {
 	ssize_t n;
 	struct ether_arp *ap;
Index: rpc.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/rpc.c,v
retrieving revision 1.2
diff -u -r1.2 rpc.c
--- rpc.c	25 Oct 2004 19:38:45 -0000	1.2
+++ rpc.c	22 Nov 2005 20:41:11 -0000
@@ -110,13 +110,8 @@
  * Note: Caller must leave room for headers.
  */
 ssize_t
-rpc_call(d, prog, vers, proc, sdata, slen, rdata, rlen)
-	n_long prog, vers, proc;
-	void *sdata;
-	size_t slen;
-	void *rdata;
-	size_t rlen;
+rpc_call(struct iodesc *d, n_long prog, n_long vers, n_long proc, void *sdata,
+	 size_t slen, void *rdata, size_t rlen)
 {
 	ssize_t cc;
 	struct auth_info *auth;
@@ -234,11 +229,7 @@
  * Remaining checks are done by callrpc
  */
 static ssize_t
-recvrpc(d, pkt, len, tleft)
-	struct iodesc *d;
-	void *pkt;
-	size_t len;
-	time_t tleft;
+recvrpc(struct iodesc *d, void *pkt, size_t len, time_t tleft)
 {
 	struct rpc_reply *reply;
 	ssize_t	n;
@@ -290,10 +281,7 @@
  * dig out the IP address/port from the headers.
  */
 void
-rpc_fromaddr(pkt, addr, port)
-	void		*pkt;
-	struct in_addr	*addr;
-	u_short		*port;
+rpc_fromaddr(void *pkt, struct in_addr *addr, u_short *port)
 {
 	struct hackhdr {
 		/* Tail of IP header: just IP addresses */
@@ -326,12 +314,16 @@
 	int 	port;		/* host order */
 } rpc_pmap_list[PMAP_NUM];
 
-/* return port number in host order, or -1 */
+/* 
+ * return port number in host order, or -1 
+ *
+ * Parameters:
+ *	addr:	server, net order
+ *	prog:	host order
+ *	vers:	host order
+ */
 int
-rpc_pmap_getcache(addr, prog, vers)
-	struct in_addr	addr;	/* server, net order */
-	u_int		prog;	/* host order */
-	u_int		vers;	/* host order */
+rpc_pmap_getcache(struct in_addr addr, u_int prog, u_int vers)
 {
 	struct pmap_list *pl;
 
@@ -345,12 +337,15 @@
 	return (-1);
 }
 
+/*
+ * Parameters:
+ *	addr:	server, net order
+ *	prog:	host order
+ *	vers:	host order
+ *	port:	host order
+ */
 void
-rpc_pmap_putcache(addr, prog, vers, port)
-	struct in_addr	addr;	/* server, net order */
-	u_int		prog;	/* host order */
-	u_int		vers;	/* host order */
-	int 		port;	/* host order */
+rpc_pmap_putcache(struct in_addr addr, u_int prog, u_int vers, int port)
 {
 	struct pmap_list *pl;
 
@@ -377,12 +372,13 @@
 /*
  * Request a port number from the port mapper.
  * Returns the port in host order.
+ *
+ * Parameters:
+ *	prog:	host order
+ *	vers:	host order
  */
 int
-rpc_getport(d, prog, vers)
-	struct iodesc *d;
-	n_long prog;	/* host order */
-	n_long vers;	/* host order */
+rpc_getport(struct iodesc *d, n_long prog, n_long vers)
 {
 	struct args {
 		n_long	prog;		/* call program */
Index: stand.h
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/stand.h,v
retrieving revision 1.7
diff -u -r1.7 stand.h
--- stand.h	18 Apr 2005 07:55:09 -0000	1.7
+++ stand.h	22 Nov 2005 20:12:13 -0000
@@ -107,15 +107,15 @@
  */
 struct fs_ops {
     const char	*fs_name;
-    int		(*fo_open)(const char *path, struct open_file *f);
-    int		(*fo_close)(struct open_file *f);
-    int		(*fo_read)(struct open_file *f, void *buf,
-			   size_t size, size_t *resid);
-    int		(*fo_write)(struct open_file *f, void *buf,
-			    size_t size, size_t *resid);
-    off_t	(*fo_seek)(struct open_file *f, off_t offset, int where);
-    int		(*fo_stat)(struct open_file *f, struct stat *sb);
-    int		(*fo_readdir)(struct open_file *f, struct dirent *d);
+    int		(*fo_open)(const char *, struct open_file *);
+    int		(*fo_close)(struct open_file *);
+    int		(*fo_read)(struct open_file *, void *,
+			   size_t, size_t *);
+    int		(*fo_write)(struct open_file *, void *,
+			    size_t, size_t *);
+    off_t	(*fo_seek)(struct open_file *, off_t, int);
+    int		(*fo_stat)(struct open_file *, struct stat *);
+    int		(*fo_readdir)(struct open_file *, struct dirent *);
 };
 
 /*
@@ -144,12 +144,11 @@
     const char	dv_name[8];
     int		dv_type;		/* opaque type constant, arch-dependant */
     int		(*dv_init)(void);	/* early probe call */
-    int		(*dv_strategy)(void *devdata, int rw, daddr_t blk, size_t size,
-			       char *buf, size_t *rsize);
-    int		(*dv_open)(struct open_file *f, ...);
-    int		(*dv_close)(struct open_file *f);
-    int		(*dv_ioctl)(struct open_file *f, u_long cmd, void *data);
-    void	(*dv_print)(int verbose);	/* print device information */
+    int		(*dv_strategy)(void *, int, daddr_t, size_t, char *, size_t *);
+    int		(*dv_open)(struct open_file *, ...);
+    int		(*dv_close)(struct open_file *);
+    int		(*dv_ioctl)(struct open_file *, u_long, void *);
+    void	(*dv_print)(int);	/* print device information */
     void	(*dv_cleanup)(void);
 };
 
@@ -184,80 +183,89 @@
 
 #define isascii(c)	(((c) & ~0x7F) == 0)
 
-static __inline int isupper(int c)
+static __inline int
+isupper(int c)
 {
     return c >= 'A' && c <= 'Z';
 }
 
-static __inline int islower(int c)
+static __inline int
+islower(int c)
 {
     return c >= 'a' && c <= 'z';
 }
 
-static __inline int isspace(int c)
+static __inline int
+isspace(int c)
 {
     return c == ' ' || (c >= 0x9 && c <= 0xd);
 }
 
-static __inline int isdigit(int c)
+static __inline int
+isdigit(int c)
 {
     return c >= '0' && c <= '9';
 }
 
-static __inline int isxdigit(int c)
+static __inline int
+isxdigit(int c)
 {
     return isdigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
 }
 
-static __inline int isalpha(int c)
+static __inline int
+isalpha(int c)
 {
     return isupper(c) || islower(c);
 }
 
-static __inline int isalnum(int c)
+static __inline int
+isalnum(int c)
 {
     return isalpha(c) || isdigit(c);
 }
 
-static __inline int toupper(int c)
+static __inline int
+toupper(int c)
 {
     return islower(c) ? c - 'a' + 'A' : c;
 }
 
-static __inline int tolower(int c)
+static __inline int
+tolower(int c)
 {
     return isupper(c) ? c - 'A' + 'a' : c;
 }
 
 /* sbrk emulation */
-extern void	setheap(void *base, void *top);
-extern char	*sbrk(int incr);
+extern void	setheap(void *, void *);
+extern char	*sbrk(int);
 
 /* Matt Dillon's zalloc/zmalloc */
-extern void	*malloc(size_t bytes);
-extern void	free(void *ptr);
+extern void	*malloc(size_t);
+extern void	free(void *);
 /*#define free(p)	{CHK("free %p", p); free(p);} */ /* use for catching guard violations */
-extern void	*calloc(size_t n1, size_t n2);
-extern void	*realloc(void *ptr, size_t size);
-extern void	*reallocf(void *ptr, size_t size);
+extern void	*calloc(size_t, size_t);
+extern void	*realloc(void *, size_t);
+extern void	*reallocf(void *, size_t);
 extern void	mallocstats(void);
 
 /* disklabel support (undocumented, may be junk) */
 struct		disklabel;
 extern char	*getdisklabel(const char *, struct disklabel *);
 
-extern int	printf(const char *fmt, ...);
-extern void	vprintf(const char *fmt, __va_list va);
-extern int	sprintf(char *buf, const char *cfmt, ...);
-extern void	vsprintf(char *buf, const char *cfmt, __va_list va);
-int	snprintf(char *, size_t, const char *, ...);
-int	vsnprintf(char *, size_t, const char *, __va_list);
+extern int	printf(const char *, ...);
+extern void	vprintf(const char *, __va_list);
+extern int	sprintf(char *, const char *, ...);
+extern void	vsprintf(char *, const char *, __va_list);
+int		snprintf(char *, size_t, const char *, ...);
+int		vsnprintf(char *, size_t, const char *, __va_list);
 
 extern void	twiddle(void);
 
 extern void	ngets(char *, int);
 #define gets(x)	ngets((x), 0)
-extern int	fgetstr(char *buf, int size, int fd);
+extern int	fgetstr(char *, int, int);
 
 extern int	open(const char *, int);
 #define	O_RDONLY	0x0
@@ -269,8 +277,10 @@
 extern ssize_t	write(int, void *, size_t);
 extern struct	dirent *readdirfd(int);
 
-extern void	srandom(u_long seed);
+extern void	srandom(u_long);
 extern u_long	random(void);
+
+extern void	exit(int);
     
 /* imports from stdlib, locally modified */
 extern long	strtol(const char *, char **, int);
@@ -281,8 +291,8 @@
 /* pager.c */
 extern void	pager_open(void);
 extern void	pager_close(void);
-extern int	pager_output(const char *lines);
-extern int	pager_file(const char *fname);
+extern int	pager_output(const char *);
+extern int	pager_file(const char *);
 
 /* No signal state to preserve */
 #define setjmp	_setjmp
@@ -294,9 +304,9 @@
 #define EV_NOHOOK	(1<<2)		/* don't call hook when setting */
 
 struct env_var;
-typedef char	*(ev_format_t)(struct env_var *ev);
-typedef int	(ev_sethook_t)(struct env_var *ev, int flags, void *value);
-typedef int	(ev_unsethook_t)(struct env_var *ev);
+typedef char	*(ev_format_t)(struct env_var *);
+typedef int	(ev_sethook_t)(struct env_var *, int, void *);
+typedef int	(ev_unsethook_t)(struct env_var *);
 
 struct env_var
 {
@@ -309,15 +319,13 @@
 };
 extern struct env_var	*environ;
 
-extern struct env_var	*env_getenv(const char *name);
-extern int		env_setenv(const char *name, int flags,
-				   const void *value, ev_sethook_t sethook,
-				   ev_unsethook_t unsethook);
-extern char		*getenv(const char *name);
-extern int		setenv(const char *name, const char *value,
-			       int overwrite);
-extern int		putenv(const char *string);
-extern int		unsetenv(const char *name);
+extern struct env_var	*env_getenv(const char *);
+extern int		env_setenv(const char *, int, const void *, ev_sethook_t,
+				   ev_unsethook_t);
+extern char		*getenv(const char *);
+extern int		setenv(const char *, const char *, int);
+extern int		putenv(const char *);
+extern int		unsetenv(const char *);
 
 extern ev_sethook_t	env_noset;		/* refuse set operation */
 extern ev_unsethook_t	env_nounset;		/* refuse unset operation */
@@ -345,8 +353,8 @@
 
 /* swaps (undocumented, useful?) */
 #ifdef __i386__
-extern u_int32_t	bswap32(u_int32_t x);
-extern u_int64_t	bswap64(u_int64_t x);
+extern u_int32_t	bswap32(u_int32_t);
+extern u_int64_t	bswap64(u_int64_t);
 #endif
 
 /* null functions for device/filesystem switches (undocumented) */
@@ -354,13 +362,13 @@
 extern int	noioctl(struct open_file *, u_long, void *);
 extern void	nullsys(void);
 
-extern int	null_open(const char *path, struct open_file *f);
-extern int	null_close(struct open_file *f);
-extern int	null_read(struct open_file *f, void *buf, size_t size, size_t *resid);
-extern int	null_write(struct open_file *f, void *buf, size_t size, size_t *resid);
-extern off_t	null_seek(struct open_file *f, off_t offset, int where);
-extern int	null_stat(struct open_file *f, struct stat *sb);
-extern int	null_readdir(struct open_file *f, struct dirent *d);
+extern int	null_open(const char *, struct open_file *);
+extern int	null_close(struct open_file *);
+extern int	null_read(struct open_file *, void *, size_t, size_t *);
+extern int	null_write(struct open_file *, void *, size_t, size_t *);
+extern off_t	null_seek(struct open_file *, off_t, int);
+extern int	null_stat(struct open_file *, struct stat *);
+extern int	null_readdir(struct open_file *, struct dirent *);
 
 
 /* 
@@ -371,7 +379,7 @@
 extern int		ischar(void);
 extern void		putchar(int);
 extern int		devopen(struct open_file *, const char *, const char **);
-extern int		devclose(struct open_file *f);
+extern int		devclose(struct open_file *);
 extern void		panic(const char *, ...) __dead2;
 extern struct fs_ops	*file_system[];
 extern struct devsw	*devsw[];
Index: stat.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/stat.c,v
retrieving revision 1.1
diff -u -r1.1 stat.c
--- stat.c	17 Jun 2003 02:51:39 -0000	1.1
+++ stat.c	22 Nov 2005 20:21:33 -0000
@@ -38,9 +38,7 @@
 #include "stand.h"
 
 int
-stat(str, sb)
-	const char *str;
-	struct stat *sb;
+stat(const char *str, struct stat *sb)
 {
 	int fd, rv;
 
Index: strcasecmp.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/strcasecmp.c,v
retrieving revision 1.3
diff -u -r1.3 strcasecmp.c
--- strcasecmp.c	25 Oct 2004 19:38:45 -0000	1.3
+++ strcasecmp.c	22 Nov 2005 20:18:41 -0000
@@ -39,8 +39,7 @@
 #include "stand.h"
 
 int
-strcasecmp(s1, s2)
-	const char *s1, *s2;
+strcasecmp(const char *s1, const char *s2)
 {
 	const u_char
 			*us1 = (const u_char *)s1,
@@ -53,9 +52,7 @@
 }
 
 int
-strncasecmp(s1, s2, n)
-	const char *s1, *s2;
-	size_t n;
+strncasecmp(const char *s1, const char *s2, size_t n)
 {
 	if (n != 0) {
 		const u_char
Index: strdup.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/strdup.c,v
retrieving revision 1.2
diff -u -r1.2 strdup.c
--- strdup.c	17 Jun 2003 04:26:51 -0000	1.2
+++ strdup.c	22 Nov 2005 20:16:43 -0000
@@ -38,8 +38,7 @@
 #include <string.h>
 
 char *
-strdup(str)
-	const char *str;
+strdup(const char *str)
 {
 	size_t len;
 	char *copy = NULL;
Index: strtol.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/strtol.c,v
retrieving revision 1.3
diff -u -r1.3 strtol.c
--- strtol.c	25 Oct 2004 19:38:45 -0000	1.3
+++ strtol.c	22 Nov 2005 20:17:10 -0000
@@ -44,10 +44,7 @@
  * alphabets and digits are each contiguous.
  */
 long
-strtol(nptr, endptr, base)
-	const char *nptr;
-	char **endptr;
-	int base;
+strtol(const char *nptr, char **endptr, int base)
 {
 	const char *s;
 	unsigned long acc;
Index: tftp.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/tftp.c,v
retrieving revision 1.4
diff -u -r1.4 tftp.c
--- tftp.c	25 Oct 2004 19:38:45 -0000	1.4
+++ tftp.c	22 Nov 2005 21:07:05 -0000
@@ -110,11 +110,7 @@
 };
 
 static ssize_t 
-recvtftp(d, pkt, len, tleft)
-	struct iodesc *d;
-	void  *pkt;
-	ssize_t len;
-	time_t          tleft;
+recvtftp(struct iodesc *d, void *pkt, size_t len, time_t tleft)
 {
 	struct tftphdr *t;
 
@@ -168,8 +164,7 @@
 
 /* send request, expect first block (or error) */
 static int 
-tftp_makereq(h)
-	struct tftp_handle *h;
+tftp_makereq(struct tftp_handle *h)
 {
 	struct {
 		u_char header[HEADER_SIZE];
@@ -212,8 +207,7 @@
 
 /* ack block, expect next */
 static int 
-tftp_getnextblock(h)
-	struct tftp_handle *h;
+tftp_getnextblock(struct tftp_handle *h)
 {
 	struct {
 		u_char header[HEADER_SIZE];
@@ -246,9 +240,7 @@
 }
 
 static int 
-tftp_open(path, f)
-	const char *path;
-	struct open_file *f;
+tftp_open(const char *path, struct open_file *f)
 {
 	struct tftp_handle *tftpfile;
 	struct iodesc  *io;
@@ -270,7 +262,7 @@
 	    return(ENOMEM);
 	}
 
-	res = tftp_makereq(tftpfile, path);
+	res = tftp_makereq(tftpfile);
 
 	if (res) {
 		free(tftpfile->path);
@@ -281,12 +273,12 @@
 	return (0);
 }
 
+/*
+ * Parameters:
+ *	resid:	out
+ */
 static int 
-tftp_read(f, addr, size, resid)
-	struct open_file *f;
-	void           *addr;
-	size_t          size;
-	size_t         *resid;	/* out */
+tftp_read(struct open_file *f, void *addr, size_t size, size_t *resid)
 {
 	struct tftp_handle *tftpfile;
 	static int      tc = 0;
@@ -356,8 +348,7 @@
 }
 
 static int 
-tftp_close(f)
-	struct open_file *f;
+tftp_close(struct open_file *f)
 {
 	struct tftp_handle *tftpfile;
 	tftpfile = (struct tftp_handle *) f->f_fsdata;
@@ -371,20 +362,18 @@
 	return (0);
 }
 
+/*
+ * Parameters:
+ *	resid:	out
+ */
 static int 
-tftp_write(f, start, size, resid)
-	struct open_file *f;
-	void           *start;
-	size_t          size;
-	size_t         *resid;	/* out */
+tftp_write(struct open_file *f, void *start, size_t size, size_t *resid)
 {
 	return (EROFS);
 }
 
 static int 
-tftp_stat(f, sb)
-	struct open_file *f;
-	struct stat    *sb;
+tftp_stat(struct open_file *f, struct stat *sb)
 {
 	struct tftp_handle *tftpfile;
 	tftpfile = (struct tftp_handle *) f->f_fsdata;
@@ -398,10 +387,7 @@
 }
 
 static off_t 
-tftp_seek(f, offset, where)
-	struct open_file *f;
-	off_t           offset;
-	int             where;
+tftp_seek(struct open_file *f, off_t offset, int where)
 {
 	struct tftp_handle *tftpfile;
 	tftpfile = (struct tftp_handle *) f->f_fsdata;
Index: twiddle.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/twiddle.c,v
retrieving revision 1.2
diff -u -r1.2 twiddle.c
--- twiddle.c	17 Jun 2003 04:26:51 -0000	1.2
+++ twiddle.c	22 Nov 2005 20:17:53 -0000
@@ -46,7 +46,7 @@
 /* Extra functions from NetBSD standalone printf.c */
 
 void
-twiddle()
+twiddle(void)
 {
 	static int pos;
 
Index: udp.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/udp.c,v
retrieving revision 1.3
diff -u -r1.3 udp.c
--- udp.c	25 Oct 2004 19:38:45 -0000	1.3
+++ udp.c	22 Nov 2005 20:34:18 -0000
@@ -61,10 +61,7 @@
 
 /* Caller must leave room for ethernet, ip and udp headers in front!! */
 ssize_t
-sendudp(d, pkt, len)
-	struct iodesc *d;
-	void *pkt;
-	size_t len;
+sendudp(struct iodesc *d, void *pkt, size_t len)
 {
 	ssize_t cc;
 	struct ip *ip;
@@ -136,11 +133,7 @@
  * Caller leaves room for the headers (Ether, IP, UDP)
  */
 ssize_t
-readudp(d, pkt, len, tleft)
-	struct iodesc *d;
-	void *pkt;
-	size_t len;
-	time_t tleft;
+readudp(struct iodesc *d, void *pkt, size_t len, time_t tleft)
 {
 	ssize_t n;
 	size_t hlen;
Index: ufs.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/ufs.c,v
retrieving revision 1.6
diff -u -r1.6 ufs.c
--- ufs.c	27 Aug 2005 20:23:05 -0000	1.6
+++ ufs.c	22 Nov 2005 20:51:44 -0000
@@ -128,9 +128,7 @@
  * Read a new inode into a file structure.
  */
 static int
-read_inode(inumber, f)
-	ino_t inumber;
-	struct open_file *f;
+read_inode(ino_t inumber, struct open_file *f)
 {
 	struct file *fp = (struct file *)f->f_fsdata;
 	struct fs *fs = fp->f_fs;
@@ -181,12 +179,12 @@
 /*
  * Given an offset in a file, find the disk block number that
  * contains that block.
+ *
+ * Parameters:
+ *	disk_block_p:	out
  */
 static int
-block_map(f, file_block, disk_block_p)
-	struct open_file *f;
-	daddr_t file_block;
-	daddr_t *disk_block_p;	/* out */
+block_map(struct open_file *f, daddr_t file_block, daddr_t * disk_block_p)
 {
 	struct file *fp = (struct file *)f->f_fsdata;
 	struct fs *fs = fp->f_fs;
@@ -287,12 +285,13 @@
 /*
  * Read a portion of a file into an internal buffer.  Return
  * the location in the buffer and the amount in the buffer.
+ *
+ * Parameters:
+ *	buf_p:	out
+ *	size_p:	out
  */
 static int
-buf_read_file(f, buf_p, size_p)
-	struct open_file *f;
-	char **buf_p;		/* out */
-	size_t *size_p;		/* out */
+buf_read_file(struct open_file *f, char **buf_p, size_t *size_p)
 {
 	struct file *fp = (struct file *)f->f_fsdata;
 	struct fs *fs = fp->f_fs;
@@ -349,12 +348,12 @@
 /*
  * Search a directory for a name and return its
  * i_number.
+ *
+ * Parameters:
+ *	inumber_p:	out
  */
 static int
-search_directory(name, f, inumber_p)
-	char *name;
-	struct open_file *f;
-	ino_t *inumber_p;		/* out */
+search_directory(char *name, struct open_file *f, ino_t *inumber_p)
 {
 	struct file *fp = (struct file *)f->f_fsdata;
 	struct direct *dp;
@@ -401,9 +400,7 @@
  * Open a file.
  */
 static int
-ufs_open(upath, f)
-	const char *upath;
-	struct open_file *f;
+ufs_open(const char *upath, struct open_file *f)
 {
 	char *cp, *ncp;
 	int c;
@@ -593,8 +590,7 @@
 }
 
 static int
-ufs_close(f)
-	struct open_file *f;
+ufs_close(struct open_file *f)
 {
 	struct file *fp = (struct file *)f->f_fsdata;
 	int level;
@@ -617,13 +613,12 @@
 /*
  * Copy a portion of a file into kernel memory.
  * Cross block boundaries when necessary.
+ *
+ * Parameters:
+ *	resid:	out
  */
 static int
-ufs_read(f, start, size, resid)
-	struct open_file *f;
-	void *start;
-	size_t size;
-	size_t *resid;	/* out */
+ufs_read(struct open_file *f, void *start, size_t size, size_t *resid)
 {
 	struct file *fp = (struct file *)f->f_fsdata;
 	size_t csize;
@@ -656,10 +651,7 @@
 }
 
 static off_t
-ufs_seek(f, offset, where)
-	struct open_file *f;
-	off_t offset;
-	int where;
+ufs_seek(struct open_file *f, off_t offset, int where)
 {
 	struct file *fp = (struct file *)f->f_fsdata;
 
@@ -680,9 +672,7 @@
 }
 
 static int
-ufs_stat(f, sb)
-	struct open_file *f;
-	struct stat *sb;
+ufs_stat(struct open_file *f, struct stat *sb)
 {
 	struct file *fp = (struct file *)f->f_fsdata;
 
@@ -728,8 +718,7 @@
  * XXX - goes away some day.
  */
 static void
-ffs_oldfscompat(fs)
-	struct fs *fs;
+ffs_oldfscompat(struct fs *fs)
 {
 	int i;
 
Index: write.c
===================================================================
RCS file: /mnt/share/dragonfly-cvs/src/lib/libstand/write.c,v
retrieving revision 1.2
diff -u -r1.2 write.c
--- write.c	25 Oct 2004 19:38:45 -0000	1.2
+++ write.c	22 Nov 2005 20:22:22 -0000
@@ -69,10 +69,7 @@
 #include "stand.h"
 
 ssize_t
-write(fd, dest, bcount)
-	int fd;
-	void *dest;
-	size_t bcount;
+write(int fd, void *dest, size_t bcount)
 {
 	struct open_file *f = &files[fd];
 	size_t resid;




More information about the Submit mailing list