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 06/12] Convert old-style function definitions into modern-style definitions
Date: Mon, 18 Aug 2025 11:08:23 -0400 [thread overview]
Message-ID: <20250818150829.1044948-7-steved@redhat.com> (raw)
In-Reply-To: <20250818150829.1044948-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/pmap_getmaps.c | 3 +--
src/pmap_getport.c | 10 +++++-----
src/pmap_prot.c | 4 +---
src/pmap_prot2.c | 8 ++------
src/pmap_rmt.c | 31 +++++++++++++++++--------------
5 files changed, 26 insertions(+), 30 deletions(-)
diff --git a/src/pmap_getmaps.c b/src/pmap_getmaps.c
index 853f724..61e3dcf 100644
--- a/src/pmap_getmaps.c
+++ b/src/pmap_getmaps.c
@@ -60,8 +60,7 @@
* Calls the pmap service remotely to do get the maps.
*/
struct pmaplist *
-pmap_getmaps(address)
- struct sockaddr_in *address;
+pmap_getmaps(struct sockaddr_in *address)
{
struct pmaplist *head = NULL;
int sock = -1;
diff --git a/src/pmap_getport.c b/src/pmap_getport.c
index 72853a0..7687030 100644
--- a/src/pmap_getport.c
+++ b/src/pmap_getport.c
@@ -54,11 +54,11 @@ static const struct timeval tottimeout = { 60, 0 };
* Returns 0 if no map exists.
*/
u_short
-pmap_getport(address, program, version, protocol)
- struct sockaddr_in *address;
- u_long program;
- u_long version;
- u_int protocol;
+pmap_getport(
+ struct sockaddr_in *address,
+ u_long program,
+ u_long version,
+ u_int protocol)
{
u_short port = 0;
int sock = -1;
diff --git a/src/pmap_prot.c b/src/pmap_prot.c
index c0a642b..2445c65 100644
--- a/src/pmap_prot.c
+++ b/src/pmap_prot.c
@@ -41,9 +41,7 @@
bool_t
-xdr_pmap(xdrs, regs)
- XDR *xdrs;
- struct pmap *regs;
+xdr_pmap(XDR *xdrs, struct pmap *regs)
{
assert(xdrs != NULL);
diff --git a/src/pmap_prot2.c b/src/pmap_prot2.c
index 5583ff0..bbac74f 100644
--- a/src/pmap_prot2.c
+++ b/src/pmap_prot2.c
@@ -79,9 +79,7 @@
* this sounds like a job for xdr_reference!
*/
bool_t
-xdr_pmaplist(xdrs, rp)
- XDR *xdrs;
- struct pmaplist **rp;
+xdr_pmaplist(XDR *xdrs, struct pmaplist **rp)
{
/*
* more_elements is pre-computed in case the direction is
@@ -123,9 +121,7 @@ xdr_pmaplist(xdrs, rp)
* functionality to xdr_pmaplist().
*/
bool_t
-xdr_pmaplist_ptr(xdrs, rp)
- XDR *xdrs;
- struct pmaplist *rp;
+xdr_pmaplist_ptr(XDR *xdrs, struct pmaplist *rp)
{
return xdr_pmaplist(xdrs, (struct pmaplist **)(void *)rp);
}
diff --git a/src/pmap_rmt.c b/src/pmap_rmt.c
index 1c76114..bfa694d 100644
--- a/src/pmap_rmt.c
+++ b/src/pmap_rmt.c
@@ -69,14 +69,17 @@ static const struct timeval timeout = { 3, 0 };
* programs to do a lookup and call in one step.
*/
enum clnt_stat
-pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout,
- port_ptr)
- struct sockaddr_in *addr;
- u_long prog, vers, proc;
- xdrproc_t xdrargs, xdrres;
- caddr_t argsp, resp;
- struct timeval tout;
- u_long *port_ptr;
+pmap_rmtcall(
+ struct sockaddr_in *addr,
+ u_long prog,
+ u_long vers,
+ u_long proc,
+ xdrproc_t xdrargs,
+ caddr_t argsp,
+ xdrproc_t xdrres,
+ caddr_t resp,
+ struct timeval tout,
+ u_long *port_ptr)
{
int sock = -1;
CLIENT *client;
@@ -115,9 +118,9 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout,
* written for XDR_ENCODE direction only
*/
bool_t
-xdr_rmtcall_args(xdrs, cap)
- XDR *xdrs;
- struct rmtcallargs *cap;
+xdr_rmtcall_args(
+ XDR *xdrs,
+ struct rmtcallargs *cap)
{
u_int lenposition, argposition, position;
@@ -149,9 +152,9 @@ xdr_rmtcall_args(xdrs, cap)
* written for XDR_DECODE direction only
*/
bool_t
-xdr_rmtcallres(xdrs, crp)
- XDR *xdrs;
- struct rmtcallres *crp;
+xdr_rmtcallres(
+ XDR *xdrs,
+ struct rmtcallres *crp)
{
caddr_t port_ptr;
--
2.50.1
next prev parent reply other threads:[~2025-08-18 15:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-18 15:08 [PATCH 00/12] Convert old-style function definitions into modern-style definitions Steve Dickson
2025-08-18 15:08 ` [PATCH 01/12] " Steve Dickson
2025-08-21 12:24 ` [Libtirpc-devel] " Steve Dickson
2025-08-25 15:05 ` Steve Dickson
2025-08-18 15:08 ` [PATCH 02/12] " Steve Dickson
2025-08-18 15:08 ` [PATCH 03/12] " Steve Dickson
2025-08-18 15:08 ` [PATCH 04/12] " Steve Dickson
2025-08-18 15:08 ` [PATCH 05/12] " Steve Dickson
2025-08-18 15:08 ` Steve Dickson [this message]
2025-08-18 15:08 ` [PATCH 07/12] " Steve Dickson
2025-08-18 15:08 ` [PATCH 08/12] " Steve Dickson
2025-08-18 15:08 ` [PATCH 09/12] " Steve Dickson
2025-08-18 15:08 ` [PATCH 10/12] " Steve Dickson
2025-08-18 15:08 ` [PATCH 11/12] " Steve Dickson
2025-08-18 15:08 ` [PATCH 12/12] " Steve Dickson
-- strict thread matches above, loose matches on Subject: below --
2025-08-21 11:15 [PATCH 00/12] " Steve Dickson
2025-08-21 11:15 ` [PATCH 06/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=20250818150829.1044948-7-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).