[PATCH 07/12] Convert old-style function definitions into modern-style definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux