|
From: Steve D. <st...@re...> - 2025-08-21 11:15:56
|
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 <st...@re...>
---
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
|