From: tholo Date: Mon, 25 Mar 1996 21:54:35 +0000 (+0000) Subject: Pull prototypes into scope X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=48dcfcdaab65b07f702d337324f16d9469ae9bcd;p=openbsd Pull prototypes into scope Remove graticious casts --- diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c index 1310d997ebe..263635e5569 100644 --- a/lib/libc/rpc/auth_unix.c +++ b/lib/libc/rpc/auth_unix.c @@ -49,6 +49,7 @@ static char *rcsid = "$NetBSD: auth_unix.c,v 1.2 1995/02/25 03:01:35 cgd Exp $"; #include #include +#include #include #include @@ -84,7 +85,7 @@ struct audata { }; #define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private) -static bool_t marshal_new_auth(); +static void marshal_new_auth(); /* @@ -174,9 +175,9 @@ authunix_create_default() { register int len; char machname[MAX_MACHINE_NAME + 1]; - register int uid; - register int gid; - int gids[NGRPS]; + register uid_t uid; + register gid_t gid; + gid_t gids[NGRPS]; if (gethostname(machname, MAX_MACHINE_NAME) == -1) abort(); @@ -305,7 +306,7 @@ authunix_destroy(auth) * Marshals (pre-serializes) an auth struct. * sets private data, au_marshed and au_mpos */ -static bool_t +static void marshal_new_auth(auth) register AUTH *auth; { diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c index 04a2ef86798..ce6dd3bae18 100644 --- a/lib/libc/rpc/clnt_tcp.c +++ b/lib/libc/rpc/clnt_tcp.c @@ -56,6 +56,7 @@ static char *rcsid = "$NetBSD: clnt_tcp.c,v 1.4 1995/02/25 03:01:41 cgd Exp $"; #include #include +#include #include #include #include @@ -253,7 +254,7 @@ call_again: ct->ct_error.re_status = RPC_SUCCESS; x_id = ntohl(--(*msg_x_id)); if ((! XDR_PUTBYTES(xdrs, ct->ct_mcall, ct->ct_mpos)) || - (! XDR_PUTLONG(xdrs, &proc)) || + (! XDR_PUTLONG(xdrs, (long *)&proc)) || (! AUTH_MARSHALL(h->cl_auth, xdrs)) || (! (*xdr_args)(xdrs, args_ptr))) { if (ct->ct_error.re_status == RPC_SUCCESS) @@ -409,7 +410,7 @@ readtcp(ct, buf, len) FD_SET(ct->ct_sock, &mask); while (TRUE) { readfds = mask; - switch (select(ct->ct_sock+1, &readfds, (int*)NULL, (int*)NULL, + switch (select(ct->ct_sock+1, &readfds, NULL, NULL, &(ct->ct_wait))) { case 0: ct->ct_error.re_status = RPC_TIMEDOUT; diff --git a/lib/libc/rpc/clnt_udp.c b/lib/libc/rpc/clnt_udp.c index f2a41781e06..9c52f52bc77 100644 --- a/lib/libc/rpc/clnt_udp.c +++ b/lib/libc/rpc/clnt_udp.c @@ -43,6 +43,7 @@ static char *rcsid = "$NetBSD: clnt_udp.c,v 1.4 1995/02/25 03:01:42 cgd Exp $"; #include #include +#include #include #include #include @@ -248,7 +249,7 @@ call_again: * the transaction is the first thing in the out buffer */ (*(u_short *)(cu->cu_outbuf))++; - if ((! XDR_PUTLONG(xdrs, &proc)) || + if ((! XDR_PUTLONG(xdrs, (long *)&proc)) || (! AUTH_MARSHALL(cl->cl_auth, xdrs)) || (! (*xargs)(xdrs, argsp))) return (cu->cu_error.re_status = RPC_CANTENCODEARGS); @@ -280,8 +281,8 @@ send_again: FD_SET(cu->cu_sock, &mask); for (;;) { readfds = mask; - switch (select(cu->cu_sock+1, &readfds, (int *)NULL, - (int *)NULL, &(cu->cu_wait))) { + switch (select(cu->cu_sock+1, &readfds, NULL, + NULL, &(cu->cu_wait))) { case 0: time_waited.tv_sec += cu->cu_wait.tv_sec; diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c index fe3d6af8ec7..5e8082e2b93 100644 --- a/lib/libc/rpc/pmap_rmt.c +++ b/lib/libc/rpc/pmap_rmt.c @@ -49,6 +49,7 @@ static char *rcsid = "$NetBSD: pmap_rmt.c,v 1.6 1995/06/03 22:37:25 mycroft Exp #include #include #include +#include #include #include #include @@ -172,7 +173,7 @@ getbroadcastnets(addrs, sock, buf) struct ifreq ifreq, *ifr; struct sockaddr_in *sin; char *cp, *cplim; - int n, i = 0; + int i = 0; ifc.ifc_len = UDPMSGSIZE; ifc.ifc_buf = buf; @@ -322,8 +323,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) msg.acpted_rply.ar_results.where = (caddr_t)&r; msg.acpted_rply.ar_results.proc = xdr_rmtcallres; readfds = mask; - switch (select(sock+1, &readfds, (int *)NULL, - (int *)NULL, &t)) { + switch (select(sock+1, &readfds, NULL, NULL, &t)) { case 0: /* timed out */ stat = RPC_TIMEDOUT; diff --git a/lib/libc/rpc/svc_run.c b/lib/libc/rpc/svc_run.c index 29d7ddd94f3..fe44f8c9821 100644 --- a/lib/libc/rpc/svc_run.c +++ b/lib/libc/rpc/svc_run.c @@ -41,6 +41,7 @@ static char *rcsid = "$NetBSD: svc_run.c,v 1.6 1995/02/25 03:02:00 cgd Exp $"; */ #include #include +#include void svc_run() @@ -49,7 +50,7 @@ svc_run() for (;;) { readfds = svc_fdset; - switch (select(svc_maxfd+1, &readfds, (int *)0, (int *)0, + switch (select(svc_maxfd+1, &readfds, 0, 0, (struct timeval *)0)) { case -1: if (errno == EINTR) { diff --git a/lib/libc/rpc/svc_tcp.c b/lib/libc/rpc/svc_tcp.c index e39a0b0d906..5c3b2644f10 100644 --- a/lib/libc/rpc/svc_tcp.c +++ b/lib/libc/rpc/svc_tcp.c @@ -48,6 +48,7 @@ static char *rcsid = "$NetBSD: svc_tcp.c,v 1.6 1995/06/03 22:37:27 mycroft Exp $ #include #include #include +#include #include #include #include @@ -304,7 +305,7 @@ readtcp(xprt, buf, len) FD_SET(sock, &mask); do { readfds = mask; - if (select(sock+1, &readfds, (int*)NULL, (int*)NULL, + if (select(sock+1, &readfds, NULL, NULL, &wait_per_try) <= 0) { if (errno == EINTR) { continue; diff --git a/lib/libc/rpc/xdr_rec.c b/lib/libc/rpc/xdr_rec.c index df7b154f801..8857750660e 100644 --- a/lib/libc/rpc/xdr_rec.c +++ b/lib/libc/rpc/xdr_rec.c @@ -53,6 +53,7 @@ static char *rcsid = "$NetBSD: xdr_rec.c,v 1.5 1995/02/25 03:02:08 cgd Exp $"; #include #include +#include #include #include #include @@ -302,7 +303,7 @@ xdrrec_getpos(xdrs) register RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; register long pos; - pos = lseek((off_t)(long)rstrm->tcp_handle, 0, 1); + pos = lseek((int)(long)rstrm->tcp_handle, (off_t)0, 1); if (pos != -1) switch (xdrs->x_op) { @@ -315,7 +316,7 @@ xdrrec_getpos(xdrs) break; default: - pos = (u_int) -1; + pos = -1; break; } return ((u_int) pos);