From 568956257500195a80a63ba67f283e98c05c43c1 Mon Sep 17 00:00:00 2001 From: alfred Date: Tue, 5 Feb 2002 23:43:43 +0000 Subject: Fix cc -Wall, fix rcsid warnings, add missing prototypes, change prototypes to be the same as in the original sun tirpc code. Remove ()P macro in a file where the mayority had ()P already removed. Add them if the mayority use ()P macros. Submitted by: mbr Requested by: bde --- lib/libc/net/getaddrinfo.c | 4 ++++ lib/libc/rpc/auth_time.c | 5 +---- lib/libc/rpc/clnt_bcast.c | 3 ++- lib/libc/rpc/clnt_dg.c | 2 +- lib/libc/rpc/des_crypt.c | 2 +- lib/libc/rpc/getpublickey.c | 2 +- lib/libc/rpc/key_call.c | 5 ++--- lib/libc/rpc/key_prot_xdr.c | 6 ++++++ lib/libc/rpc/netname.c | 4 ++-- lib/libc/rpc/netnamer.c | 4 ++-- lib/libc/rpc/rpc_generic.c | 2 ++ lib/libc/rpc/rpc_soc.c | 4 ++-- lib/libc/rpc/rpcb_prot.c | 2 ++ lib/libc/rpc/rpcdname.c | 2 +- lib/libc/rpc/svc_auth_des.c | 2 ++ lib/libc/rpc/svc_simple.c | 5 ++++- lib/libc/rpc/svc_vc.c | 1 - lib/libc/yp/xdryp.c | 2 +- lib/libc/yp/yplib.c | 2 +- 19 files changed, 37 insertions(+), 22 deletions(-) (limited to 'lib') diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index d98aba4e..dbfb888 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -91,6 +91,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -245,6 +248,7 @@ static int _files_getaddrinfo __P((void *, void *, va_list)); #ifdef YP static struct addrinfo *_yphostent __P((char *, const struct addrinfo *)); static int _yp_getaddrinfo __P((void *, void *, va_list)); +extern int _yp_check __P(char **)); #endif static int res_queryN __P((const char *, struct res_target *)); diff --git a/lib/libc/rpc/auth_time.c b/lib/libc/rpc/auth_time.c index f352c6d..d142769 100644 --- a/lib/libc/rpc/auth_time.c +++ b/lib/libc/rpc/auth_time.c @@ -1,4 +1,4 @@ -#pragma ident "@(#)auth_time.c 1.4 92/11/10 SMI" +/* #pragma ident "@(#)auth_time.c 1.4 92/11/10 SMI" */ /* * auth_time.c @@ -26,9 +26,6 @@ * and returned. The SIGALRM processing is modified only if * needed to deal with TCP connections. * - * NOTE: This code has had the crap beaten out it in order to convert - * it from TI-RPC back to TD-RPC for use on FreeBSD. - * * $FreeBSD$ */ #include "namespace.h" diff --git a/lib/libc/rpc/clnt_bcast.c b/lib/libc/rpc/clnt_bcast.c index e2173464..7917c06 100644 --- a/lib/libc/rpc/clnt_bcast.c +++ b/lib/libc/rpc/clnt_bcast.c @@ -269,13 +269,14 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, size_t fdlistno = 0; struct r_rpcb_rmtcallargs barg; /* Remote arguments */ struct r_rpcb_rmtcallres bres; /* Remote results */ - size_t outlen, outlen_pmap; + size_t outlen; struct netconfig *nconf; int msec; int pollretval; int fds_found; #ifdef PORTMAP + size_t outlen_pmap = 0; u_long port; /* Remote port number */ int pmap_flag = 0; /* UDP exists ? */ char *outbuf_pmap = NULL; diff --git a/lib/libc/rpc/clnt_dg.c b/lib/libc/rpc/clnt_dg.c index e46c008..59869bf 100644 --- a/lib/libc/rpc/clnt_dg.c +++ b/lib/libc/rpc/clnt_dg.c @@ -311,7 +311,6 @@ clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout) struct timeval retransmit_time; struct timeval startime, curtime; int firsttimeout = 1; - int dtbsize = __rpc_dtbsize(); struct sockaddr *sa; sigset_t mask; sigset_t newmask; @@ -320,6 +319,7 @@ clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout) int rpc_lock_value; u_int32_t xid; + outlen = 0; sigfillset(&newmask); thr_sigsetmask(SIG_SETMASK, &newmask, &mask); mutex_lock(&clnt_fd_lock); diff --git a/lib/libc/rpc/des_crypt.c b/lib/libc/rpc/des_crypt.c index fa71d5c..7c68267 100644 --- a/lib/libc/rpc/des_crypt.c +++ b/lib/libc/rpc/des_crypt.c @@ -42,7 +42,7 @@ static const char rcsid[] = "$FreeBSD$"; static int common_crypt __P(( char *, char *, register unsigned, unsigned, struct desparams * )); int (*__des_crypt_LOCAL)() = 0; -extern _des_crypt_call __P(( char *, int, struct desparams * )); +extern int _des_crypt_call __P((char *, int, struct desparams *)); /* * Copy 8 bytes */ diff --git a/lib/libc/rpc/getpublickey.c b/lib/libc/rpc/getpublickey.c index 6c8fe5e..4181df8 100644 --- a/lib/libc/rpc/getpublickey.c +++ b/lib/libc/rpc/getpublickey.c @@ -168,7 +168,7 @@ getpublicandprivatekey(key, ret) } int getpublickey(netname, publickey) - char *netname; + const char *netname; char *publickey; { if (__getpublickey_LOCAL != NULL) diff --git a/lib/libc/rpc/key_call.c b/lib/libc/rpc/key_call.c index ef0f241..00df403 100644 --- a/lib/libc/rpc/key_call.c +++ b/lib/libc/rpc/key_call.c @@ -32,7 +32,7 @@ #ident "@(#)key_call.c 1.25 94/04/24 SMI" -#ifndef lint +#if defined(LIBC_SCCS) && !defined(lint) static char rcsid[] = "$FreeBSD$"; #endif /* not lint */ @@ -379,8 +379,7 @@ int vers; endnetconfig(localhandle); return ((CLIENT *) NULL); } - - while (nconf = getnetconfig(localhandle)) { + while ((nconf = getnetconfig(localhandle)) != NULL) { if (strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) { /* * We use COTS_ORD here so that the caller can diff --git a/lib/libc/rpc/key_prot_xdr.c b/lib/libc/rpc/key_prot_xdr.c index 298a451..2329997 100644 --- a/lib/libc/rpc/key_prot_xdr.c +++ b/lib/libc/rpc/key_prot_xdr.c @@ -106,6 +106,8 @@ xdr_cryptkeyres(register XDR *xdrs, cryptkeyres *objp) if (!xdr_des_block(xdrs, &objp->cryptkeyres_u.deskey)) return (FALSE); break; + default: + break; } return (TRUE); } @@ -135,6 +137,8 @@ xdr_getcredres(register XDR *xdrs, getcredres *objp) if (!xdr_unixcred(xdrs, &objp->getcredres_u.cred)) return (FALSE); break; + default: + break; } return (TRUE); } @@ -163,6 +167,8 @@ xdr_key_netstres(register XDR *xdrs, key_netstres *objp) if (!xdr_key_netstarg(xdrs, &objp->key_netstres_u.knet)) return (FALSE); break; + default: + break; } return (TRUE); } diff --git a/lib/libc/rpc/netname.c b/lib/libc/rpc/netname.c index f598f78..34e9ca7 100644 --- a/lib/libc/rpc/netname.c +++ b/lib/libc/rpc/netname.c @@ -109,7 +109,7 @@ user2netname(netname, uid, domain) char *dfltdom; if (domain == NULL) { - if (_rpc_get_default_domain(&dfltdom) != 0) { + if (__rpc_get_default_domain(&dfltdom) != 0) { return (0); } domain = dfltdom; @@ -135,7 +135,7 @@ host2netname(netname, host, domain) char hostname[MAXHOSTNAMELEN+1]; if (domain == NULL) { - if (_rpc_get_default_domain(&dfltdom) != 0) { + if (__rpc_get_default_domain(&dfltdom) != 0) { return (0); } domain = dfltdom; diff --git a/lib/libc/rpc/netnamer.c b/lib/libc/rpc/netnamer.c index 36fa3dc..6384f83 100644 --- a/lib/libc/rpc/netnamer.c +++ b/lib/libc/rpc/netnamer.c @@ -126,7 +126,7 @@ netname2user(netname, uidp, gidp, gidlenp, gidlist) (void) strncpy(val, val1, 1024); val[vallen] = 0; - err = _rpc_get_default_domain(&domain); /* change to rpc */ + err = __rpc_get_default_domain(&domain); /* change to rpc */ if (err) return (0); @@ -227,7 +227,7 @@ netname2host(netname, hostname, hostlen) (void) strncpy(hostname, val, vallen); hostname[vallen] = 0; - err = _rpc_get_default_domain(&domain); /* change to rpc */ + err = __rpc_get_default_domain(&domain); /* change to rpc */ if (err) return (0); diff --git a/lib/libc/rpc/rpc_generic.c b/lib/libc/rpc/rpc_generic.c index ad581a5..ee233bb 100644 --- a/lib/libc/rpc/rpc_generic.c +++ b/lib/libc/rpc/rpc_generic.c @@ -646,6 +646,8 @@ __rpc_uaddr2taddr_af(int af, const char *uaddr) #endif struct sockaddr_un *sun; + port = 0; + sin = NULL; addrstr = strdup(uaddr); if (addrstr == NULL) return NULL; diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c index 39f8199..e049656 100644 --- a/lib/libc/rpc/rpc_soc.c +++ b/lib/libc/rpc/rpc_soc.c @@ -463,13 +463,13 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) u_int recvsz; { struct netbuf *svcaddr; - void *localhandle; struct netconfig *nconf; CLIENT *cl; int len; - nconf = NULL; cl = NULL; + nconf = NULL; + svcaddr = NULL; if ((raddr->sun_len == 0) || ((svcaddr = malloc(sizeof(struct netbuf))) == NULL ) || ((svcaddr->buf = malloc(sizeof(struct sockaddr_un))) == NULL)) { diff --git a/lib/libc/rpc/rpcb_prot.c b/lib/libc/rpc/rpcb_prot.c index aa46510..20ee091 100644 --- a/lib/libc/rpc/rpcb_prot.c +++ b/lib/libc/rpc/rpcb_prot.c @@ -116,6 +116,7 @@ xdr_rpcblist_ptr(xdrs, rp) rpcblist_ptr next; rpcblist_ptr next_copy; + next = NULL; for (;;) { more_elements = (bool_t)(*rp != NULL); if (! xdr_bool(xdrs, &more_elements)) { @@ -204,6 +205,7 @@ xdr_rpcb_entry_list_ptr(xdrs, rp) rpcb_entry_list_ptr next; rpcb_entry_list_ptr next_copy; + next = NULL; for (;;) { more_elements = (bool_t)(*rp != NULL); if (! xdr_bool(xdrs, &more_elements)) { diff --git a/lib/libc/rpc/rpcdname.c b/lib/libc/rpc/rpcdname.c index 03d1b85..ee6a2b4 100644 --- a/lib/libc/rpc/rpcdname.c +++ b/lib/libc/rpc/rpcdname.c @@ -71,7 +71,7 @@ get_default_domain() * get rejected elsewhere in the NIS client package. */ int -_rpc_get_default_domain(domain) +__rpc_get_default_domain(domain) char **domain; { if ((*domain = get_default_domain()) != 0) diff --git a/lib/libc/rpc/svc_auth_des.c b/lib/libc/rpc/svc_auth_des.c index 469bf65..52f4499 100644 --- a/lib/libc/rpc/svc_auth_des.c +++ b/lib/libc/rpc/svc_auth_des.c @@ -69,6 +69,8 @@ static const char rcsid[] = "$FreeBSD$"; #endif +extern int key_decryptsession_pk(const char *, netobj *, des_block *); + #define debug(msg) printf("svcauth_des: %s\n", msg) #define USEC_PER_SEC ((u_long) 1000000L) diff --git a/lib/libc/rpc/svc_simple.c b/lib/libc/rpc/svc_simple.c index 83118bc..7760039 100644 --- a/lib/libc/rpc/svc_simple.c +++ b/lib/libc/rpc/svc_simple.c @@ -133,7 +133,9 @@ rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype) madenow = FALSE; svcxprt = NULL; - for (pl = proglst; pl; pl = pl->p_nxt) + recvsz = 0; + xdrbuf = netid = NULL; + for (pl = proglst; pl; pl = pl->p_nxt) { if (strcmp(pl->p_netid, nconf->nc_netid) == 0) { svcxprt = pl->p_transp; xdrbuf = pl->p_xdrbuf; @@ -141,6 +143,7 @@ rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype) netid = pl->p_netid; break; } + } if (svcxprt == NULL) { struct __rpc_sockinfo si; diff --git a/lib/libc/rpc/svc_vc.c b/lib/libc/rpc/svc_vc.c index a9ecae1..d2a2477 100644 --- a/lib/libc/rpc/svc_vc.c +++ b/lib/libc/rpc/svc_vc.c @@ -129,7 +129,6 @@ svc_vc_create(fd, sendsize, recvsize) struct __rpc_sockinfo si; struct sockaddr_storage sslocal; socklen_t slen; - int one = 1; r = mem_alloc(sizeof(*r)); if (r == NULL) { diff --git a/lib/libc/yp/xdryp.c b/lib/libc/yp/xdryp.c index 1805288..905f89d 100644 --- a/lib/libc/yp/xdryp.c +++ b/lib/libc/yp/xdryp.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ -#ifndef LINT +#if defined(LIBC_SCCS) && !defined(lint) static char *rcsid = "$FreeBSD$"; #endif diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c index 9619bdc..0d1d7ed 100644 --- a/lib/libc/yp/yplib.c +++ b/lib/libc/yp/yplib.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ -#ifndef LINT +#if defined(LIBC_SCCS) && !defined(lint) static char *rcsid = "$FreeBSD$"; #endif -- cgit v1.1