From nobody Tue Apr 18 18:31:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q1CDr0mYCz45Tgj; Tue, 18 Apr 2023 18:31:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q1CDq6FnGz41sJ; Tue, 18 Apr 2023 18:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681842699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L887RBjE9vHGnsUujwos0yjwKyBHlc6hME1+fsFUAbU=; b=E3MSLvAUQ4U7sIGm83QAQrLs0nvoQB2d9tjzBBv1gzVnG63fA17qyUxqsUVCtTznDKHZIn NwzqvEIKwve6HWmeymKmCL3xqI5LOLvkmRRRvjNikCmsq4Pub97ZwYBl9xsLzpznHctHe3 fx0B4Pk3ZdKTufjdXGEOiqNgsT9P/HdZ3PL4n5s5FH7iCQDM7B+9uMih0v5A2G3t8oSX/m n5CUs0E8U2aj0vAuL9MbCTeap5NYJLYrluPBSTDUOjv8+EVeFdc/tx58Ime1UHd7SLBpcp DCm4zaLAbNElAzTxfb6SdsQn0E6ZK84rRfwel5gcCAbkReIj6wzdRtEYSeLcMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681842699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L887RBjE9vHGnsUujwos0yjwKyBHlc6hME1+fsFUAbU=; b=uPtDPgr5SWHT4vrVKPJ0PuA7dfG7vdhgkA5fyAla/ZRkgkWqWkZC02/VlYPw81KutWz7Ow 0XsiDdiyaCSHg3kMeUwPCymCEWUa4wzSexcKoIwYRobJ5R95TuZBEGuY7Xx8jeaII0hyzw bsUC/OLU0+p0fOOBQBAwz3ld91Sm+nWmudmlCW9je7QZNTX5UQqy9jx1ivUNjD4iMheUSh gNYAKpM92Uam6X4BAYQdISZuVw7N8FuePKuoDsHLGodbQmkhEolSDHrgrEeH65Comz0Chy ICXv7QKkQI4S+epyT+jPtNh0n2OzPkxbpJYgGIAa6BufwM0WKph+zPTY3i+Sbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681842699; a=rsa-sha256; cv=none; b=wc+7DGt2MMqwZDqCwBauIIP+Ngs/4+dToLncmPuyd6e3UkL6D8GFL0+4AioTXYZZQSDtvB 6yUfn4/5Pw31v1628T+oRQsG7JFNc8SxirI2WEigyVQRmec7bhJmFqpJXA4HQ7ts2c1AAN qQ8zAtxnP/SgNg72mcjeebmEXdn3vxqZ7RmAuh8rX+e6XZI28iAOAPscKLHsUjAavKFipk JaHVsFIRtULrbEZyKYXzynz7nL+7XiKefW5xexLppbPDoWftPbOlfw46jpNjr6Pj8yQ2H2 wAzxHWynFoD5PC16SQ6//gfz4SjvnOOXn8N2XzDNdP7hts69GCo/u7dtGMfVpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q1CDq57gLzNKL; Tue, 18 Apr 2023 18:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33IIVd2R028460; Tue, 18 Apr 2023 18:31:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33IIVd2e028459; Tue, 18 Apr 2023 18:31:39 GMT (envelope-from git) Date: Tue, 18 Apr 2023 18:31:39 GMT Message-Id: <202304181831.33IIVd2e028459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 69b503873858 - main - yp: Use more accurate function pointer types. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69b50387385884fdc5903e163f3eaa880f394471 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=69b50387385884fdc5903e163f3eaa880f394471 commit 69b50387385884fdc5903e163f3eaa880f394471 Author: John Baldwin AuthorDate: 2023-04-18 18:28:57 +0000 Commit: John Baldwin CommitDate: 2023-04-18 18:28:57 +0000 yp: Use more accurate function pointer types. Trim a few duplicate (but incomplete) function prototypes as well. Reviewed by: zlei, imp Differential Revision: https://reviews.freebsd.org/D39532 --- usr.sbin/ypbind/ypbind.c | 34 ++++++++++++++++------------------ usr.sbin/ypserv/common/yplib_host.c | 4 ++-- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index 60d439d32f09..357e35a9a7b6 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -91,10 +91,6 @@ struct _dom_binding { #define WRITEFD ypdb->dom_pipe_fds[1] #define BROADFD broad_domain->dom_pipe_fds[1] -extern bool_t xdr_domainname(), xdr_ypbind_resp(); -extern bool_t xdr_ypreq_key(), xdr_ypresp_val(); -extern bool_t xdr_ypbind_setdom(); - void checkwork(void); void *ypbindproc_null_2_yp(SVCXPRT *, void *, CLIENT *); void *ypbindproc_setdom_2_yp(SVCXPRT *, struct ypbind_setdom *, CLIENT *); @@ -301,21 +297,23 @@ ypbindprog_2(struct svc_req *rqstp, register SVCXPRT *transp) struct ypbind_setdom ypbindproc_setdom_2_arg; } argument; struct authunix_parms *creds; - char *result; - bool_t (*xdr_argument)(), (*xdr_result)(); - char *(*local)(); + void *result; + xdrproc_t xdr_argument, xdr_result; + typedef void *(svc_cb)(SVCXPRT *transp, void *arg, + struct svc_req *rqstp); + svc_cb *local; switch (rqstp->rq_proc) { case YPBINDPROC_NULL: - xdr_argument = xdr_void; - xdr_result = xdr_void; - local = (char *(*)()) ypbindproc_null_2_yp; + xdr_argument = (xdrproc_t)xdr_void; + xdr_result = (xdrproc_t)xdr_void; + local = (svc_cb *)ypbindproc_null_2_yp; break; case YPBINDPROC_DOMAIN: - xdr_argument = xdr_domainname; - xdr_result = xdr_ypbind_resp; - local = (char *(*)()) ypbindproc_domain_2_yp; + xdr_argument = (xdrproc_t)xdr_domainname; + xdr_result = (xdrproc_t)xdr_ypbind_resp; + local = (svc_cb *)ypbindproc_domain_2_yp; break; case YPBINDPROC_SETDOM: @@ -332,9 +330,9 @@ ypbindprog_2(struct svc_req *rqstp, register SVCXPRT *transp) return; } - xdr_argument = xdr_ypbind_setdom; - xdr_result = xdr_void; - local = (char *(*)()) ypbindproc_setdom_2_yp; + xdr_argument = (xdrproc_t)xdr_ypbind_setdom; + xdr_result = (xdrproc_t)xdr_void; + local = (svc_cb *)ypbindproc_setdom_2_yp; break; default: @@ -342,13 +340,13 @@ ypbindprog_2(struct svc_req *rqstp, register SVCXPRT *transp) return; } bzero(&argument, sizeof(argument)); - if (!svc_getargs(transp, (xdrproc_t)xdr_argument, &argument)) { + if (!svc_getargs(transp, xdr_argument, &argument)) { svcerr_decode(transp); return; } result = (*local)(transp, &argument, rqstp); if (result != NULL && - !svc_sendreply(transp, (xdrproc_t)xdr_result, result)) { + !svc_sendreply(transp, xdr_result, result)) { svcerr_systemerr(transp); } return; diff --git a/usr.sbin/ypserv/common/yplib_host.c b/usr.sbin/ypserv/common/yplib_host.c index 05b6e961314a..dfdfda22ffc8 100644 --- a/usr.sbin/ypserv/common/yplib_host.c +++ b/usr.sbin/ypserv/common/yplib_host.c @@ -54,10 +54,10 @@ __FBSDID("$FreeBSD$"); #include "yplib_host.h" +extern bool_t xdr_ypresp_all_seq(XDR *, unsigned long *); + extern int (*ypresp_allfn)(u_long, char *, int, char *, int, void *); extern void *ypresp_data; -extern bool_t xdr_ypreq_key(), xdr_ypresp_val(); -extern bool_t xdr_ypresp_all_seq(); static int _yplib_host_timeout = 10;