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 07/12] Convert old-style function definitions into modern-style definitions
Date: Mon, 18 Aug 2025 11:08:24 -0400 [thread overview]
Message-ID: <20250818150829.1044948-8-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/netname.c | 19 +++++++++----------
src/netnamer.c | 31 ++++++++++++++++---------------
2 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/src/netname.c b/src/netname.c
index ea61b1a..d62fa26 100644
--- a/src/netname.c
+++ b/src/netname.c
@@ -74,8 +74,7 @@ static char *OPSYS = "unix";
* Figure out my fully qualified network name
*/
int
-getnetname(name)
- char name[MAXNETNAMELEN+1];
+getnetname(char *name)
{
uid_t uid;
@@ -92,10 +91,10 @@ getnetname(name)
* Convert unix cred to network-name
*/
int
-user2netname(netname, uid, domain)
- char netname[MAXNETNAMELEN + 1];
- const uid_t uid;
- const char *domain;
+user2netname(
+ char *netname,
+ const uid_t uid,
+ const char *domain)
{
char *dfltdom;
@@ -117,10 +116,10 @@ user2netname(netname, uid, domain)
* Convert host to network-name
*/
int
-host2netname(netname, host, domain)
- char netname[MAXNETNAMELEN + 1];
- const char *host;
- const char *domain;
+host2netname(
+ char *netname,
+ const char *host,
+ const char *domain)
{
char *dfltdom;
char hostname[MAXHOSTNAMELEN+1];
diff --git a/src/netnamer.c b/src/netnamer.c
index 6b6c8e0..862a4de 100644
--- a/src/netnamer.c
+++ b/src/netnamer.c
@@ -66,12 +66,12 @@ static int _getgroups( char *, gid_t * );
* Convert network-name into unix credential
*/
int
-netname2user(netname, uidp, gidp, gidlenp, gidlist)
- char netname[MAXNETNAMELEN + 1];
- uid_t *uidp;
- gid_t *gidp;
- int *gidlenp;
- gid_t *gidlist;
+netname2user(
+ char *netname,
+ uid_t *uidp,
+ gid_t *gidp,
+ int *gidlenp,
+ gid_t *gidlist)
{
char *p;
int gidlen;
@@ -148,9 +148,9 @@ netname2user(netname, uidp, gidp, gidlenp, gidlist)
*/
static int
-_getgroups(uname, groups)
- char *uname;
- gid_t groups[NGROUPS];
+_getgroups(
+ char *uname,
+ gid_t *groups)
{
gid_t ngroups = 0;
struct group *grp;
@@ -187,10 +187,10 @@ toomany:
* Convert network-name to hostname
*/
int
-netname2host(netname, hostname, hostlen)
- char netname[MAXNETNAMELEN + 1];
- char *hostname;
- int hostlen;
+netname2host(
+ char *netname,
+ char *hostname,
+ int hostlen)
{
int err;
char valbuf[1024];
@@ -236,8 +236,9 @@ netname2host(netname, hostname, hostlen)
* network information service.
*/
static int
-getnetid(key, ret)
- char *key, *ret;
+getnetid(
+ char *key,
+ char *ret)
{
char buf[1024]; /* big enough */
char *res;
--
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 ` [PATCH 06/12] " Steve Dickson
2025-08-18 15:08 ` Steve Dickson [this message]
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 07/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-8-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).