From: Steve Dickson <steved@redhat.com>
To: Libtirpc-devel Mailing List <libtirpc-devel@lists.sourceforge.net>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH 10/12] Convert old-style function definitions into modern-style definitions
Date: Thu, 21 Aug 2025 07:15:21 -0400 [thread overview]
Message-ID: <20250821111524.1379577-11-steved@redhat.com> (raw)
In-Reply-To: <20250821111524.1379577-1-steved@redhat.com>
With newer compilers (gcc 15.1.1) -Wold-style-definition
flag is set by default which causes warnings for
most of the functions in these files.
warning: old-style function definition [-Wold-style-definition]
The warnings are remove by converting the old-style
function definitions into modern-style definitions
Signed-off-by: Steve Dickson <steved@redhat.com>
---
src/clnt_bcast.c | 46 ++++++++++++++---------------
src/clnt_dg.c | 59 +++++++++++++++++--------------------
src/clnt_perror.c | 23 +++++----------
src/clnt_raw.c | 46 +++++++++++++----------------
src/clnt_simple.c | 19 ++++++------
src/clnt_vc.c | 75 ++++++++++++++++++++++-------------------------
6 files changed, 121 insertions(+), 147 deletions(-)
diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c
index 2ad6c89..1103b36 100644
--- a/src/clnt_bcast.c
+++ b/src/clnt_bcast.c
@@ -257,19 +257,18 @@ __ipv6v4_fixup(struct sockaddr_storage *ss, const char *uaddr)
}
enum clnt_stat
-rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
- eachresult, inittime, waittime, nettype)
- rpcprog_t prog; /* program number */
- rpcvers_t vers; /* version number */
- rpcproc_t proc; /* procedure number */
- xdrproc_t xargs; /* xdr routine for args */
- caddr_t argsp; /* pointer to args */
- xdrproc_t xresults; /* xdr routine for results */
- caddr_t resultsp; /* pointer to results */
- resultproc_t eachresult; /* call with each result obtained */
- int inittime; /* how long to wait initially */
- int waittime; /* maximum time to wait */
- const char *nettype; /* transport type */
+rpc_broadcast_exp(
+ rpcprog_t prog, /* program number */
+ rpcvers_t vers, /* version number */
+ rpcproc_t proc, /* procedure number */
+ xdrproc_t xargs, /* xdr routine for args */
+ caddr_t argsp, /* pointer to args */
+ xdrproc_t xresults, /* xdr routine for results */
+ caddr_t resultsp, /* pointer to results */
+ resultproc_t eachresult, /* call with each result obtained */
+ int inittime, /* how long to wait initially */
+ int waittime, /* maximum time to wait */
+ const char *nettype) /* transport type */
{
enum clnt_stat stat = RPC_SUCCESS; /* Return status */
XDR xdr_stream; /* XDR stream */
@@ -677,17 +676,16 @@ done_broad:
enum clnt_stat
-rpc_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp,
- eachresult, nettype)
- rpcprog_t prog; /* program number */
- rpcvers_t vers; /* version number */
- rpcproc_t proc; /* procedure number */
- xdrproc_t xargs; /* xdr routine for args */
- caddr_t argsp; /* pointer to args */
- xdrproc_t xresults; /* xdr routine for results */
- caddr_t resultsp; /* pointer to results */
- resultproc_t eachresult; /* call with each result obtained */
- const char *nettype; /* transport type */
+rpc_broadcast(
+ rpcprog_t prog, /* program number */
+ rpcvers_t vers, /* version number */
+ rpcproc_t proc, /* procedure number */
+ xdrproc_t xargs, /* xdr routine for args */
+ caddr_t argsp, /* pointer to args */
+ xdrproc_t xresults, /* xdr routine for results */
+ caddr_t resultsp, /* pointer to results */
+ resultproc_t eachresult, /* call with each result obtained */
+ const char *nettype) /* transport type */
{
enum clnt_stat dummy;
diff --git a/src/clnt_dg.c b/src/clnt_dg.c
index 166af63..526a0b5 100644
--- a/src/clnt_dg.c
+++ b/src/clnt_dg.c
@@ -149,13 +149,13 @@ struct cu_data {
* If svcaddr is NULL, returns NULL.
*/
CLIENT *
-clnt_dg_create(fd, svcaddr, program, version, sendsz, recvsz)
- int fd; /* open file descriptor */
- const struct netbuf *svcaddr; /* servers address */
- rpcprog_t program; /* program number */
- rpcvers_t version; /* version number */
- u_int sendsz; /* buffer recv size */
- u_int recvsz; /* buffer send size */
+clnt_dg_create(
+ int fd, /* open file descriptor */
+ const struct netbuf *svcaddr, /* servers address */
+ rpcprog_t program, /* program number */
+ rpcvers_t version, /* version number */
+ u_int sendsz, /* buffer recv size */
+ u_int recvsz) /* buffer send size */
{
CLIENT *cl = NULL; /* client handle */
struct cu_data *cu = NULL; /* private data */
@@ -282,14 +282,14 @@ err2:
}
static enum clnt_stat
-clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
- CLIENT *cl; /* client handle */
- rpcproc_t proc; /* procedure number */
- xdrproc_t xargs; /* xdr routine for args */
- void *argsp; /* pointer to args */
- xdrproc_t xresults; /* xdr routine for results */
- void *resultsp; /* pointer to results */
- struct timeval utimeout; /* seconds to wait before giving up */
+clnt_dg_call(
+ CLIENT *cl, /* client handle */
+ rpcproc_t proc, /* procedure number */
+ xdrproc_t xargs, /* xdr routine for args */
+ void *argsp, /* pointer to args */
+ xdrproc_t xresults, /* xdr routine for results */
+ void *resultsp, /* pointer to results */
+ struct timeval utimeout) /* seconds to wait before giving up */
{
struct cu_data *cu = (struct cu_data *)cl->cl_private;
XDR *xdrs;
@@ -549,9 +549,7 @@ out:
}
static void
-clnt_dg_geterr(cl, errp)
- CLIENT *cl;
- struct rpc_err *errp;
+clnt_dg_geterr(CLIENT *cl, struct rpc_err *errp)
{
struct cu_data *cu = (struct cu_data *)cl->cl_private;
@@ -559,10 +557,10 @@ clnt_dg_geterr(cl, errp)
}
static bool_t
-clnt_dg_freeres(cl, xdr_res, res_ptr)
- CLIENT *cl;
- xdrproc_t xdr_res;
- void *res_ptr;
+clnt_dg_freeres(
+ CLIENT *cl,
+ xdrproc_t xdr_res,
+ void *res_ptr)
{
struct cu_data *cu = (struct cu_data *)cl->cl_private;
XDR *xdrs = &(cu->cu_outxdrs);
@@ -587,16 +585,15 @@ clnt_dg_freeres(cl, xdr_res, res_ptr)
/*ARGSUSED*/
static void
-clnt_dg_abort(h)
- CLIENT *h;
+clnt_dg_abort(CLIENT *h)
{
}
static bool_t
-clnt_dg_control(cl, request, info)
- CLIENT *cl;
- u_int request;
- void *info;
+clnt_dg_control(
+ CLIENT *cl,
+ u_int request,
+ void *info)
{
struct cu_data *cu = (struct cu_data *)cl->cl_private;
struct netbuf *addr;
@@ -735,8 +732,7 @@ clnt_dg_control(cl, request, info)
}
static void
-clnt_dg_destroy(cl)
- CLIENT *cl;
+clnt_dg_destroy(CLIENT *cl)
{
struct cu_data *cu = (struct cu_data *)cl->cl_private;
int cu_fd = cu->cu_fd;
@@ -800,8 +796,7 @@ clnt_dg_ops()
* Make sure that the time is not garbage. -1 value is allowed.
*/
static bool_t
-time_not_ok(t)
- struct timeval *t;
+time_not_ok(struct timeval *t)
{
return (t->tv_sec < -1 || t->tv_sec > 100000000 ||
t->tv_usec < -1 || t->tv_usec > 1000000);
diff --git a/src/clnt_perror.c b/src/clnt_perror.c
index fb7fb80..7c2ec21 100644
--- a/src/clnt_perror.c
+++ b/src/clnt_perror.c
@@ -60,9 +60,7 @@ _buf()
* Print reply error info
*/
char *
-clnt_sperror(rpch, s)
- CLIENT *rpch;
- const char *s;
+clnt_sperror(CLIENT *rpch, const char *s)
{
struct rpc_err e;
char *err;
@@ -174,9 +172,7 @@ clnt_sperror(rpch, s)
}
void
-clnt_perror(rpch, s)
- CLIENT *rpch;
- const char *s;
+clnt_perror(CLIENT *rpch, const char *s)
{
if (rpch == NULL || s == NULL)
@@ -211,8 +207,7 @@ static const char *const rpc_errlist[] = {
* This interface for use by clntrpc
*/
char *
-clnt_sperrno(stat)
- enum clnt_stat stat;
+clnt_sperrno(enum clnt_stat stat)
{
unsigned int errnum = stat;
@@ -224,16 +219,14 @@ clnt_sperrno(stat)
}
void
-clnt_perrno(num)
- enum clnt_stat num;
+clnt_perrno(enum clnt_stat num)
{
(void) fprintf(stderr, "%s\n", clnt_sperrno(num));
}
char *
-clnt_spcreateerror(s)
- const char *s;
+clnt_spcreateerror(const char *s)
{
char *str, *err;
size_t len, i;
@@ -300,8 +293,7 @@ clnt_spcreateerror(s)
}
void
-clnt_pcreateerror(s)
- const char *s;
+clnt_pcreateerror(const char *s)
{
if (s == NULL)
@@ -322,8 +314,7 @@ static const char *const auth_errlist[] = {
};
static char *
-auth_errmsg(stat)
- enum auth_stat stat;
+auth_errmsg(enum auth_stat stat)
{
unsigned int errnum = stat;
diff --git a/src/clnt_raw.c b/src/clnt_raw.c
index 03f839d..4e00a76 100644
--- a/src/clnt_raw.c
+++ b/src/clnt_raw.c
@@ -77,9 +77,7 @@ static struct clnt_ops *clnt_raw_ops(void);
* Create a client handle for memory based rpc.
*/
CLIENT *
-clnt_raw_create(prog, vers)
- rpcprog_t prog;
- rpcvers_t vers;
+clnt_raw_create(rpcprog_t prog, rpcvers_t vers)
{
struct clntraw_private *clp;
struct rpc_msg call_msg;
@@ -132,14 +130,14 @@ clnt_raw_create(prog, vers)
/* ARGSUSED */
static enum clnt_stat
-clnt_raw_call(h, proc, xargs, argsp, xresults, resultsp, timeout)
- CLIENT *h;
- rpcproc_t proc;
- xdrproc_t xargs;
- void *argsp;
- xdrproc_t xresults;
- void *resultsp;
- struct timeval timeout;
+clnt_raw_call(
+ CLIENT *h,
+ rpcproc_t proc,
+ xdrproc_t xargs,
+ void *argsp,
+ xdrproc_t xresults,
+ void *resultsp,
+ struct timeval timeout)
{
struct clntraw_private *clp = clntraw_private;
XDR *xdrs;
@@ -231,19 +229,17 @@ call_again:
/*ARGSUSED*/
static void
-clnt_raw_geterr(cl, err)
- CLIENT *cl;
- struct rpc_err *err;
+clnt_raw_geterr(CLIENT *cl, struct rpc_err *err)
{
}
/* ARGSUSED */
static bool_t
-clnt_raw_freeres(cl, xdr_res, res_ptr)
- CLIENT *cl;
- xdrproc_t xdr_res;
- void *res_ptr;
+clnt_raw_freeres(
+ CLIENT *cl,
+ xdrproc_t xdr_res,
+ void *res_ptr)
{
struct clntraw_private *clp = clntraw_private;
XDR *xdrs;
@@ -263,25 +259,23 @@ clnt_raw_freeres(cl, xdr_res, res_ptr)
/*ARGSUSED*/
static void
-clnt_raw_abort(cl)
- CLIENT *cl;
+clnt_raw_abort(CLIENT *cl)
{
}
/*ARGSUSED*/
static bool_t
-clnt_raw_control(cl, ui, str)
- CLIENT *cl;
- u_int ui;
- void *str;
+clnt_raw_control(
+ CLIENT *cl,
+ u_int ui,
+ void *str)
{
return (FALSE);
}
/*ARGSUSED*/
static void
-clnt_raw_destroy(cl)
- CLIENT *cl;
+clnt_raw_destroy(CLIENT *cl)
{
}
diff --git a/src/clnt_simple.c b/src/clnt_simple.c
index 1700060..b0e29ba 100644
--- a/src/clnt_simple.c
+++ b/src/clnt_simple.c
@@ -87,15 +87,16 @@ rpc_call_destroy(void *vp)
* The total time available is 25 seconds.
*/
enum clnt_stat
-rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype)
- const char *host; /* host name */
- rpcprog_t prognum; /* program number */
- rpcvers_t versnum; /* version number */
- rpcproc_t procnum; /* procedure number */
- xdrproc_t inproc, outproc; /* in/out XDR procedures */
- const char *in;
- char *out; /* recv/send data */
- const char *nettype; /* nettype */
+rpc_call(
+ const char *host, /* host name */
+ rpcprog_t prognum, /* program number */
+ rpcvers_t versnum, /* version number */
+ rpcproc_t procnum, /* procedure number */
+ xdrproc_t inproc, /* recv data */
+ const char *in, /* recv XDR data */
+ xdrproc_t outproc, /* out XDR procedures */
+ char *out, /* send data */
+ const char *nettype) /* nettype */
{
struct rpc_call_private *rcp = (struct rpc_call_private *) 0;
enum clnt_stat clnt_stat;
diff --git a/src/clnt_vc.c b/src/clnt_vc.c
index 5bbc78b..e94313b 100644
--- a/src/clnt_vc.c
+++ b/src/clnt_vc.c
@@ -175,13 +175,13 @@ static const char __no_mem_str[] = "out of memory";
* fd should be an open socket
*/
CLIENT *
-clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz)
- int fd; /* open file descriptor */
- const struct netbuf *raddr; /* servers address */
- const rpcprog_t prog; /* program number */
- const rpcvers_t vers; /* version number */
- u_int sendsz; /* buffer recv size */
- u_int recvsz; /* buffer send size */
+clnt_vc_create(
+ int fd, /* open file descriptor */
+ const struct netbuf *raddr, /* servers address */
+ const rpcprog_t prog, /* program number */
+ const rpcvers_t vers, /* version number */
+ u_int sendsz, /* buffer recv size */
+ u_int recvsz) /* buffer send size */
{
CLIENT *cl; /* client handle */
struct ct_data *ct = NULL; /* client handle */
@@ -335,14 +335,14 @@ err:
}
static enum clnt_stat
-clnt_vc_call(cl, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
- CLIENT *cl;
- rpcproc_t proc;
- xdrproc_t xdr_args;
- void *args_ptr;
- xdrproc_t xdr_results;
- void *results_ptr;
- struct timeval timeout;
+clnt_vc_call(
+ CLIENT *cl,
+ rpcproc_t proc,
+ xdrproc_t xdr_args,
+ void *args_ptr,
+ xdrproc_t xdr_results,
+ void *results_ptr,
+ struct timeval timeout)
{
struct ct_data *ct = (struct ct_data *) cl->cl_private;
XDR *xdrs = &(ct->ct_xdrs);
@@ -464,9 +464,7 @@ call_again:
}
static void
-clnt_vc_geterr(cl, errp)
- CLIENT *cl;
- struct rpc_err *errp;
+clnt_vc_geterr(CLIENT *cl, struct rpc_err *errp)
{
struct ct_data *ct;
@@ -478,10 +476,10 @@ clnt_vc_geterr(cl, errp)
}
static bool_t
-clnt_vc_freeres(cl, xdr_res, res_ptr)
- CLIENT *cl;
- xdrproc_t xdr_res;
- void *res_ptr;
+clnt_vc_freeres(
+ CLIENT *cl,
+ xdrproc_t xdr_res,
+ void *res_ptr)
{
struct ct_data *ct;
XDR *xdrs;
@@ -512,16 +510,15 @@ clnt_vc_freeres(cl, xdr_res, res_ptr)
/*ARGSUSED*/
static void
-clnt_vc_abort(cl)
- CLIENT *cl;
+clnt_vc_abort(CLIENT *cl)
{
}
static bool_t
-clnt_vc_control(cl, request, info)
- CLIENT *cl;
- u_int request;
- void *info;
+clnt_vc_control(
+ CLIENT *cl,
+ u_int request,
+ void *info)
{
struct ct_data *ct;
void *infop = info;
@@ -647,8 +644,7 @@ clnt_vc_control(cl, request, info)
static void
-clnt_vc_destroy(cl)
- CLIENT *cl;
+clnt_vc_destroy(CLIENT *cl)
{
assert(cl != NULL);
struct ct_data *ct = (struct ct_data *) cl->cl_private;
@@ -692,10 +688,10 @@ clnt_vc_destroy(cl)
* around for the rpc level.
*/
static int
-read_vc(ctp, buf, len)
- void *ctp;
- void *buf;
- int len;
+read_vc(
+ void *ctp,
+ void *buf,
+ int len)
{
/*
struct sockaddr sa;
@@ -745,10 +741,10 @@ read_vc(ctp, buf, len)
}
static int
-write_vc(ctp, buf, len)
- void *ctp;
- void *buf;
- int len;
+write_vc(
+ void *ctp,
+ void *buf,
+ int len)
{
struct ct_data *ct = (struct ct_data *)ctp;
int i = 0, cnt;
@@ -793,8 +789,7 @@ clnt_vc_ops()
* Note this is different from time_not_ok in clnt_dg.c
*/
static bool_t
-time_not_ok(t)
- struct timeval *t;
+time_not_ok(struct timeval *t)
{
return (t->tv_sec <= -1 || t->tv_sec > 100000000 ||
t->tv_usec <= -1 || t->tv_usec > 1000000);
--
2.50.1
next prev parent reply other threads:[~2025-08-21 11:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 11:15 [PATCH 00/12] Convert old-style function definitions into modern-style definitions Steve Dickson
2025-08-21 11:15 ` [PATCH 01/12] " Steve Dickson
2025-08-21 11:15 ` [PATCH 02/12] " Steve Dickson
2025-08-21 11:15 ` [PATCH 03/12] " Steve Dickson
2025-08-21 11:15 ` [PATCH 04/12] " Steve Dickson
2025-08-21 11:15 ` [PATCH 05/12] " Steve Dickson
2025-08-21 11:15 ` [PATCH 06/12] " Steve Dickson
2025-08-21 11:15 ` [PATCH 07/12] " Steve Dickson
2025-08-21 11:15 ` [PATCH 08/12] " Steve Dickson
2025-08-21 11:15 ` [PATCH 09/12] " Steve Dickson
2025-08-21 11:15 ` Steve Dickson [this message]
2025-08-21 11:15 ` [PATCH 11/12] " Steve Dickson
2025-08-21 11:15 ` [PATCH 12/12] " Steve Dickson
-- strict thread matches above, loose matches on Subject: below --
2025-08-18 15:08 [PATCH 00/12] " Steve Dickson
2025-08-18 15:08 ` [PATCH 10/12] " Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250821111524.1379577-11-steved@redhat.com \
--to=steved@redhat.com \
--cc=libtirpc-devel@lists.sourceforge.net \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).