WARNS=3 safety (mostly), use __unused for unused params and unsigned where
needed to avoid warnings about comparing signed and unsigned values.
This commit is contained in:
parent
0aa282c0b3
commit
4180788ff0
@ -109,7 +109,7 @@ check_bound(struct fdlist *fdl, char *uaddr)
|
||||
}
|
||||
|
||||
int
|
||||
add_bndlist(struct netconfig *nconf, struct netbuf *baddr)
|
||||
add_bndlist(struct netconfig *nconf, struct netbuf *baddr __unused)
|
||||
{
|
||||
struct fdlist *fdl;
|
||||
struct netconfig *newnconf;
|
||||
|
@ -167,7 +167,7 @@ find_service_pmap(rpcprog_t prog, rpcvers_t vers, rpcprot_t prot)
|
||||
}
|
||||
|
||||
static bool_t
|
||||
pmapproc_change(struct svc_req *rqstp, SVCXPRT *xprt, unsigned long op)
|
||||
pmapproc_change(struct svc_req *rqstp __unused, SVCXPRT *xprt, unsigned long op)
|
||||
{
|
||||
struct pmap reg;
|
||||
RPCB rpcbreg;
|
||||
@ -261,7 +261,7 @@ pmapproc_change(struct svc_req *rqstp, SVCXPRT *xprt, unsigned long op)
|
||||
|
||||
/* ARGSUSED */
|
||||
static bool_t
|
||||
pmapproc_getport(struct svc_req *rqstp, SVCXPRT *xprt)
|
||||
pmapproc_getport(struct svc_req *rqstp __unused, SVCXPRT *xprt)
|
||||
{
|
||||
struct pmap reg;
|
||||
long lport;
|
||||
@ -342,7 +342,7 @@ pmapproc_getport(struct svc_req *rqstp, SVCXPRT *xprt)
|
||||
|
||||
/* ARGSUSED */
|
||||
static bool_t
|
||||
pmapproc_dump(struct svc_req *rqstp, SVCXPRT *xprt)
|
||||
pmapproc_dump(struct svc_req *rqstp __unused, SVCXPRT *xprt)
|
||||
{
|
||||
if (!svc_getargs(xprt, (xdrproc_t)xdr_void, NULL)) {
|
||||
svcerr_decode(xprt);
|
||||
|
@ -198,11 +198,9 @@ rpcbs_rmtcall(rpcvers_t rtype, rpcproc_t rpcbproc, rpcprog_t prog,
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
void *
|
||||
rpcbproc_getstat(void *arg, struct svc_req *req, SVCXPRT *xprt,
|
||||
rpcvers_t versnum)
|
||||
rpcbproc_getstat(void *arg __unused, struct svc_req *req __unused,
|
||||
SVCXPRT *xprt __unused, rpcvers_t versnum __unused)
|
||||
{
|
||||
return (void *)&inf;
|
||||
}
|
||||
|
@ -204,8 +204,8 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp)
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void *
|
||||
rpcbproc_getaddr_3_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
rpcvers_t versnum)
|
||||
rpcbproc_getaddr_3_local(void *arg, struct svc_req *rqstp __unused,
|
||||
SVCXPRT *transp __unused, rpcvers_t versnum __unused)
|
||||
{
|
||||
RPCB *regp = (RPCB *)arg;
|
||||
#ifdef RPCBIND_DEBUG
|
||||
@ -226,8 +226,8 @@ rpcbproc_getaddr_3_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
|
||||
/* ARGSUSED */
|
||||
static void *
|
||||
rpcbproc_dump_3_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
rpcvers_t versnum)
|
||||
rpcbproc_dump_3_local(void *arg __unused, struct svc_req *rqstp __unused,
|
||||
SVCXPRT *transp __unused, rpcvers_t versnum __unused)
|
||||
{
|
||||
return ((void *)&list_rbl);
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp)
|
||||
/* ARGSUSED */
|
||||
static void *
|
||||
rpcbproc_getaddr_4_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
rpcvers_t rpcbversnum)
|
||||
rpcvers_t rpcbversnum __unused)
|
||||
{
|
||||
RPCB *regp = (RPCB *)arg;
|
||||
#ifdef RPCBIND_DEBUG
|
||||
@ -292,7 +292,7 @@ rpcbproc_getaddr_4_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
/* ARGSUSED */
|
||||
static void *
|
||||
rpcbproc_getversaddr_4_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
rpcvers_t versnum)
|
||||
rpcvers_t versnum __unused)
|
||||
{
|
||||
RPCB *regp = (RPCB *)arg;
|
||||
#ifdef RPCBIND_DEBUG
|
||||
@ -319,8 +319,8 @@ rpcbproc_getversaddr_4_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void *
|
||||
rpcbproc_getaddrlist_4_local(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
rpcvers_t versnum)
|
||||
rpcbproc_getaddrlist_4_local(void *arg, struct svc_req *rqstp __unused,
|
||||
SVCXPRT *transp, rpcvers_t versnum __unused)
|
||||
{
|
||||
RPCB *regp = (RPCB *)arg;
|
||||
static rpcb_entry_list_ptr rlist;
|
||||
@ -448,8 +448,8 @@ free_rpcb_entry_list(rpcb_entry_list_ptr *rlistp)
|
||||
|
||||
/* ARGSUSED */
|
||||
static void *
|
||||
rpcbproc_dump_4_local(void *arg, struct svc_req *req, SVCXPRT *xprt,
|
||||
rpcvers_t versnum)
|
||||
rpcbproc_dump_4_local(void *arg __unused, struct svc_req *req __unused,
|
||||
SVCXPRT *xprt __unused, rpcvers_t versnum __unused)
|
||||
{
|
||||
return ((void *)&list_rbl);
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ static int del_pmaplist __P((RPCB *));
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
void *
|
||||
rpcbproc_set_com(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
rpcbproc_set_com(void *arg, struct svc_req *rqstp __unused, SVCXPRT *transp,
|
||||
rpcvers_t rpcbversnum)
|
||||
{
|
||||
RPCB *regp = (RPCB *)arg;
|
||||
@ -209,7 +209,7 @@ map_set(RPCB *regp, char *owner)
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
void *
|
||||
rpcbproc_unset_com(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
rpcbproc_unset_com(void *arg, struct svc_req *rqstp __unused, SVCXPRT *transp,
|
||||
rpcvers_t rpcbversnum)
|
||||
{
|
||||
RPCB *regp = (RPCB *)arg;
|
||||
@ -284,7 +284,7 @@ map_unset(RPCB *regp, char *owner)
|
||||
}
|
||||
|
||||
void
|
||||
delete_prog(int prog)
|
||||
delete_prog(unsigned int prog)
|
||||
{
|
||||
RPCB reg;
|
||||
register rpcblist_ptr rbl;
|
||||
@ -303,8 +303,8 @@ delete_prog(int prog)
|
||||
}
|
||||
|
||||
void *
|
||||
rpcbproc_getaddr_com(RPCB *regp, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
rpcvers_t rpcbversnum, rpcvers_t verstype)
|
||||
rpcbproc_getaddr_com(RPCB *regp, struct svc_req *rqstp __unused,
|
||||
SVCXPRT *transp, rpcvers_t rpcbversnum, rpcvers_t verstype)
|
||||
{
|
||||
static char *uaddr;
|
||||
char *saddr = NULL;
|
||||
@ -346,8 +346,8 @@ rpcbproc_getaddr_com(RPCB *regp, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
|
||||
/* ARGSUSED */
|
||||
void *
|
||||
rpcbproc_gettime_com(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
rpcvers_t rpcbversnum)
|
||||
rpcbproc_gettime_com(void *arg __unused, struct svc_req *rqstp __unused,
|
||||
SVCXPRT *transp __unused, rpcvers_t rpcbversnum __unused)
|
||||
{
|
||||
static time_t curtime;
|
||||
|
||||
@ -361,8 +361,8 @@ rpcbproc_gettime_com(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
void *
|
||||
rpcbproc_uaddr2taddr_com(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
rpcvers_t rpcbversnum)
|
||||
rpcbproc_uaddr2taddr_com(void *arg, struct svc_req *rqstp __unused,
|
||||
SVCXPRT *transp, rpcvers_t rpcbversnum __unused)
|
||||
{
|
||||
char **uaddrp = (char **)arg;
|
||||
struct netconfig *nconf;
|
||||
@ -388,8 +388,8 @@ rpcbproc_uaddr2taddr_com(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
void *
|
||||
rpcbproc_taddr2uaddr_com(void *arg, struct svc_req *rqstp, SVCXPRT *transp,
|
||||
rpcvers_t rpcbversnum)
|
||||
rpcbproc_taddr2uaddr_com(void *arg, struct svc_req *rqstp __unused,
|
||||
SVCXPRT *transp, rpcvers_t rpcbversnum __unused)
|
||||
{
|
||||
struct netbuf *taddr = (struct netbuf *)arg;
|
||||
static char *uaddr;
|
||||
@ -1297,8 +1297,8 @@ static void
|
||||
find_versions(rpcprog_t prog, char *netid, rpcvers_t *lowvp, rpcvers_t *highvp)
|
||||
{
|
||||
register rpcblist_ptr rbl;
|
||||
int lowv = 0;
|
||||
int highv = 0;
|
||||
unsigned int lowv = 0;
|
||||
unsigned int highv = 0;
|
||||
|
||||
for (rbl = list_rbl; rbl != NULL; rbl = rbl->rpcb_next) {
|
||||
if ((rbl->rpcb_map.r_prog != prog) ||
|
||||
@ -1426,7 +1426,7 @@ del_pmaplist(RPCB *arg)
|
||||
{
|
||||
struct pmaplist *pml;
|
||||
struct pmaplist *prevpml, *fnd;
|
||||
long prot;
|
||||
unsigned long prot;
|
||||
|
||||
if (strcmp(arg->r_netid, udptrans) == 0) {
|
||||
/* It is UDP! */
|
||||
|
@ -60,6 +60,7 @@ static char sccsid[] = "@(#)rpcbind.c 1.35 89/04/21 Copyr 1984 Sun Micro";
|
||||
#ifdef PORTMAP
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <stdio.h>
|
||||
#include <netconfig.h>
|
||||
@ -644,7 +645,7 @@ rbllist_add(rpcprog_t prog, rpcvers_t vers, struct netconfig *nconf,
|
||||
* Catch the signal and die
|
||||
*/
|
||||
static void
|
||||
terminate(int dummy)
|
||||
terminate(int dummy __unused)
|
||||
{
|
||||
#ifdef WARMSTART
|
||||
syslog(LOG_ERR,
|
||||
@ -717,7 +718,7 @@ parseargs(int argc, char *argv[])
|
||||
}
|
||||
|
||||
void
|
||||
reap(int dummy)
|
||||
reap(int dummy __unused)
|
||||
{
|
||||
int save_errno = errno;
|
||||
|
||||
@ -727,7 +728,7 @@ reap(int dummy)
|
||||
}
|
||||
|
||||
void
|
||||
toggle_verboselog(int dummy)
|
||||
toggle_verboselog(int dummy __unused)
|
||||
{
|
||||
verboselog = !verboselog;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ void *rpcbproc_set_com __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
|
||||
void *rpcbproc_unset_com __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
|
||||
bool_t map_set __P((RPCB *, char *));
|
||||
bool_t map_unset __P((RPCB *, char *));
|
||||
void delete_prog __P((int));
|
||||
void delete_prog __P((unsigned int));
|
||||
void *rpcbproc_getaddr_com __P((RPCB *, struct svc_req *, SVCXPRT *, rpcvers_t,
|
||||
rpcvers_t));
|
||||
void *rpcbproc_gettime_com __P((void *, struct svc_req *, SVCXPRT *,
|
||||
@ -120,7 +120,7 @@ void rpcbind_abort __P((void));
|
||||
void reap __P((int));
|
||||
void toggle_verboselog __P((int));
|
||||
|
||||
int check_access __P((SVCXPRT *, rpcproc_t, void *, int));
|
||||
int check_access __P((SVCXPRT *, rpcproc_t, void *, unsigned int));
|
||||
int check_callit __P((SVCXPRT *, struct r_rmtcall_args *, int));
|
||||
void logit __P((int, struct sockaddr *, rpcproc_t, rpcprog_t, const char *));
|
||||
int is_loopback __P((struct netbuf *));
|
||||
|
@ -59,7 +59,7 @@ int log_severity = PORTMAP_LOG_FACILITY|PORTMAP_LOG_SEVERITY;
|
||||
extern int verboselog;
|
||||
|
||||
int
|
||||
check_access(SVCXPRT *xprt, rpcproc_t proc, void *args, int rpcbvers)
|
||||
check_access(SVCXPRT *xprt, rpcproc_t proc, void *args, unsigned int rpcbvers)
|
||||
{
|
||||
struct netbuf *caller = svc_getrpccaller(xprt);
|
||||
struct sockaddr *addr = (struct sockaddr *)caller->buf;
|
||||
@ -226,7 +226,7 @@ logit(int severity, struct sockaddr *addr, rpcproc_t procnum, rpcprog_t prognum,
|
||||
}
|
||||
|
||||
int
|
||||
check_callit(SVCXPRT *xprt, struct r_rmtcall_args *args, int versnum)
|
||||
check_callit(SVCXPRT *xprt, struct r_rmtcall_args *args, int versnum __unused)
|
||||
{
|
||||
struct sockaddr *sa = (struct sockaddr *)svc_getrpccaller(xprt)->buf;
|
||||
|
||||
|
@ -295,7 +295,8 @@ network_init()
|
||||
#ifdef INET6
|
||||
struct ifaddrs *ifap, *ifp;
|
||||
struct ipv6_mreq mreq6;
|
||||
int ifindex, s;
|
||||
unsigned int ifindex;
|
||||
int s;
|
||||
#endif
|
||||
int ecode;
|
||||
struct addrinfo hints, *res;
|
||||
|
Loading…
Reference in New Issue
Block a user