linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 12/12] Convert old-style function definitions into modern-style definitions
Date: Mon, 18 Aug 2025 11:08:29 -0400	[thread overview]
Message-ID: <20250818150829.1044948-13-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/auth_time.c     | 42 +++++++++++++++++++-----------------------
 src/auth_unix.c     | 29 +++++++++++------------------
 src/authunix_prot.c |  4 +---
 3 files changed, 31 insertions(+), 44 deletions(-)

diff --git a/src/auth_time.c b/src/auth_time.c
index c21b1df..16de1aa 100644
--- a/src/auth_time.c
+++ b/src/auth_time.c
@@ -58,8 +58,7 @@
 static int saw_alarm = 0;
 
 static void
-alarm_hndler(s)
-	int	s;
+alarm_hndler(int s)
 {
 	saw_alarm = 1;
 	return;
@@ -80,12 +79,9 @@ alarm_hndler(s)
  * Turn a 'universal address' into a struct sockaddr_in.
  * Bletch.
  */
-static int uaddr_to_sockaddr(uaddr, sin)
-#ifdef foo
-	endpoint		*endpt;
-#endif
-	char			*uaddr;
-	struct sockaddr_in	*sin;
+static int uaddr_to_sockaddr(
+	char *uaddr,
+	struct sockaddr_in *sin)
 {
 	unsigned char		p_bytes[2];
 	int			i;
@@ -115,9 +111,9 @@ static int uaddr_to_sockaddr(uaddr, sin)
  * Free the strings that were strduped into the eps structure.
  */
 static void
-free_eps(eps, num)
-	endpoint	eps[];
-	int		num;
+free_eps(
+	endpoint	eps[],
+	int		num)
 {
 	int		i;
 
@@ -141,12 +137,12 @@ free_eps(eps, num)
  * structure already populated.
  */
 static nis_server *
-get_server(sin, host, srv, eps, maxep)
-	struct sockaddr_in *sin;
-	char		*host;	/* name of the time host	*/
-	nis_server	*srv;	/* nis_server struct to use.	*/
-	endpoint	eps[];	/* array of endpoints		*/
-	int		maxep;	/* max array size		*/
+get_server(
+	struct sockaddr_in *sin,
+	char		*host,	/* name of the time host	*/
+	nis_server	*srv,	/* nis_server struct to use.	*/
+	endpoint	eps[],	/* array of endpoints		*/
+	int		maxep)	/* max array size		*/
 {
 	char			hname[256];
 	int			num_ep = 0, i;
@@ -226,12 +222,12 @@ get_server(sin, host, srv, eps, maxep)
  * td = "server" - "client"
  */
 int
-__rpc_get_time_offset(td, srv, thost, uaddr, netid)
-	struct timeval	*td;	 /* Time difference			*/
-	nis_server	*srv;	 /* NIS Server description 		*/
-	char		*thost;	 /* if no server, this is the timehost	*/
-	char		**uaddr; /* known universal address		*/
-	struct sockaddr_in *netid; /* known network identifier		*/
+__rpc_get_time_offset(
+	struct timeval	*td,	 /* Time difference			*/
+	nis_server	*srv,	 /* NIS Server description 		*/
+	char		*thost,	 /* if no server, this is the timehost	*/
+	char		**uaddr, /* known universal address		*/
+	struct sockaddr_in *netid) /* known network identifier		*/
 {
 	CLIENT			*clnt; 		/* Client handle 	*/
 	endpoint		*ep,		/* useful endpoints	*/
diff --git a/src/auth_unix.c b/src/auth_unix.c
index fc2be02..78a76b6 100644
--- a/src/auth_unix.c
+++ b/src/auth_unix.c
@@ -82,12 +82,12 @@ struct audata {
  * Returns an auth handle with the given stuff in it.
  */
 AUTH *
-authunix_create(machname, uid, gid, len, aup_gids)
-	char *machname;
-	uid_t uid;
-	gid_t gid;
-	int len;
-	gid_t *aup_gids;
+authunix_create(
+	char *machname,
+	uid_t uid,
+	gid_t gid,
+	int len,
+	gid_t *aup_gids)
 {
 	struct authunix_parms aup;
 	char mymem[MAX_AUTH_BYTES];
@@ -251,16 +251,13 @@ out_err:
 
 /* ARGSUSED */
 static void
-authunix_nextverf(auth)
-	AUTH *auth;
+authunix_nextverf(AUTH *auth)
 {
 	/* no action necessary */
 }
 
 static bool_t
-authunix_marshal(auth, xdrs)
-	AUTH *auth;
-	XDR *xdrs;
+authunix_marshal(AUTH *auth, XDR *xdrs)
 {
 	struct audata *au;
 
@@ -272,9 +269,7 @@ authunix_marshal(auth, xdrs)
 }
 
 static bool_t
-authunix_validate(auth, verf)
-	AUTH *auth;
-	struct opaque_auth *verf;
+authunix_validate(AUTH *auth, struct opaque_auth *verf)
 {
 	struct audata *au;
 	XDR xdrs;
@@ -350,8 +345,7 @@ done:
 }
 
 static void
-authunix_destroy(auth)
-	AUTH *auth;
+authunix_destroy(AUTH *auth)
 {
 	struct audata *au;
 
@@ -376,8 +370,7 @@ authunix_destroy(auth)
  * sets private data, au_marshed and au_mpos
  */
 static void
-marshal_new_auth(auth)
-	AUTH *auth;
+marshal_new_auth(AUTH *auth)
 {
 	XDR	xdr_stream;
 	XDR	*xdrs = &xdr_stream;
diff --git a/src/authunix_prot.c b/src/authunix_prot.c
index 0a04336..32e6f8b 100644
--- a/src/authunix_prot.c
+++ b/src/authunix_prot.c
@@ -45,9 +45,7 @@
  * XDR for unix authentication parameters.
  */
 bool_t
-xdr_authunix_parms(xdrs, p)
-	XDR *xdrs;
-	struct authunix_parms *p;
+xdr_authunix_parms(XDR *xdrs, struct authunix_parms *p)
 {
 
 	assert(xdrs != NULL);
-- 
2.50.1


  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 ` [PATCH 06/12] " Steve Dickson
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 ` Steve Dickson [this message]
  -- 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 12/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-13-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).