diff options
Diffstat (limited to 'libc')
28 files changed, 109 insertions, 70 deletions
diff --git a/libc/inet/rpc/auth_unix.c b/libc/inet/rpc/auth_unix.c index 373e32bb1..34b89dc0c 100644 --- a/libc/inet/rpc/auth_unix.c +++ b/libc/inet/rpc/auth_unix.c @@ -82,7 +82,7 @@ struct audata { #define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private) -static bool_t marshal_new_auth(); +static void marshal_new_auth(); /* @@ -292,7 +292,7 @@ register AUTH *auth; * Marshals (pre-serializes) an auth struct. * sets private data, au_marshed and au_mpos */ -static bool_t marshal_new_auth(auth) +static void marshal_new_auth(auth) register AUTH *auth; { XDR xdr_stream; diff --git a/libc/inet/rpc/authunix_prot.c b/libc/inet/rpc/authunix_prot.c index 34d1d70e7..07a2ca906 100644 --- a/libc/inet/rpc/authunix_prot.c +++ b/libc/inet/rpc/authunix_prot.c @@ -56,7 +56,7 @@ register struct authunix_parms *p; && xdr_int(xdrs, &(p->aup_uid)) && xdr_int(xdrs, &(p->aup_gid)) && xdr_array(xdrs, (caddr_t *) & (p->aup_gids), - &(p->aup_len), NGRPS, sizeof(int), xdr_int)) { + &(p->aup_len), NGRPS, sizeof(int), (xdrproc_t) xdr_int)) { return (TRUE); } return (FALSE); diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c index e48974fcd..051f1eb45 100644 --- a/libc/inet/rpc/clnt_tcp.c +++ b/libc/inet/rpc/clnt_tcp.c @@ -55,6 +55,7 @@ #include <netdb.h> #include <errno.h> #include <rpc/pmap_clnt.h> +#include <unistd.h> #define MCALL_MSG_SIZE 24 @@ -118,6 +119,7 @@ u_int recvsz; struct timeval now; struct rpc_msg call_msg; + ct = NULL; /* in case of fooy */ h = (CLIENT *) mem_alloc(sizeof(*h)); if (h == NULL) { (void) fprintf(stderr, "clnttcp_create: out of memory\n"); @@ -279,7 +281,7 @@ struct timeval timeout; while (TRUE) { reply_msg.acpted_rply.ar_verf = _null_auth; reply_msg.acpted_rply.ar_results.where = NULL; - reply_msg.acpted_rply.ar_results.proc = xdr_void; + reply_msg.acpted_rply.ar_results.proc = (xdrproc_t) xdr_void; if (!xdrrec_skiprecord(xdrs)) return (ct->ct_error.re_status); /* now decode and validate the response header */ @@ -411,7 +413,7 @@ register int len; while (TRUE) { readfds = mask; switch (select - (_rpc_dtablesize(), &readfds, (int *) NULL, (int *) NULL, + (_rpc_dtablesize(), &readfds, NULL, NULL, &(ct->ct_wait))) { case 0: ct->ct_error.re_status = RPC_TIMEDOUT; diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c index d1128734c..7ecafbc78 100644 --- a/libc/inet/rpc/clnt_udp.c +++ b/libc/inet/rpc/clnt_udp.c @@ -43,6 +43,7 @@ #include <netdb.h> #include <errno.h> #include <rpc/pmap_clnt.h> +#include <unistd.h> extern int errno; @@ -115,6 +116,7 @@ u_int recvsz; struct timeval now; struct rpc_msg call_msg; + cu = NULL; /* in case of fooy */ cl = (CLIENT *) mem_alloc(sizeof(CLIENT)); if (cl == NULL) { (void) fprintf(stderr, "clntudp_create: out of memory\n"); @@ -284,8 +286,8 @@ struct timeval utimeout; /* seconds to wait before giving up */ #endif /* def FD_SETSIZE */ for (;;) { readfds = mask; - switch (select(_rpc_dtablesize(), &readfds, (int *) NULL, - (int *) NULL, &(cu->cu_wait))) { + switch (select(_rpc_dtablesize(), &readfds, NULL, + NULL, &(cu->cu_wait))) { case 0: time_waited.tv_sec += cu->cu_wait.tv_sec; diff --git a/libc/inet/rpc/get_myaddress.c b/libc/inet/rpc/get_myaddress.c index b25fb8216..53cebe81c 100644 --- a/libc/inet/rpc/get_myaddress.c +++ b/libc/inet/rpc/get_myaddress.c @@ -45,11 +45,13 @@ #include <sys/ioctl.h> #include <arpa/inet.h> #include <netinet/in.h> +#include <rpc/clnt.h> +#include <unistd.h> #ifdef __linux__ /* DO use gethostbyname because it's portable */ #include <netdb.h> -get_myaddress(addr) +void get_myaddress(addr) struct sockaddr_in *addr; { char localhost[256 + 1]; diff --git a/libc/inet/rpc/getrpcent.c b/libc/inet/rpc/getrpcent.c index 02f0eac78..00e67ee6b 100644 --- a/libc/inet/rpc/getrpcent.c +++ b/libc/inet/rpc/getrpcent.c @@ -54,9 +54,9 @@ struct rpcdata { struct rpcent rpc; char line[BUFSIZ + 1]; char *domain; -} *rpcdata, *_rpcdata(); +} *rpcdata; -static struct rpcent *interpret(); +static struct rpcent *interpret(const char *val, int len); struct hostent *gethostent(); char *inet_ntoa(); @@ -85,14 +85,11 @@ register int number; { register struct rpcdata *d = _rpcdata(); register struct rpcent *p; - int reason; - char adrstr[16], *val = NULL; - int vallen; if (d == 0) return (0); setrpcent(0); - while (p = getrpcent()) { + while ((p = getrpcent())) { if (p->r_number == number) break; } @@ -112,7 +109,7 @@ char *name; char **rp; setrpcent(0); - while (rpc = getrpcent()) { + while ((rpc = getrpcent())) { if (strcmp(rpc->r_name, name) == 0) return (rpc); for (rp = rpc->r_aliases; *rp != NULL; rp++) { @@ -165,10 +162,6 @@ endrpcent() struct rpcent *getrpcent() { - struct rpcent *hp; - int reason; - char *key = NULL, *val = NULL; - int keylen, vallen; register struct rpcdata *d = _rpcdata(); if (d == 0) @@ -198,14 +191,14 @@ char *s; } #endif -static struct rpcent *interpret(val, len) +static struct rpcent *interpret(const char *val, int len) { register struct rpcdata *d = _rpcdata(); char *p; register char *cp, **q; if (d == 0) - return; + return NULL; strncpy(d->line, val, len); p = d->line; d->line[len] = '\n'; diff --git a/libc/inet/rpc/getrpcport.c b/libc/inet/rpc/getrpcport.c index 2c20282fe..7fd3aa631 100644 --- a/libc/inet/rpc/getrpcport.c +++ b/libc/inet/rpc/getrpcport.c @@ -38,6 +38,7 @@ #include <rpc/rpc.h> #include <netdb.h> #include <sys/socket.h> +#include <rpc/pmap_clnt.h> extern int getrpcport (const char * host, u_long prognum, u_long versnum, u_int proto) diff --git a/libc/inet/rpc/pmap_clnt.c b/libc/inet/rpc/pmap_clnt.c index c1c38d89a..bff3bb236 100644 --- a/libc/inet/rpc/pmap_clnt.c +++ b/libc/inet/rpc/pmap_clnt.c @@ -40,6 +40,7 @@ #include <rpc/rpc.h> #include <rpc/pmap_prot.h> #include <rpc/pmap_clnt.h> +#include <unistd.h> static struct timeval timeout = { 5, 0 }; static struct timeval tottimeout = { 60, 0 }; @@ -73,7 +74,8 @@ u_short port; parms.pm_vers = version; parms.pm_prot = protocol; parms.pm_port = port; - if (CLNT_CALL(client, PMAPPROC_SET, xdr_pmap, &parms, xdr_bool, &rslt, + if (CLNT_CALL(client, PMAPPROC_SET, (xdrproc_t) xdr_pmap, (caddr_t) &parms, + (xdrproc_t) xdr_bool, (caddr_t) &rslt, tottimeout) != RPC_SUCCESS) { clnt_perror(client, "Cannot register service"); return (FALSE); @@ -106,8 +108,8 @@ u_long version; parms.pm_prog = program; parms.pm_vers = version; parms.pm_port = parms.pm_prot = 0; - CLNT_CALL(client, PMAPPROC_UNSET, xdr_pmap, &parms, xdr_bool, &rslt, - tottimeout); + CLNT_CALL(client, PMAPPROC_UNSET, (xdrproc_t) xdr_pmap, (caddr_t) &parms, + (xdrproc_t) xdr_bool, (caddr_t) &rslt, tottimeout); CLNT_DESTROY(client); (void) close(socket); return (rslt); diff --git a/libc/inet/rpc/pmap_getmaps.c b/libc/inet/rpc/pmap_getmaps.c index e1685b595..58fc0c25b 100644 --- a/libc/inet/rpc/pmap_getmaps.c +++ b/libc/inet/rpc/pmap_getmaps.c @@ -47,6 +47,7 @@ #include <errno.h> //#include <net/if.h> #include <sys/ioctl.h> +#include <unistd.h> #define NAMELEN 255 #define MAX_BROADCAST_SIZE 1400 @@ -69,8 +70,9 @@ struct sockaddr_in *address; address->sin_port = htons(PMAPPORT); client = clnttcp_create(address, PMAPPROG, PMAPVERS, &socket, 50, 500); if (client != (CLIENT *) NULL) { - if (CLNT_CALL(client, PMAPPROC_DUMP, xdr_void, NULL, xdr_pmaplist, - &head, minutetimeout) != RPC_SUCCESS) { + if (CLNT_CALL(client, PMAPPROC_DUMP, (xdrproc_t) xdr_void, NULL, + (xdrproc_t) xdr_pmaplist, (caddr_t) &head, + minutetimeout) != RPC_SUCCESS) { clnt_perror(client, "pmap_getmaps rpc problem"); } CLNT_DESTROY(client); diff --git a/libc/inet/rpc/pmap_getport.c b/libc/inet/rpc/pmap_getport.c index eee4f5d27..519d7d933 100644 --- a/libc/inet/rpc/pmap_getport.c +++ b/libc/inet/rpc/pmap_getport.c @@ -41,6 +41,7 @@ #include <rpc/pmap_prot.h> #include <rpc/pmap_clnt.h> #include <sys/socket.h> +#include <unistd.h> //#include <net/if.h> static struct timeval timeout = { 5, 0 }; @@ -71,8 +72,10 @@ u_int protocol; parms.pm_vers = version; parms.pm_prot = protocol; parms.pm_port = 0; /* not needed or used */ - if (CLNT_CALL(client, PMAPPROC_GETPORT, xdr_pmap, &parms, - xdr_u_short, &port, tottimeout) != RPC_SUCCESS) { + if (CLNT_CALL(client, PMAPPROC_GETPORT, + (xdrproc_t) xdr_pmap, (caddr_t) &parms, + (xdrproc_t) xdr_u_short, (caddr_t) &port, + tottimeout) != RPC_SUCCESS) { rpc_createerr.cf_stat = RPC_PMAPFAILURE; clnt_geterr(client, &rpc_createerr.cf_error); } else if (port == 0) { diff --git a/libc/inet/rpc/pmap_prot2.c b/libc/inet/rpc/pmap_prot2.c index bdd3ec0e3..028e85d76 100644 --- a/libc/inet/rpc/pmap_prot2.c +++ b/libc/inet/rpc/pmap_prot2.c @@ -92,6 +92,7 @@ register struct pmaplist **rp; bool_t more_elements; register int freeing = (xdrs->x_op == XDR_FREE); register struct pmaplist **next; +#warning expect "next" might be unitialized while (TRUE) { more_elements = (bool_t) (*rp != NULL); @@ -107,7 +108,7 @@ register struct pmaplist **rp; if (freeing) next = &((*rp)->pml_next); if (!xdr_reference(xdrs, (caddr_t *) rp, - (u_int) sizeof(struct pmaplist), xdr_pmap)) + (u_int) sizeof(struct pmaplist), (xdrproc_t) xdr_pmap)) return (FALSE); rp = (freeing) ? next : &((*rp)->pml_next); diff --git a/libc/inet/rpc/pmap_rmt.c b/libc/inet/rpc/pmap_rmt.c index a79c34954..f330db07d 100644 --- a/libc/inet/rpc/pmap_rmt.c +++ b/libc/inet/rpc/pmap_rmt.c @@ -92,8 +92,9 @@ u_long *port_ptr; r.port_ptr = port_ptr; r.results_ptr = resp; r.xdr_results = xdrres; - stat = CLNT_CALL(client, PMAPPROC_CALLIT, xdr_rmtcall_args, &a, - xdr_rmtcallres, &r, tout); + stat = CLNT_CALL(client, PMAPPROC_CALLIT, + (xdrproc_t) xdr_rmtcall_args, (caddr_t) &a, + (xdrproc_t) xdr_rmtcallres, (caddr_t) &r, tout); CLNT_DESTROY(client); } else { stat = RPC_FAILED; @@ -143,7 +144,7 @@ register struct rmtcallres *crp; port_ptr = (caddr_t) crp->port_ptr; if (xdr_reference(xdrs, &port_ptr, sizeof(u_long), - xdr_u_long) && xdr_u_long(xdrs, &crp->resultslen)) { + (xdrproc_t) xdr_u_long) && xdr_u_long(xdrs, &crp->resultslen)) { crp->port_ptr = (u_long *) port_ptr; return ((*(crp->xdr_results)) (xdrs, crp->results_ptr)); } @@ -341,10 +342,9 @@ resultproc_t eachresult; /* call with each result obtained */ recv_again: msg.acpted_rply.ar_verf = _null_auth; msg.acpted_rply.ar_results.where = (caddr_t) & r; - msg.acpted_rply.ar_results.proc = xdr_rmtcallres; + msg.acpted_rply.ar_results.proc = (xdrproc_t) xdr_rmtcallres; readfds = mask; - switch (select(_rpc_dtablesize(), &readfds, (int *) NULL, - (int *) NULL, &t)) { + switch (select(_rpc_dtablesize(), &readfds, NULL, NULL, &t)) { case 0: /* timed out */ stat = RPC_TIMEDOUT; @@ -394,7 +394,7 @@ resultproc_t eachresult; /* call with each result obtained */ #endif } xdrs->x_op = XDR_FREE; - msg.acpted_rply.ar_results.proc = xdr_void; + msg.acpted_rply.ar_results.proc = (xdrproc_t) xdr_void; (void) xdr_replymsg(xdrs, &msg); (void) (*xresults) (xdrs, resultsp); xdr_destroy(xdrs); diff --git a/libc/inet/rpc/rpc_callmsg.c b/libc/inet/rpc/rpc_callmsg.c index 46ffa7b36..0a7c5c952 100644 --- a/libc/inet/rpc/rpc_callmsg.c +++ b/libc/inet/rpc/rpc_callmsg.c @@ -48,7 +48,7 @@ bool_t xdr_callmsg(xdrs, cmsg) register XDR *xdrs; register struct rpc_msg *cmsg; { - register long *buf; + register void *buf; register struct opaque_auth *oa; if (xdrs->x_op == XDR_ENCODE) { diff --git a/libc/inet/rpc/rpc_dtablesize.c b/libc/inet/rpc/rpc_dtablesize.c index 9ddbb63fc..69669459e 100644 --- a/libc/inet/rpc/rpc_dtablesize.c +++ b/libc/inet/rpc/rpc_dtablesize.c @@ -30,11 +30,13 @@ #define __FORCE_GLIBC__ #include <features.h> +#include <rpc/clnt.h> +#include <unistd.h> /* * Cache the result of getdtablesize(), so we don't have to do an * expensive system call every time. */ -_rpc_dtablesize() +int _rpc_dtablesize(void) { static int size; diff --git a/libc/inet/rpc/rpc_prot.c b/libc/inet/rpc/rpc_prot.c index 1a9534435..866c2f704 100644 --- a/libc/inet/rpc/rpc_prot.c +++ b/libc/inet/rpc/rpc_prot.c @@ -98,6 +98,7 @@ register struct accepted_reply *ar; if (!xdr_u_long(xdrs, &(ar->ar_vers.low))) return (FALSE); return (xdr_u_long(xdrs, &(ar->ar_vers.high))); + default: /* silence the warnings */ } return (TRUE); /* TRUE => open ended set of problems */ } @@ -122,13 +123,14 @@ register struct rejected_reply *rr; case AUTH_ERROR: return (xdr_enum(xdrs, (enum_t *) & (rr->rj_why))); + default: /* silence the warnings */ } return (FALSE); } static struct xdr_discrim reply_dscrm[3] = { - {(int) MSG_ACCEPTED, xdr_accepted_reply}, - {(int) MSG_DENIED, xdr_rejected_reply}, + {(int) MSG_ACCEPTED, (xdrproc_t) xdr_accepted_reply}, + {(int) MSG_DENIED, (xdrproc_t) xdr_rejected_reply}, {__dontcare__, NULL_xdrproc_t} }; @@ -203,6 +205,8 @@ register struct rpc_err *error; case SUCCESS: error->re_status = RPC_SUCCESS; return; + + default: /* silence the warnings */ } /* something's wrong, but we don't know what ... */ error->re_status = RPC_FAILED; @@ -224,6 +228,8 @@ register struct rpc_err *error; case AUTH_ERROR: error->re_status = RPC_AUTHERROR; return; + + default: /* silence the warnings */ } /* something's wrong, but we don't know what ... */ error->re_status = RPC_FAILED; @@ -274,5 +280,7 @@ register struct rpc_err *error; error->re_vers.low = msg->acpted_rply.ar_vers.low; error->re_vers.high = msg->acpted_rply.ar_vers.high; break; + + default: /* silence the warnings */ } } diff --git a/libc/inet/rpc/svc.c b/libc/inet/rpc/svc.c index 059da5cc6..0436e3042 100644 --- a/libc/inet/rpc/svc.c +++ b/libc/inet/rpc/svc.c @@ -409,7 +409,7 @@ int *readfds; maskp = (u_long *) readfds->fds_bits; #endif for (sock = 0; sock < setsize; sock += NFDBITS) { - for (mask = *maskp++; bit = ffs(mask); mask ^= (1 << (bit - 1))) { + for (mask = *maskp++; (bit = ffs(mask)); mask ^= (1 << (bit - 1))) { /* sock has input waiting */ xprt = xports[sock + bit - 1]; #else diff --git a/libc/inet/rpc/svc_auth.c b/libc/inet/rpc/svc_auth.c index 435f816d5..29e893a88 100644 --- a/libc/inet/rpc/svc_auth.c +++ b/libc/inet/rpc/svc_auth.c @@ -60,9 +60,9 @@ enum auth_stat _svcauth_short(); /* short hand unix style */ static struct { enum auth_stat (*authenticator) (); } svcauthsw[] = { - _svcauth_null, /* AUTH_NULL */ - _svcauth_unix, /* AUTH_UNIX */ - _svcauth_short, /* AUTH_SHORT */ + {_svcauth_null}, /* AUTH_NULL */ + {_svcauth_unix}, /* AUTH_UNIX */ + {_svcauth_short}, /* AUTH_SHORT */ }; #define AUTH_MAX 2 /* HIGHEST AUTH NUMBER */ diff --git a/libc/inet/rpc/svc_auth_unix.c b/libc/inet/rpc/svc_auth_unix.c index 7e6628a78..6b11ee6a0 100644 --- a/libc/inet/rpc/svc_auth_unix.c +++ b/libc/inet/rpc/svc_auth_unix.c @@ -71,7 +71,7 @@ register struct rpc_msg *msg; auth_len = (u_int) msg->rm_call.cb_cred.oa_length; xdrmem_create(&xdrs, msg->rm_call.cb_cred.oa_base, auth_len, XDR_DECODE); - buf = XDR_INLINE(&xdrs, auth_len); + buf = (long *)XDR_INLINE(&xdrs, auth_len); if (buf != NULL) { aup->aup_time = IXDR_GET_LONG(buf); str_len = IXDR_GET_U_LONG(buf); diff --git a/libc/inet/rpc/svc_run.c b/libc/inet/rpc/svc_run.c index db7d8e755..01e387ad0 100644 --- a/libc/inet/rpc/svc_run.c +++ b/libc/inet/rpc/svc_run.c @@ -53,7 +53,7 @@ void svc_run() #else readfds = svc_fds; #endif /* def FD_SETSIZE */ - switch (select(_rpc_dtablesize(), &readfds, (int *) 0, (int *) 0, + switch (select(_rpc_dtablesize(), &readfds, NULL, NULL, (struct timeval *) 0)) { case -1: if (errno == EINTR) { diff --git a/libc/inet/rpc/svc_simple.c b/libc/inet/rpc/svc_simple.c index e6e9f8620..5d5c76ad4 100644 --- a/libc/inet/rpc/svc_simple.c +++ b/libc/inet/rpc/svc_simple.c @@ -53,14 +53,16 @@ static void universal(); static SVCXPRT *transp; struct proglst *pl; -registerrpc(prognum, versnum, procnum, progname, inproc, outproc) +extern bool_t pmap_unset(u_long program, u_long version); + +int registerrpc(prognum, versnum, procnum, progname, inproc, outproc) char *(*progname) (); xdrproc_t inproc, outproc; { if (procnum == NULLPROC) { (void) fprintf(stderr, - "can't reassign procedure number %d\n", NULLPROC); + "can't reassign procedure number %lu\n", NULLPROC); return (-1); } if (transp == 0) { @@ -106,7 +108,7 @@ SVCXPRT *transp; * enforce "procnum 0 is echo" convention */ if (rqstp->rq_proc == NULLPROC) { - if (svc_sendreply(transp, xdr_void, (char *) NULL) == FALSE) { + if (svc_sendreply(transp, (xdrproc_t) xdr_void, (char *) NULL) == FALSE) { (void) fprintf(stderr, "xxx\n"); exit(1); } @@ -123,7 +125,7 @@ SVCXPRT *transp; return; } outdata = (*(pl->p_progname)) (xdrbuf); - if (outdata == NULL && pl->p_outproc != xdr_void) + if (outdata == NULL && pl->p_outproc != (xdrproc_t) xdr_void) /* there was an error */ return; if (!svc_sendreply(transp, pl->p_outproc, outdata)) { diff --git a/libc/inet/rpc/svc_tcp.c b/libc/inet/rpc/svc_tcp.c index 64527f84d..082f51464 100644 --- a/libc/inet/rpc/svc_tcp.c +++ b/libc/inet/rpc/svc_tcp.c @@ -45,7 +45,7 @@ #include <rpc/rpc.h> #include <sys/socket.h> #include <errno.h> -extern errno; +#include <unistd.h> /* * Ops vector for TCP/IP based rpc service handle @@ -72,6 +72,7 @@ static struct xp_ops svctcp_op = { static bool_t rendezvous_request(); static enum xprt_stat rendezvous_stat(); +#warning Expect 3 warnings for initialization from incompatible pointer type static struct xp_ops svctcp_rendezvous_op = { rendezvous_request, rendezvous_stat, @@ -300,7 +301,7 @@ register int len; #endif /* def FD_SETSIZE */ do { readfds = mask; - if (select(_rpc_dtablesize(), &readfds, (int *) NULL, (int *) NULL, + if (select(_rpc_dtablesize(), &readfds, NULL, NULL, &wait_per_try) <= 0) { if (errno == EINTR) { continue; diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c index 208fbf281..c0b0c2237 100644 --- a/libc/inet/rpc/svc_udp.c +++ b/libc/inet/rpc/svc_udp.c @@ -42,10 +42,13 @@ #include <rpc/rpc.h> #include <sys/socket.h> #include <errno.h> +#include <unistd.h> #define rpc_buffer(xprt) ((xprt)->xp_p1) +#ifndef MAX #define MAX(a, b) ((a > b) ? a : b) +#endif static bool_t svcudp_recv(); static bool_t svcudp_reply(); @@ -54,6 +57,10 @@ static bool_t svcudp_getargs(); static bool_t svcudp_freeargs(); static void svcudp_destroy(); +static void cache_set(SVCXPRT *xprt, u_long replylen); +static int cache_get(SVCXPRT *xprt, struct rpc_msg *msg, + char **replyp, u_long *replylenp); + static struct xp_ops svcudp_op = { svcudp_recv, svcudp_stat, @@ -63,8 +70,6 @@ static struct xp_ops svcudp_op = { svcudp_destroy }; -extern int errno; - /* * kept in xprt->xp_p2 */ @@ -329,7 +334,7 @@ struct udp_cache { * Enable use of the cache. * Note: there is no disable. */ -svcudp_enablecache(transp, size) +int svcudp_enablecache(transp, size) SVCXPRT *transp; u_long size; { @@ -367,7 +372,7 @@ u_long size; /* * Set an entry in the cache */ -static cache_set(xprt, replylen) +static void cache_set(xprt, replylen) SVCXPRT *xprt; u_long replylen; { @@ -432,7 +437,7 @@ u_long replylen; * Try to get an entry from the cache * return 1 if found, 0 if not found */ -static cache_get(xprt, msg, replyp, replylenp) +static int cache_get(xprt, msg, replyp, replylenp) SVCXPRT *xprt; struct rpc_msg *msg; char **replyp; diff --git a/libc/inet/rpc/xdr.c b/libc/inet/rpc/xdr.c index a13090c3f..c26b481d7 100644 --- a/libc/inet/rpc/xdr.c +++ b/libc/inet/rpc/xdr.c @@ -337,7 +337,7 @@ register u_int cnt; } if (rndup == 0) return (TRUE); - return (XDR_GETBYTES(xdrs, crud, rndup)); + return (XDR_GETBYTES(xdrs, (caddr_t) crud, rndup)); } if (xdrs->x_op == XDR_ENCODE) { @@ -503,6 +503,7 @@ u_int maxsize; case XDR_ENCODE: size = strlen(sp); break; + default: /* silence the warnings */ } if (!xdr_u_int(xdrs, &size)) { return (FALSE); diff --git a/libc/inet/rpc/xdr_array.c b/libc/inet/rpc/xdr_array.c index 26dd7beb7..de3ebbad3 100644 --- a/libc/inet/rpc/xdr_array.c +++ b/libc/inet/rpc/xdr_array.c @@ -40,6 +40,7 @@ */ #include <stdio.h> +#include <string.h> #include <rpc/types.h> #include <rpc/xdr.h> @@ -97,6 +98,7 @@ xdrproc_t elproc; /* xdr routine to handle each element */ case XDR_FREE: return (TRUE); + default: /* silence the warnings */ } /* diff --git a/libc/inet/rpc/xdr_mem.c b/libc/inet/rpc/xdr_mem.c index 17707f8ff..5dbebae8d 100644 --- a/libc/inet/rpc/xdr_mem.c +++ b/libc/inet/rpc/xdr_mem.c @@ -41,7 +41,7 @@ * */ - +#include <string.h> #include <rpc/types.h> #include <rpc/xdr.h> #include <netinet/in.h> @@ -52,7 +52,7 @@ static bool_t xdrmem_getbytes(); static bool_t xdrmem_putbytes(); static u_int xdrmem_getpos(); static bool_t xdrmem_setpos(); -static long *xdrmem_inline(); +static int32_t *xdrmem_inline(); static void xdrmem_destroy(); static struct xdr_ops xdrmem_ops = { @@ -163,15 +163,15 @@ u_int pos; return (TRUE); } -static long *xdrmem_inline(xdrs, len) +static int32_t *xdrmem_inline(xdrs, len) register XDR *xdrs; int len; { - long *buf = 0; + int32_t *buf = 0; if (xdrs->x_handy >= len) { xdrs->x_handy -= len; - buf = (long *) xdrs->x_private; + buf = (int32_t *) xdrs->x_private; xdrs->x_private += len; } return (buf); diff --git a/libc/inet/rpc/xdr_rec.c b/libc/inet/rpc/xdr_rec.c index 57e6f6f6c..b68424f7d 100644 --- a/libc/inet/rpc/xdr_rec.c +++ b/libc/inet/rpc/xdr_rec.c @@ -48,6 +48,7 @@ */ #include <stdio.h> +#include <string.h> #include <rpc/types.h> #include <rpc/xdr.h> #include <netinet/in.h> @@ -62,7 +63,7 @@ static bool_t xdrrec_getbytes(); static bool_t xdrrec_putbytes(); static u_int xdrrec_getpos(); static bool_t xdrrec_setpos(); -static long *xdrrec_inline(); +static int32_t *xdrrec_inline(); static void xdrrec_destroy(); static struct xdr_ops xdrrec_ops = { @@ -117,6 +118,11 @@ typedef struct rec_strm { u_int recvsize; } RECSTREAM; +static bool_t flush_out(register RECSTREAM *rstrm, bool_t eor); +static bool_t set_input_fragment(register RECSTREAM *rstrm); +static bool_t get_input_bytes(register RECSTREAM *rstrm, + register caddr_t addr, register int len); +static bool_t skip_input_bytes(register RECSTREAM *rstrm, long cnt); /* * Create an xdr handle for xdrrec @@ -342,22 +348,23 @@ u_int pos; return (TRUE); } break; + default: /* silence the warnings */ } return (FALSE); } -static long *xdrrec_inline(xdrs, len) +static int32_t *xdrrec_inline(xdrs, len) register XDR *xdrs; int len; { register RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; - long *buf = NULL; + int32_t *buf = NULL; switch (xdrs->x_op) { case XDR_ENCODE: if ((rstrm->out_finger + len) <= rstrm->out_boundry) { - buf = (long *) rstrm->out_finger; + buf = (int32_t *) rstrm->out_finger; rstrm->out_finger += len; } break; @@ -365,11 +372,12 @@ int len; case XDR_DECODE: if ((len <= rstrm->fbtbc) && ((rstrm->in_finger + len) <= rstrm->in_boundry)) { - buf = (long *) rstrm->in_finger; + buf = (int32_t *) rstrm->in_finger; rstrm->fbtbc -= len; rstrm->in_finger += len; } break; + default: /* silence the warnings */ } return (buf); } diff --git a/libc/inet/rpc/xdr_reference.c b/libc/inet/rpc/xdr_reference.c index 4d3d99278..dfb9ac49e 100644 --- a/libc/inet/rpc/xdr_reference.c +++ b/libc/inet/rpc/xdr_reference.c @@ -40,6 +40,7 @@ */ #include <stdio.h> +#include <string.h> #include <rpc/types.h> #include <rpc/xdr.h> @@ -76,6 +77,7 @@ xdrproc_t proc; /* xdr routine to handle the object */ } bzero(loc, (int) size); break; + default: /* silence the warnings */ } stat = (*proc) (xdrs, loc, LASTUNSIGNED); diff --git a/libc/inet/rpc/xdr_stdio.c b/libc/inet/rpc/xdr_stdio.c index 828bcbf39..cd9d67cf3 100644 --- a/libc/inet/rpc/xdr_stdio.c +++ b/libc/inet/rpc/xdr_stdio.c @@ -50,7 +50,7 @@ static bool_t xdrstdio_getbytes(); static bool_t xdrstdio_putbytes(); static u_int xdrstdio_getpos(); static bool_t xdrstdio_setpos(); -static long *xdrstdio_inline(); +static int32_t *xdrstdio_inline(); static void xdrstdio_destroy(); /* @@ -166,7 +166,7 @@ u_int pos; FALSE : TRUE); } -static long *xdrstdio_inline(xdrs, len) +static int32_t *xdrstdio_inline(xdrs, len) XDR *xdrs; u_int len; { |