From 91d07af9fd70c714b0fea3eb2c393df6a95e175a Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Wed, 17 Apr 2019 17:57:19 +0200
Subject: [PATCH] WIP -Wcast-function-type

---
 include/rpc/xdr.h                 | 2 +-
 lib/libc/xdr/xdr.c                | 2 +-
 libexec/rpc.rstatd/rstat_proc.c   | 6 +++---
 libexec/rpc.rusersd/rusers_proc.c | 8 ++++----
 libexec/rpc.rwalld/rwalld.c       | 4 ++--
 usr.sbin/ypbind/ypbind.c          | 8 ++++----
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h
index 7481bc3a0a..de579daa82 100644
--- a/include/rpc/xdr.h
+++ b/include/rpc/xdr.h
@@ -279,7 +279,7 @@ struct xdr_discrim {
  * These are the "generic" xdr routines.
  */
 __BEGIN_DECLS
-extern bool_t	xdr_void(void);
+extern bool_t	xdr_void(XDR *, ...);
 extern bool_t	xdr_int(XDR *, int *);
 extern bool_t	xdr_u_int(XDR *, u_int *);
 extern bool_t	xdr_long(XDR *, long *);
diff --git a/lib/libc/xdr/xdr.c b/lib/libc/xdr/xdr.c
index 56223da1ff..05f1bac0a8 100644
--- a/lib/libc/xdr/xdr.c
+++ b/lib/libc/xdr/xdr.c
@@ -88,7 +88,7 @@ xdr_free(xdrproc_t proc, void *objp)
  * XDR nothing
  */
 bool_t
-xdr_void(void)
+xdr_void(XDR *xdrs __unused, ...)
 {
 
 	return (TRUE);
diff --git a/libexec/rpc.rstatd/rstat_proc.c b/libexec/rpc.rstatd/rstat_proc.c
index cfe93426fd..8943eccefa 100644
--- a/libexec/rpc.rstatd/rstat_proc.c
+++ b/libexec/rpc.rstatd/rstat_proc.c
@@ -389,7 +389,7 @@ rstat_service(struct svc_req *rqstp, SVCXPRT *transp)
 		int fill;
 	} argument;
 	char *result;
-	bool_t (*xdr_argument)(), (*xdr_result)();
+	xdrproc_t xdr_argument, xdr_result;
 	char *(*local)();
 
 	switch (rqstp->rq_proc) {
@@ -399,7 +399,7 @@ rstat_service(struct svc_req *rqstp, SVCXPRT *transp)
 
 	case RSTATPROC_STATS:
 		xdr_argument = xdr_void;
-		xdr_result = xdr_statstime;
+		xdr_result = (xdrproc_t)xdr_statstime;
                 switch (rqstp->rq_vers) {
                 case RSTATVERS_ORIG:
                         local = (char *(*)()) rstatproc_stats_1_svc;
@@ -419,7 +419,7 @@ rstat_service(struct svc_req *rqstp, SVCXPRT *transp)
 
 	case RSTATPROC_HAVEDISK:
 		xdr_argument = xdr_void;
-		xdr_result = xdr_u_int;
+		xdr_result = (xdrproc_t)xdr_u_int;
                 switch (rqstp->rq_vers) {
                 case RSTATVERS_ORIG:
                         local = (char *(*)()) rstatproc_havedisk_1_svc;
diff --git a/libexec/rpc.rusersd/rusers_proc.c b/libexec/rpc.rusersd/rusers_proc.c
index bbce3785d6..4cd952b794 100644
--- a/libexec/rpc.rusersd/rusers_proc.c
+++ b/libexec/rpc.rusersd/rusers_proc.c
@@ -311,7 +311,7 @@ rusers_service(struct svc_req *rqstp, SVCXPRT *transp)
 		int fill;
 	} argument;
 	char *result;
-	bool_t (*xdr_argument)(), (*xdr_result)();
+	xdrproc_t xdr_argument, xdr_result;
 	char *(*local)();
 
 	switch (rqstp->rq_proc) {
@@ -321,13 +321,13 @@ rusers_service(struct svc_req *rqstp, SVCXPRT *transp)
 
 	case RUSERSPROC_NUM:
 		xdr_argument = xdr_void;
-		xdr_result = xdr_int;
+		xdr_result = (xdrproc_t)xdr_int;
 		local = (char *(*)()) rusers_num;
 		break;
 
 	case RUSERSPROC_NAMES:
 		xdr_argument = xdr_void;
-		xdr_result = xdr_utmpidlearr;
+		xdr_result = (xdrproc_t)xdr_utmpidlearr;
 		switch (rqstp->rq_vers) {
 		case RUSERSVERS_ORIG:
 			local = (char *(*)()) rusersproc_names_1_svc;
@@ -344,7 +344,7 @@ rusers_service(struct svc_req *rqstp, SVCXPRT *transp)
 
 	case RUSERSPROC_ALLNAMES:
 		xdr_argument = xdr_void;
-		xdr_result = xdr_utmpidlearr;
+		xdr_result = (xdrproc_t)xdr_utmpidlearr;
 		switch (rqstp->rq_vers) {
 		case RUSERSVERS_ORIG:
 			local = (char *(*)()) rusersproc_allnames_1_svc;
diff --git a/libexec/rpc.rwalld/rwalld.c b/libexec/rpc.rwalld/rwalld.c
index 8929a7cf4d..252ceeac14 100644
--- a/libexec/rpc.rwalld/rwalld.c
+++ b/libexec/rpc.rwalld/rwalld.c
@@ -163,7 +163,7 @@ wallprog_1(struct svc_req *rqstp, SVCXPRT *transp)
 		char *wallproc_wall_1_arg;
 	} argument;
 	char *result;
-	bool_t (*xdr_argument)(), (*xdr_result)();
+	xdrproc_t xdr_argument, xdr_result;
 	char *(*local)();
 
 	switch (rqstp->rq_proc) {
@@ -172,7 +172,7 @@ wallprog_1(struct svc_req *rqstp, SVCXPRT *transp)
 		goto leave;
 
 	case WALLPROC_WALL:
-		xdr_argument = xdr_wrapstring;
+		xdr_argument = (xdrproc_t)xdr_wrapstring;
 		xdr_result = xdr_void;
 		local = (char *(*)()) wallproc_wall_1_svc;
 		break;
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c
index 0f5e4c65df..31b00d13db 100644
--- a/usr.sbin/ypbind/ypbind.c
+++ b/usr.sbin/ypbind/ypbind.c
@@ -286,7 +286,7 @@ ypbindprog_2(struct svc_req *rqstp, SVCXPRT *transp)
 	} argument;
 	struct authunix_parms *creds;
 	char *result;
-	bool_t (*xdr_argument)(), (*xdr_result)();
+	xdrproc_t xdr_argument, xdr_result;
 	char *(*local)();
 
 	switch (rqstp->rq_proc) {
@@ -297,8 +297,8 @@ ypbindprog_2(struct svc_req *rqstp, SVCXPRT *transp)
 		break;
 
 	case YPBINDPROC_DOMAIN:
-		xdr_argument = xdr_domainname;
-		xdr_result = xdr_ypbind_resp;
+		xdr_argument = (xdrproc_t)xdr_domainname;
+		xdr_result = (xdrproc_t)xdr_ypbind_resp;
 		local = (char *(*)()) ypbindproc_domain_2_yp;
 		break;
 
@@ -316,7 +316,7 @@ ypbindprog_2(struct svc_req *rqstp, SVCXPRT *transp)
 			return;
 		}
 
-		xdr_argument = xdr_ypbind_setdom;
+		xdr_argument = (xdrproc_t)xdr_ypbind_setdom;
 		xdr_result = xdr_void;
 		local = (char *(*)()) ypbindproc_setdom_2_yp;
 		break;
-- 
2.21.0

