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/getnetconfig.c | 24 +++++++++--------------- src/getnetpath.c | 12 +++++------- src/getpublickey.c | 20 ++++++++++---------- src/getrpcport.c | 8 +++++--- 4 files changed, 29 insertions(+), 35 deletions(-) diff --git a/src/getnetconfig.c b/src/getnetconfig.c index d547dce..58c4a5c 100644 --- a/src/getnetconfig.c +++ b/src/getnetconfig.c @@ -218,8 +218,7 @@ setnetconfig() */ struct netconfig * -getnetconfig(handlep) -void *handlep; +getnetconfig(void *handlep) { struct netconfig_vars *ncp = (struct netconfig_vars *)handlep; char *stringp; /* tmp string pointer */ @@ -354,8 +353,7 @@ void *handlep; * previously). */ int -endnetconfig(handlep) -void *handlep; +endnetconfig(void *handlep) { struct netconfig_vars *nc_handlep = (struct netconfig_vars *)handlep; @@ -417,8 +415,7 @@ void *handlep; */ struct netconfig * -getnetconfigent(netid) - const char *netid; +getnetconfigent(const char *netid) { FILE *file; /* NETCONFIG db's file pointer */ char *linep; /* holds current netconfig line */ @@ -516,8 +513,7 @@ getnetconfigent(netid) */ void -freenetconfigent(netconfigp) - struct netconfig *netconfigp; +freenetconfigent(struct netconfig *netconfigp) { if (netconfigp != NULL) { free(netconfigp->nc_netid); /* holds all netconfigp's strings */ @@ -541,9 +537,9 @@ freenetconfigent(netconfigp) */ static int -parse_ncp(stringp, ncp) -char *stringp; /* string to parse */ -struct netconfig *ncp; /* where to put results */ +parse_ncp( +char *stringp, /* string to parse */ +struct netconfig *ncp) /* where to put results */ { char *tokenp; /* for processing tokens */ char *lasts; @@ -661,8 +657,7 @@ nc_sperror() * Prints a message onto standard error describing the reason for failure. */ void -nc_perror(s) - const char *s; +nc_perror(const char *s) { fprintf(stderr, "%s: %s\n", s, nc_sperror()); } @@ -671,8 +666,7 @@ nc_perror(s) * Duplicates the matched netconfig buffer. */ static struct netconfig * -dup_ncp(ncp) -struct netconfig *ncp; +dup_ncp(struct netconfig *ncp) { struct netconfig *p; char *tmp; diff --git a/src/getnetpath.c b/src/getnetpath.c index ea1a18c..795ea26 100644 --- a/src/getnetpath.c +++ b/src/getnetpath.c @@ -129,8 +129,7 @@ setnetpath() */ struct netconfig * -getnetpath(handlep) - void *handlep; +getnetpath(void *handlep) { struct netpath_vars *np_sessionp = (struct netpath_vars *)handlep; struct netconfig *ncp = NULL; /* temp. holds a netconfig session */ @@ -185,8 +184,7 @@ getnetpath(handlep) * (e.g. if setnetpath() was not called previously. */ int -endnetpath(handlep) - void *handlep; +endnetpath(void *handlep) { struct netpath_vars *np_sessionp = (struct netpath_vars *)handlep; struct netpath_chain *chainp, *lastp; @@ -222,9 +220,9 @@ endnetpath(handlep) */ char * -_get_next_token(npp, token) -char *npp; /* string */ -int token; /* char to parse string for */ +_get_next_token( +char *npp, /* string */ +int token) /* char to parse string for */ { char *cp; /* char pointer */ char *np; /* netpath pointer */ diff --git a/src/getpublickey.c b/src/getpublickey.c index 4e96c7c..9d6b58c 100644 --- a/src/getpublickey.c +++ b/src/getpublickey.c @@ -58,16 +58,16 @@ int (*__getpublickey_LOCAL)(const char *, char *) = 0; * Get somebody's public key */ int -__getpublickey_real(netname, publickey) - char *netname; - char *publickey; +__getpublickey_real( + const char *netname, + char *publickey) { char lookup[3 * HEXKEYBYTES]; char *p; if (publickey == NULL) return (0); - if (!getpublicandprivatekey(netname, lookup)) + if (!getpublicandprivatekey((char *)netname, lookup)) return (0); p = strchr(lookup, ':'); if (p == NULL) { @@ -85,9 +85,9 @@ __getpublickey_real(netname, publickey) */ int -getpublicandprivatekey(key, ret) - char *key; - char *ret; +getpublicandprivatekey( + char *key, + char *ret) { char buf[1024]; /* big enough */ char *res; @@ -159,9 +159,9 @@ getpublicandprivatekey(key, ret) } } -int getpublickey(netname, publickey) - const char *netname; - char *publickey; +int getpublickey( + const char *netname, + char *publickey) { if (__getpublickey_LOCAL != NULL) return(__getpublickey_LOCAL(netname, publickey)); diff --git a/src/getrpcport.c b/src/getrpcport.c index c28cd61..497a2a2 100644 --- a/src/getrpcport.c +++ b/src/getrpcport.c @@ -43,9 +43,11 @@ #include <rpc/pmap_clnt.h> int -getrpcport(host, prognum, versnum, proto) - char *host; - int prognum, versnum, proto; +getrpcport( + char *host, + int prognum, + int versnum, + int proto) { struct sockaddr_in addr; struct hostent *hp; -- 2.50.1