[PATCH 06/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/pmap_getmaps.c |  3 +--
 src/pmap_getport.c | 10 +++++-----
 src/pmap_prot.c    |  4 +---
 src/pmap_prot2.c   |  8 ++------
 src/pmap_rmt.c     | 31 +++++++++++++++++--------------
 5 files changed, 26 insertions(+), 30 deletions(-)

diff --git a/src/pmap_getmaps.c b/src/pmap_getmaps.c
index 853f724..61e3dcf 100644
--- a/src/pmap_getmaps.c
+++ b/src/pmap_getmaps.c
@@ -60,8 +60,7 @@
  * Calls the pmap service remotely to do get the maps.
  */
 struct pmaplist *
-pmap_getmaps(address)
-	 struct sockaddr_in *address;
+pmap_getmaps(struct sockaddr_in *address)
 {
 	struct pmaplist *head = NULL;
 	int sock = -1;
diff --git a/src/pmap_getport.c b/src/pmap_getport.c
index 72853a0..7687030 100644
--- a/src/pmap_getport.c
+++ b/src/pmap_getport.c
@@ -54,11 +54,11 @@ static const struct timeval tottimeout = { 60, 0 };
  * Returns 0 if no map exists.
  */
 u_short
-pmap_getport(address, program, version, protocol)
-	struct sockaddr_in *address;
-	u_long program;
-	u_long version;
-	u_int protocol;
+pmap_getport(
+	struct sockaddr_in *address,
+	u_long program,
+	u_long version,
+	u_int protocol)
 {
 	u_short port = 0;
 	int sock = -1;
diff --git a/src/pmap_prot.c b/src/pmap_prot.c
index c0a642b..2445c65 100644
--- a/src/pmap_prot.c
+++ b/src/pmap_prot.c
@@ -41,9 +41,7 @@
 
 
 bool_t
-xdr_pmap(xdrs, regs)
-	XDR *xdrs;
-	struct pmap *regs;
+xdr_pmap(XDR *xdrs, struct pmap *regs)
 {
 
 	assert(xdrs != NULL);
diff --git a/src/pmap_prot2.c b/src/pmap_prot2.c
index 5583ff0..bbac74f 100644
--- a/src/pmap_prot2.c
+++ b/src/pmap_prot2.c
@@ -79,9 +79,7 @@
  * this sounds like a job for xdr_reference!
  */
 bool_t
-xdr_pmaplist(xdrs, rp)
-	XDR *xdrs;
-	struct pmaplist **rp;
+xdr_pmaplist(XDR *xdrs, struct pmaplist **rp)
 {
 	/*
 	 * more_elements is pre-computed in case the direction is
@@ -123,9 +121,7 @@ xdr_pmaplist(xdrs, rp)
  * functionality to xdr_pmaplist().
  */
 bool_t
-xdr_pmaplist_ptr(xdrs, rp)
-	XDR *xdrs;
-	struct pmaplist *rp;
+xdr_pmaplist_ptr(XDR *xdrs, struct pmaplist *rp)
 {
 	return xdr_pmaplist(xdrs, (struct pmaplist **)(void *)rp);
 }
diff --git a/src/pmap_rmt.c b/src/pmap_rmt.c
index 1c76114..bfa694d 100644
--- a/src/pmap_rmt.c
+++ b/src/pmap_rmt.c
@@ -69,14 +69,17 @@ static const struct timeval timeout = { 3, 0 };
  * programs to do a lookup and call in one step.
 */
 enum clnt_stat
-pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout,
-    port_ptr)
-	struct sockaddr_in *addr;
-	u_long prog, vers, proc;
-	xdrproc_t xdrargs, xdrres;
-	caddr_t argsp, resp;
-	struct timeval tout;
-	u_long *port_ptr;
+pmap_rmtcall(
+	struct sockaddr_in *addr,
+	u_long prog, 
+	u_long vers, 
+	u_long proc,
+	xdrproc_t xdrargs, 
+	caddr_t argsp,
+	xdrproc_t xdrres,
+	caddr_t resp,
+	struct timeval tout,
+	u_long *port_ptr)
 {
 	int sock = -1;
 	CLIENT *client;
@@ -115,9 +118,9 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout,
  * written for XDR_ENCODE direction only
  */
 bool_t
-xdr_rmtcall_args(xdrs, cap)
-	XDR *xdrs;
-	struct rmtcallargs *cap;
+xdr_rmtcall_args(
+	XDR *xdrs,
+	struct rmtcallargs *cap)
 {
 	u_int lenposition, argposition, position;
 
@@ -149,9 +152,9 @@ xdr_rmtcall_args(xdrs, cap)
  * written for XDR_DECODE direction only
  */
 bool_t
-xdr_rmtcallres(xdrs, crp)
-	XDR *xdrs;
-	struct rmtcallres *crp;
+xdr_rmtcallres(
+	XDR *xdrs,
+	struct rmtcallres *crp)
 {
 	caddr_t port_ptr;
 
-- 
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