From 64bddf48af0511189b6aae082b3de1c8ee99ff02 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 25 May 2000 13:19:49 +0000 Subject: [PATCH] Patch to remove warnings from Eric Norum . --- c/src/librpc/src/rpc/bindresvport.c | 22 ++++++++++---------- c/src/librpc/src/rpc/rtems_portmapper.c | 27 ++++++++++++++----------- c/src/librpc/src/rpc/svc_simple.c | 2 +- c/src/librpc/src/xdr/xdr.c | 2 +- 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/c/src/librpc/src/rpc/bindresvport.c b/c/src/librpc/src/rpc/bindresvport.c index 7ca339c7b5..ce89a40219 100644 --- a/c/src/librpc/src/rpc/bindresvport.c +++ b/c/src/librpc/src/rpc/bindresvport.c @@ -47,17 +47,6 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/bindresvport.c,v 1.12 2000/01/2 #include #include -/* - * Bind a socket to a privileged IP port - */ -int -bindresvport(sd, sin) - int sd; - struct sockaddr_in *sin; -{ - return bindresvport_sa(sd, (struct sockaddr *)sin); -} - /* * Bind a socket to a privileged port for whatever protocol. */ @@ -143,3 +132,14 @@ bindresvport_sa(sd, sa) } return (error); } + +/* + * Bind a socket to a privileged IP port + */ +int +bindresvport(sd, sin) + int sd; + struct sockaddr_in *sin; +{ + return bindresvport_sa(sd, (struct sockaddr *)sin); +} diff --git a/c/src/librpc/src/rpc/rtems_portmapper.c b/c/src/librpc/src/rpc/rtems_portmapper.c index a0044d5a2f..e33a3103c9 100644 --- a/c/src/librpc/src/rpc/rtems_portmapper.c +++ b/c/src/librpc/src/rpc/rtems_portmapper.c @@ -30,13 +30,16 @@ #include #include #include +#include +#include #include #include #include #include #include -int reg_service(); +static void reg_service(); +static void callit(); static struct pmaplist *pmaplist; static int debugging = 0; @@ -47,7 +50,7 @@ static int debugging = 0; static rtems_task rtems_portmapper (rtems_task_argument unused) { SVCXPRT *xprt; - int sock, pid, t; + int sock; struct sockaddr_in addr; int len = sizeof(struct sockaddr_in); register struct pmaplist *pml; @@ -136,7 +139,7 @@ for (pml = pmaplist; pml != NULL; pml = pml->pml_next) { /* * 1 OK, 0 not */ -static reg_service(rqstp, xprt) +static void reg_service(rqstp, xprt) struct svc_req *rqstp; SVCXPRT *xprt; { @@ -163,7 +166,7 @@ static reg_service(rqstp, xprt) /* * Set a program,version to port mapping */ - if (!svc_getargs(xprt, xdr_pmap, (caddr_t) ®)) + if (!svc_getargs(xprt, xdr_pmap, (caddr_t)®)) svcerr_decode(xprt); else { /* @@ -211,7 +214,7 @@ static reg_service(rqstp, xprt) /* * Remove a program,version to port mapping. */ - if (!svc_getargs(xprt, xdr_pmap, (caddr_t) ®)) + if (!svc_getargs(xprt, xdr_pmap, (caddr_t)®)) svcerr_decode(xprt); else { ans = 0; @@ -245,7 +248,7 @@ static reg_service(rqstp, xprt) /* * Lookup the mapping for a program,version and return its port */ - if (!svc_getargs(xprt, xdr_pmap, (caddr_t) ®)) + if (!svc_getargs(xprt, xdr_pmap, (caddr_t)®)) svcerr_decode(xprt); else { fnd = find_service(reg.pm_prog, reg.pm_vers, reg.pm_prot); @@ -299,7 +302,7 @@ static reg_service(rqstp, xprt) */ #define ARGSIZE 9000 -/* typedef */ struct encap_parms { +struct encap_parms { u_long arglen; char *args; }; @@ -310,10 +313,10 @@ xdr_encap_parms(xdrs, epp) struct encap_parms *epp; { - return (xdr_bytes(xdrs, &(epp->args), &(epp->arglen), ARGSIZE)); + return (xdr_bytes(xdrs, &(epp->args), (u_int*)&(epp->arglen), ARGSIZE)); } -typedef struct rmtcallargs { +struct rmtcallargs { u_long rmt_prog; u_long rmt_vers; u_long rmt_port; @@ -396,7 +399,7 @@ xdr_len_opaque_parms(xdrs, cap) * This now forks so that the program & process that it calls can call * back to the portmapper. */ -static +static void callit(rqstp, xprt) struct svc_req *rqstp; SVCXPRT *xprt; @@ -414,7 +417,7 @@ callit(rqstp, xprt) timeout.tv_sec = 5; timeout.tv_usec = 0; a.rmt_args.args = buf; - if (!svc_getargs(xprt, xdr_rmtcall_args, (caddr_t) &a)) + if (!svc_getargs(xprt, xdr_rmtcall_args, (caddr_t)&a)) return; if ((pml = find_service(a.rmt_prog, a.rmt_vers, IPPROTO_UDP)) == NULL) return; @@ -440,7 +443,7 @@ callit(rqstp, xprt) a.rmt_port = (u_long)port; if (clnt_call(client, a.rmt_proc, xdr_opaque_parms, &a, xdr_len_opaque_parms, &a, timeout) == RPC_SUCCESS) { - svc_sendreply(xprt, xdr_rmtcall_result, &a); + svc_sendreply(xprt, xdr_rmtcall_result, (caddr_t)&a); } AUTH_DESTROY(client->cl_auth); clnt_destroy(client); diff --git a/c/src/librpc/src/rpc/svc_simple.c b/c/src/librpc/src/rpc/svc_simple.c index c97247fb79..ebc700257a 100644 --- a/c/src/librpc/src/rpc/svc_simple.c +++ b/c/src/librpc/src/rpc/svc_simple.c @@ -135,7 +135,7 @@ universal(rqstp, atransp) if (outdata == NULL && lpl->p_outproc != xdr_void) /* there was an error */ return; - if (!svc_sendrelply(atransp, lpl->p_outproc, outdata)) { + if (!svc_sendreply(atransp, lpl->p_outproc, outdata)) { (void) fprintf(stderr, "trouble replying to prog %d\n", lpl->p_prognum); diff --git a/c/src/librpc/src/xdr/xdr.c b/c/src/librpc/src/xdr/xdr.c index fb0ea54ec5..81d2363529 100644 --- a/c/src/librpc/src/xdr/xdr.c +++ b/c/src/librpc/src/xdr/xdr.c @@ -533,7 +533,7 @@ xdr_opaque(xdrs, cp, cnt) register u_int cnt; { register u_int rndup; - static crud[BYTES_PER_XDR_UNIT]; + static int crud[BYTES_PER_XDR_UNIT]; /* * if no data we are done