Convert old-style function definitions into modern-style definitions
Subsystems (2)
cover Convert old-style function definitions into modern-style definitions
This patch set converts all of the old-style function definitions into modern-style definitions through out the library... basically touching almost every function definition.
The conversion was pretty straightforward... The same repetitive changes were make on all the functions and the compiler pointed out any declaration issue that came up. I'm confident the API did not change.
I test the changes by doing kernel builds over both secured and unsecured mounts. I also ran my Bakeathon Cthon tool which mounts all versions, simultaneously, and runs cthon test on them... both secured and insecure mounts... for over 48hrs.
The one part I didn't test was the NIS support since I didn't have a NIS setup... I'm pretty confident things should work... Again the changes were I'm all straightforward.
Reviews are welcome!
Steve Dickson (12):
Convert old-style function definitions into modern-style definitions Convert old-style function definitions into modern-style definitions Convert old-style function definitions into modern-style definitions Convert old-style function definitions into modern-style definitions Convert old-style function definitions into modern-style definitions Convert old-style function definitions into modern-style definitions Convert old-style function definitions into modern-style definitions Convert old-style function definitions into modern-style definitions Convert old-style function definitions into modern-style definitions Convert old-style function definitions into modern-style definitions Convert old-style function definitions into modern-style definitions Convert old-style function definitions into modern-style definitions
src/auth_time.c | 42 +++--- src/auth_unix.c | 29 ++--- src/authunix_prot.c | 4 +- src/bindresvport.c | 4 +- src/clnt_bcast.c | 46 ++++--- src/clnt_dg.c | 59 ++++----- src/clnt_perror.c | 23 +--- src/clnt_raw.c | 46 +++---- src/clnt_simple.c | 19 +-- src/clnt_vc.c | 75 +++++------ src/getnetconfig.c | 24 ++-- src/getnetpath.c | 12 +- src/getpublickey.c | 20 +-- src/getrpcport.c | 8 +- src/key_call.c | 58 ++++----- src/netname.c | 19 ++- src/netnamer.c | 31 ++--- 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 +++-- src/rpc_callmsg.c | 4 +- src/rpc_generic.c | 31 ++--- src/rpc_prot.c | 36 ++--- src/rpc_soc.c | 310 ++++++++++++++++++++++---------------------- src/rpcb_clnt.c | 154 +++++++++++----------- src/rpcb_prot.c | 48 +++---- src/rpcb_st_xdr.c | 42 +++--- src/rpcdname.c | 3 +- src/rtime.c | 11 +- src/svc.c | 107 +++++++-------- src/svc_auth.c | 14 +- src/svc_auth_unix.c | 12 +- src/svc_dg.c | 75 +++++------ src/svc_generic.c | 32 ++--- src/svc_raw.c | 46 ++++--- src/svc_simple.c | 19 ++- src/svc_vc.c | 111 ++++++++-------- src/xdr.c | 224 ++++++++++++++++---------------- src/xdr_array.c | 26 ++-- src/xdr_float.c | 12 +- src/xdr_mem.c | 74 +++++------ src/xdr_rec.c | 121 ++++++++--------- src/xdr_reference.c | 20 +-- src/xdr_sizeof.c | 30 ++--- src/xdr_stdio.c | 54 ++++---- 47 files changed, 1032 insertions(+), 1159 deletions(-)
Signature · 1 line
2.50.1
PATCH 1/12 Convert old-style function definitions into modern-style definitions
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
--- src/xdr.c | 224 ++++++++++++++++++++++---------------------- src/xdr_array.c | 26 ++--- src/xdr_float.c | 12 +-- src/xdr_mem.c | 74 +++++++-------- src/xdr_rec.c | 121 +++++++++++------------- src/xdr_reference.c | 20 ++-- src/xdr_sizeof.c | 30 ++---- src/xdr_stdio.c | 54 +++++------ 8 files changed, 270 insertions(+), 291 deletions(-)
src/xdr.c +112 -112
@@ -66,9 +66,9 @@ static const char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 };* Not a filter, but a convenient utility nonetheless */ void -xdr_free (proc, objp) -xdrproc_t proc; -void *objp; +xdr_free ( +xdrproc_t proc, +void *objp) {XDR x;
@@ -91,9 +91,9 @@ xdr_void(void)* XDR integers */ bool_t -xdr_int (xdrs, ip) -XDR *xdrs; -int *ip; +xdr_int ( +XDR *xdrs, +int *ip) {long l;
@@ -121,9 +121,9 @@ xdr_int(xdrs, ip)* XDR unsigned integers */ bool_t -xdr_u_int (xdrs, up) -XDR *xdrs; -u_int *up; +xdr_u_int ( +XDR *xdrs, +u_int *up) {u_long l;
@@ -153,9 +153,9 @@ xdr_u_int(xdrs, up)* same as xdr_u_long - open coded to save a proc call! */ bool_t -xdr_long (xdrs, lp) -XDR *xdrs; -long *lp; +xdr_long ( +XDR *xdrs, +long *lp) {switch (xdrs->x_op) {case XDR_ENCODE :
@@ -174,9 +174,9 @@ xdr_long(xdrs, lp)* same as xdr_long - open coded to save a proc call! */ bool_t -xdr_u_long (xdrs, ulp) -XDR *xdrs; -u_long *ulp; +xdr_u_long ( +XDR *xdrs, +u_long *ulp) {switch (xdrs->x_op) {case XDR_ENCODE :
@@ -196,9 +196,9 @@ xdr_u_long(xdrs, ulp)* same as xdr_u_int32_t - open coded to save a proc call! */ bool_t -xdr_int32_t (xdrs, int32_p) -XDR *xdrs; -int32_t *int32_p; +xdr_int32_t ( +XDR *xdrs, +int32_t *int32_p) {long l;
@@ -227,9 +227,9 @@ xdr_int32_t(xdrs, int32_p)* same as xdr_int32_t - open coded to save a proc call! */ bool_t -xdr_u_int32_t (xdrs, u_int32_p) -XDR *xdrs; -u_int32_t *u_int32_p; +xdr_u_int32_t ( +XDR *xdrs, +u_int32_t *u_int32_p) {u_long l;
@@ -258,9 +258,9 @@ xdr_u_int32_t(xdrs, u_int32_p)* XDR unsigned 32-bit integers */ bool_t -xdr_uint32_t (xdrs, uint32_p) -XDR *xdrs; -uint32_t *uint32_p; +xdr_uint32_t ( +XDR *xdrs, +uint32_t *uint32_p) {return (xdr_u_int32_t (xdrs, (u_int32_t *)uint32_p)); }
@@ -270,9 +270,9 @@ xdr_uint32_t(xdrs, uint32_p)* XDR short integers */ bool_t -xdr_short (xdrs, sp) -XDR *xdrs; -short *sp; +xdr_short ( +XDR *xdrs, +short *sp) {long l;
@@ -300,9 +300,9 @@ xdr_short(xdrs, sp)* XDR unsigned short integers */ bool_t -xdr_u_short (xdrs, usp) -XDR *xdrs; -u_short *usp; +xdr_u_short ( +XDR *xdrs, +u_short *usp) {u_long l;
@@ -331,9 +331,9 @@ xdr_u_short(xdrs, usp)* XDR 16-bit integers */ bool_t -xdr_int16_t (xdrs, int16_p) -XDR *xdrs; -int16_t *int16_p; +xdr_int16_t ( +XDR *xdrs, +int16_t *int16_p) {long l;
@@ -361,9 +361,9 @@ xdr_int16_t(xdrs, int16_p)* XDR unsigned 16-bit integers */ bool_t -xdr_u_int16_t (xdrs, u_int16_p) -XDR *xdrs; -u_int16_t *u_int16_p; +xdr_u_int16_t ( +XDR *xdrs, +u_int16_t *u_int16_p) {u_long l;
@@ -392,9 +392,9 @@ xdr_u_int16_t(xdrs, u_int16_p)* XDR unsigned 16-bit integers */ bool_t -xdr_uint16_t (xdrs, uint16_p) -XDR *xdrs; -uint16_t *uint16_p; +xdr_uint16_t ( +XDR *xdrs, +uint16_t *uint16_p) {return (xdr_u_int16_t (xdrs, (u_int16_t *)uint16_p)); }
@@ -404,9 +404,9 @@ xdr_uint16_t(xdrs, uint16_p)* XDR 8-bit integers */ bool_t -xdr_int8_t (xdrs, int8_p) -XDR *xdrs; -int8_t *int8_p; +xdr_int8_t ( +XDR *xdrs, +int8_t *int8_p) {long l;
@@ -435,9 +435,9 @@ xdr_int8_t(xdrs, int8_p)* XDR unsigned 8-bit integers */ bool_t -xdr_u_int8_t (xdrs, uint8_p) -XDR *xdrs; -uint8_t *uint8_p; +xdr_u_int8_t ( +XDR *xdrs, +uint8_t *uint8_p) {u_long l;
@@ -466,9 +466,9 @@ xdr_u_int8_t(xdrs, uint8_p)* XDR unsigned 8-bit integers */ bool_t -xdr_uint8_t (xdrs, uint8_p) -XDR *xdrs; -uint8_t *uint8_p; +xdr_uint8_t ( +XDR *xdrs, +uint8_t *uint8_p) {return (xdr_u_int8_t (xdrs, (uint8_t *)uint8_p)); }
@@ -478,9 +478,9 @@ xdr_uint8_t(xdrs, uint8_p)* XDR a char */ bool_t -xdr_char (xdrs, cp) -XDR *xdrs; -char *cp; +xdr_char ( +XDR *xdrs, +char *cp) {int i;
@@ -496,9 +496,9 @@ xdr_char(xdrs, cp)* XDR an unsigned char */ bool_t -xdr_u_char (xdrs, cp) -XDR *xdrs; -u_char *cp; +xdr_u_char ( +XDR *xdrs, +u_char *cp) {u_int u;
@@ -514,9 +514,9 @@ xdr_u_char(xdrs, cp)* XDR booleans */ bool_t -xdr_bool (xdrs, bp) -XDR *xdrs; -bool_t *bp; +xdr_bool ( +XDR *xdrs, +bool_t *bp) {long lb;
@@ -544,9 +544,9 @@ xdr_bool(xdrs, bp)* XDR enumerations */ bool_t -xdr_enum (xdrs, ep) -XDR *xdrs; -enum_t *ep; +xdr_enum ( +XDR *xdrs, +enum_t *ep) {enum sizecheck {SIZEVAL };/* used to find the size of an enum */
@@ -570,10 +570,10 @@ xdr_enum(xdrs, ep)* cp points to the opaque object and cnt gives the byte length. */ bool_t -xdr_opaque (xdrs, cp, cnt) -XDR *xdrs; -caddr_t cp; -u_int cnt; +xdr_opaque ( +XDR *xdrs, +caddr_t cp, +u_int cnt) {u_int rndup;static int crud[BYTES_PER_XDR_UNIT ];
@@ -622,11 +622,11 @@ xdr_opaque(xdrs, cp, cnt)* If *cpp is NULL maxsize bytes are allocated */ bool_t -xdr_bytes (xdrs, cpp, sizep, maxsize) -XDR *xdrs; -char **cpp; -u_int *sizep; -u_int maxsize; +xdr_bytes ( +XDR *xdrs, +char **cpp, +u_int *sizep, +u_int maxsize) {char *sp = *cpp;/* sp is the actual string pointer */ u_int nodesize;
@@ -687,9 +687,9 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)* Implemented here due to commonality of the object. */ bool_t -xdr_netobj (xdrs, np) -XDR *xdrs; -struct netobj *np; +xdr_netobj ( +XDR *xdrs, +struct netobj *np) {return (xdr_bytes (xdrs, &np->n_bytes, &np->n_len,MAX_NETOBJ_SZ ));
@@ -707,12 +707,12 @@ xdr_netobj(xdrs, np)* If there is no specific or default routine an error is returned. */ bool_t -xdr_union (xdrs, dscmp, unp, choices, dfault) -XDR *xdrs; -enum_t *dscmp;/* enum to decide which arm to work on */ -char *unp;/* the union itself */ -const struct xdr_discrim *choices;/* [value, xdr proc] for each arm */ -xdrproc_t dfault;/* default xdr routine */ +xdr_union ( +XDR *xdrs, +enum_t *dscmp,/* enum to decide which arm to work on */ +char *unp,/* the union itself */ +const struct xdr_discrim *choices,/* [value, xdr proc] for each arm */ +xdrproc_t dfault)/* default xdr routine */ {enum_t dscm;
@@ -756,10 +756,10 @@ xdr_union(xdrs, dscmp, unp, choices, dfault)* of the string as specified by a protocol. */ bool_t -xdr_string (xdrs, cpp, maxsize) -XDR *xdrs; -char **cpp; -u_int maxsize; +xdr_string ( +XDR *xdrs, +char **cpp, +u_int maxsize) {char *sp = *cpp;/* sp is the actual string pointer */ u_int size;
@@ -839,9 +839,9 @@ xdr_string(xdrs, cpp, maxsize)* routines like clnt_call */ bool_t -xdr_wrapstring (xdrs, cpp) -XDR *xdrs; -char **cpp; +xdr_wrapstring ( +XDR *xdrs, +char **cpp) {return xdr_string (xdrs, cpp,RPC_MAXDATASIZE ); }
@@ -858,9 +858,9 @@ xdr_wrapstring(xdrs, cpp)* XDR 64-bit integers */ bool_t -xdr_int64_t (xdrs, llp) -XDR *xdrs; -int64_t *llp; +xdr_int64_t ( +XDR *xdrs, +int64_t *llp) {u_long ul[2 ];
@@ -892,9 +892,9 @@ xdr_int64_t(xdrs, llp)* XDR unsigned 64-bit integers */ bool_t -xdr_u_int64_t (xdrs, ullp) -XDR *xdrs; -u_int64_t *ullp; +xdr_u_int64_t ( +XDR *xdrs, +u_int64_t *ullp) {u_long ul[2 ];
@@ -926,9 +926,9 @@ xdr_u_int64_t(xdrs, ullp)* XDR unsigned 64-bit integers */ bool_t -xdr_uint64_t (xdrs, ullp) -XDR *xdrs; -uint64_t *ullp; +xdr_uint64_t ( +XDR *xdrs, +uint64_t *ullp) {return (xdr_u_int64_t (xdrs, (u_int64_t *)ullp)); }
@@ -938,9 +938,9 @@ xdr_uint64_t(xdrs, ullp)* XDR hypers */ bool_t -xdr_hyper (xdrs, llp) -XDR *xdrs; -longlong_t *llp; +xdr_hyper ( +XDR *xdrs, +longlong_t *llp) {/*
@@ -955,9 +955,9 @@ xdr_hyper(xdrs, llp)* XDR unsigned hypers */ bool_t -xdr_u_hyper (xdrs, ullp) -XDR *xdrs; -u_longlong_t *ullp; +xdr_u_hyper ( +XDR *xdrs, +u_longlong_t *ullp) {/*
@@ -972,9 +972,9 @@ xdr_u_hyper(xdrs, ullp)* XDR longlong_t's */ bool_t -xdr_longlong_t (xdrs, llp) -XDR *xdrs; -longlong_t *llp; +xdr_longlong_t ( +XDR *xdrs, +longlong_t *llp) {/*
@@ -989,9 +989,9 @@ xdr_longlong_t(xdrs, llp)* XDR u_longlong_t's */ bool_t -xdr_u_longlong_t (xdrs, ullp) -XDR *xdrs; -u_longlong_t *ullp; +xdr_u_longlong_t ( +XDR *xdrs, +u_longlong_t *ullp) {/*
@@ -1005,9 +1005,9 @@ xdr_u_longlong_t(xdrs, ullp)* XDR quad_t */ bool_t -xdr_quad_t (xdrs, llp) -XDR *xdrs; -int64_t *llp; +xdr_quad_t ( +XDR *xdrs, +int64_t *llp) {return (xdr_int64_t (xdrs, (int64_t *)llp)); }
@@ -1017,9 +1017,9 @@ xdr_quad_t(xdrs, llp)* XDR u_quad_t */ bool_t -xdr_u_quad_t (xdrs, ullp) -XDR *xdrs; -u_int64_t *ullp; +xdr_u_quad_t ( +XDR *xdrs, +u_int64_t *ullp) {return (xdr_u_int64_t (xdrs, (u_int64_t *)ullp)); }
src/xdr_array.c +13 -13
@@ -55,13 +55,13 @@* xdr procedure to call to handle each element of the array. */ bool_t -xdr_array (xdrs, addrp, sizep, maxsize, elsize, elproc) -XDR *xdrs; -caddr_t *addrp;/* array pointer */ -u_int *sizep;/* number of elements */ -u_int maxsize;/* max numberof elements */ -u_int elsize;/* size in bytes of each element */ -xdrproc_t elproc;/* xdr routine to handle each element */ +xdr_array ( +XDR *xdrs, +caddr_t *addrp,/* array pointer */ +u_int *sizep,/* number of elements */ +u_int maxsize,/* max numberof elements */ +u_int elsize,/* size in bytes of each element */ +xdrproc_t elproc)/* xdr routine to handle each element */ {u_int i;caddr_t target = *addrp;
@@ -133,12 +133,12 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc)* > xdr_elem: routine to XDR each element */ bool_t -xdr_vector (xdrs, basep, nelem, elemsize, xdr_elem) -XDR *xdrs; -char *basep; -u_int nelem; -u_int elemsize; -xdrproc_t xdr_elem; +xdr_vector ( +XDR *xdrs, +char *basep, +u_int nelem, +u_int elemsize, +xdrproc_t xdr_elem) {u_int i;char *elptr;
src/xdr_float.c +6 -6
@@ -95,9 +95,9 @@ static struct sgl_limits {#endif /* vax */ bool_t -xdr_float (xdrs, fp) -XDR *xdrs; -float *fp; +xdr_float ( +XDR *xdrs, +float *fp) {#ifndef IEEEFP struct ieee_single is;
@@ -197,9 +197,9 @@ static struct dbl_limits {bool_t -xdr_double (xdrs, dp) -XDR *xdrs; -double *dp; +xdr_double ( +XDR *xdrs, +double *dp) {#ifdef IEEEFP int32_t *i32p;
src/xdr_mem.c +36 -38
145 lines not on this page · raw message
src/xdr_rec.c +57 -64
249 lines not on this page · raw message
src/xdr_reference.c +10 -10
@@ -58,11 +58,11 @@* proc is the routine to handle the referenced structure. */ bool_t -xdr_reference (xdrs, pp, size, proc) -XDR *xdrs; -caddr_t *pp;/* the pointer to work on */ -u_int size;/* size of the object pointed to */ -xdrproc_t proc;/* xdr routine to handle the object */ +xdr_reference ( +XDR *xdrs, +caddr_t *pp,/* the pointer to work on */ +u_int size,/* size of the object pointed to */ +xdrproc_t proc)/* xdr routine to handle the object */ {caddr_t loc = *pp;bool_t stat;
@@ -115,11 +115,11 @@ xdr_reference(xdrs, pp, size, proc)* */ bool_t -xdr_pointer (xdrs,objpp,obj_size,xdr_obj) -XDR *xdrs; -char **objpp; -u_int obj_size; -xdrproc_t xdr_obj; +xdr_pointer ( +XDR *xdrs, +char **objpp, +u_int obj_size, +xdrproc_t xdr_obj) {bool_t more_data;
src/xdr_sizeof.c +10 -20
@@ -44,9 +44,7 @@/* ARGSUSED */ static bool_t -x_putlong (xdrs, longp) -XDR *xdrs; -long *longp; +x_putlong (XDR *xdrs,const long *longp) { xdrs->x_handy +=BYTES_PER_XDR_UNIT ;return (TRUE);
@@ -54,36 +52,31 @@ x_putlong(xdrs, longp)/* ARGSUSED */ static bool_t -x_putbytes (xdrs, bp, len) -XDR *xdrs; -char *bp; -u_int len; +x_putbytes ( +XDR *xdrs, +const char *bp, +u_int len) { xdrs->x_handy += len;return (TRUE); }static u_int -x_getpostn (xdrs) -XDR *xdrs; +x_getpostn (XDR *xdrs) {return (xdrs->x_handy); }/* ARGSUSED */ static bool_t -x_setpostn (xdrs, pos) -XDR *xdrs; -u_int pos; +x_setpostn (XDR *xdrs,u_int pos) {/* This is not allowed */ return (FALSE); }static int32_t * -x_inline (xdrs ,len ) - XDR *xdrs; -u_int len; +x_inline (XDR *xdrs,u_int len) {if (len ==0 ) {return (NULL );
@@ -117,8 +110,7 @@ harmless() }static void -x_destroy (xdrs) -XDR *xdrs; +x_destroy (XDR *xdrs) { xdrs->x_handy =0 ; xdrs->x_base =0 ;
@@ -130,9 +122,7 @@ x_destroy(xdrs) }unsigned long -xdr_sizeof (func, data) -xdrproc_t func; -void *data; +xdr_sizeof (xdrproc_t func,void *data) {XDR x;struct xdr_ops ops;
src/xdr_stdio.c +26 -28
108 lines not on this page · raw message
Signature · 1 line
2.50.1
[Sorry for the repost... ]
steved.
Quoted 1,239 lines · Steve Dickson via Libtirpc-devel
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 <[email protected]>--- src/xdr.c | 224 ++++++++++++++++++++++---------------------- src/xdr_array.c | 26 ++--- src/xdr_float.c | 12 +-- src/xdr_mem.c | 74 +++++++-------- src/xdr_rec.c | 121 +++++++++++------------- src/xdr_reference.c | 20 ++-- src/xdr_sizeof.c | 30 ++---- src/xdr_stdio.c | 54 +++++------ 8 files changed, 270 insertions(+), 291 deletions(-)src/xdr.c +112
-112@@ -66,9 +66,9 @@ static const char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 };* Not a filter, but a convenient utility nonetheless */ void -xdr_free (proc, objp) -xdrproc_t proc; -void *objp; +xdr_free ( +xdrproc_t proc, +void *objp) {XDR x;@@ -91,9 +91,9 @@ xdr_void(void)* XDR integers */ bool_t -xdr_int (xdrs, ip) -XDR *xdrs; -int *ip; +xdr_int ( +XDR *xdrs, +int *ip) {long l;@@ -121,9 +121,9 @@ xdr_int(xdrs, ip)* XDR unsigned integers */ bool_t -xdr_u_int (xdrs, up) -XDR *xdrs; -u_int *up; +xdr_u_int ( +XDR *xdrs, +u_int *up) {u_long l;@@ -153,9 +153,9 @@ xdr_u_int(xdrs, up)* same as xdr_u_long - open coded to save a proc call! */ bool_t -xdr_long (xdrs, lp) -XDR *xdrs; -long *lp; +xdr_long ( +XDR *xdrs, +long *lp) {switch (xdrs->x_op) {case XDR_ENCODE :@@ -174,9 +174,9 @@ xdr_long(xdrs, lp)* same as xdr_long - open coded to save a proc call! */ bool_t -xdr_u_long (xdrs, ulp) -XDR *xdrs; -u_long *ulp; +xdr_u_long ( +XDR *xdrs, +u_long *ulp) {switch (xdrs->x_op) {case XDR_ENCODE :@@ -196,9 +196,9 @@ xdr_u_long(xdrs, ulp)* same as xdr_u_int32_t - open coded to save a proc call! */ bool_t -xdr_int32_t (xdrs, int32_p) -XDR *xdrs; -int32_t *int32_p; +xdr_int32_t ( +XDR *xdrs, +int32_t *int32_p) {long l;@@ -227,9 +227,9 @@ xdr_int32_t(xdrs, int32_p)* same as xdr_int32_t - open coded to save a proc call! */ bool_t -xdr_u_int32_t (xdrs, u_int32_p) -XDR *xdrs; -u_int32_t *u_int32_p; +xdr_u_int32_t ( +XDR *xdrs, +u_int32_t *u_int32_p) {u_long l;@@ -258,9 +258,9 @@ xdr_u_int32_t(xdrs, u_int32_p)* XDR unsigned 32-bit integers */ bool_t -xdr_uint32_t (xdrs, uint32_p) -XDR *xdrs; -uint32_t *uint32_p; +xdr_uint32_t ( +XDR *xdrs, +uint32_t *uint32_p) {return (xdr_u_int32_t (xdrs, (u_int32_t *)uint32_p)); }@@ -270,9 +270,9 @@ xdr_uint32_t(xdrs, uint32_p)* XDR short integers */ bool_t -xdr_short (xdrs, sp) -XDR *xdrs; -short *sp; +xdr_short ( +XDR *xdrs, +short *sp) {long l;@@ -300,9 +300,9 @@ xdr_short(xdrs, sp)* XDR unsigned short integers */ bool_t -xdr_u_short (xdrs, usp) -XDR *xdrs; -u_short *usp; +xdr_u_short ( +XDR *xdrs, +u_short *usp) {u_long l;@@ -331,9 +331,9 @@ xdr_u_short(xdrs, usp)* XDR 16-bit integers */ bool_t -xdr_int16_t (xdrs, int16_p) -XDR *xdrs; -int16_t *int16_p; +xdr_int16_t ( +XDR *xdrs, +int16_t *int16_p) {long l;@@ -361,9 +361,9 @@ xdr_int16_t(xdrs, int16_p)* XDR unsigned 16-bit integers */ bool_t -xdr_u_int16_t (xdrs, u_int16_p) -XDR *xdrs; -u_int16_t *u_int16_p; +xdr_u_int16_t ( +XDR *xdrs, +u_int16_t *u_int16_p) {u_long l;@@ -392,9 +392,9 @@ xdr_u_int16_t(xdrs, u_int16_p)* XDR unsigned 16-bit integers */ bool_t -xdr_uint16_t (xdrs, uint16_p) -XDR *xdrs; -uint16_t *uint16_p; +xdr_uint16_t ( +XDR *xdrs, +uint16_t *uint16_p) {return (xdr_u_int16_t (xdrs, (u_int16_t *)uint16_p)); }@@ -404,9 +404,9 @@ xdr_uint16_t(xdrs, uint16_p)* XDR 8-bit integers */ bool_t -xdr_int8_t (xdrs, int8_p) -XDR *xdrs; -int8_t *int8_p; +xdr_int8_t ( +XDR *xdrs, +int8_t *int8_p) {long l;@@ -435,9 +435,9 @@ xdr_int8_t(xdrs, int8_p)* XDR unsigned 8-bit integers */ bool_t -xdr_u_int8_t (xdrs, uint8_p) -XDR *xdrs; -uint8_t *uint8_p; +xdr_u_int8_t ( +XDR *xdrs, +uint8_t *uint8_p) {u_long l;@@ -466,9 +466,9 @@ xdr_u_int8_t(xdrs, uint8_p)* XDR unsigned 8-bit integers */ bool_t -xdr_uint8_t (xdrs, uint8_p) -XDR *xdrs; -uint8_t *uint8_p; +xdr_uint8_t ( +XDR *xdrs, +uint8_t *uint8_p) {return (xdr_u_int8_t (xdrs, (uint8_t *)uint8_p)); }@@ -478,9 +478,9 @@ xdr_uint8_t(xdrs, uint8_p)* XDR a char */ bool_t -xdr_char (xdrs, cp) -XDR *xdrs; -char *cp; +xdr_char ( +XDR *xdrs, +char *cp) {int i;@@ -496,9 +496,9 @@ xdr_char(xdrs, cp)* XDR an unsigned char */ bool_t -xdr_u_char (xdrs, cp) -XDR *xdrs; -u_char *cp; +xdr_u_char ( +XDR *xdrs, +u_char *cp) {u_int u;@@ -514,9 +514,9 @@ xdr_u_char(xdrs, cp)* XDR booleans */ bool_t -xdr_bool (xdrs, bp) -XDR *xdrs; -bool_t *bp; +xdr_bool ( +XDR *xdrs, +bool_t *bp) {long lb;@@ -544,9 +544,9 @@ xdr_bool(xdrs, bp)* XDR enumerations */ bool_t -xdr_enum (xdrs, ep) -XDR *xdrs; -enum_t *ep; +xdr_enum ( +XDR *xdrs, +enum_t *ep) {enum sizecheck {SIZEVAL };/* used to find the size of an enum */ @@ -570,10 +570,10 @@ xdr_enum(xdrs, ep)* cp points to the opaque object and cnt gives the byte length. */ bool_t -xdr_opaque (xdrs, cp, cnt) -XDR *xdrs; -caddr_t cp; -u_int cnt; +xdr_opaque ( +XDR *xdrs, +caddr_t cp, +u_int cnt) {u_int rndup;static int crud[BYTES_PER_XDR_UNIT ];@@ -622,11 +622,11 @@ xdr_opaque(xdrs, cp, cnt)* If *cpp is NULL maxsize bytes are allocated */ bool_t -xdr_bytes (xdrs, cpp, sizep, maxsize) -XDR *xdrs; -char **cpp; -u_int *sizep; -u_int maxsize; +xdr_bytes ( +XDR *xdrs, +char **cpp, +u_int *sizep, +u_int maxsize) {char *sp = *cpp;/* sp is the actual string pointer */ u_int nodesize;@@ -687,9 +687,9 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)* Implemented here due to commonality of the object. */ bool_t -xdr_netobj (xdrs, np) -XDR *xdrs; -struct netobj *np; +xdr_netobj ( +XDR *xdrs, +struct netobj *np) {return (xdr_bytes (xdrs, &np->n_bytes, &np->n_len,MAX_NETOBJ_SZ ));@@ -707,12 +707,12 @@ xdr_netobj(xdrs, np)* If there is no specific or default routine an error is returned. */ bool_t -xdr_union (xdrs, dscmp, unp, choices, dfault) -XDR *xdrs; -enum_t *dscmp;/* enum to decide which arm to work on */ -char *unp;/* the union itself */ -const struct xdr_discrim *choices;/* [value, xdr proc] for each arm */ -xdrproc_t dfault;/* default xdr routine */ +xdr_union ( +XDR *xdrs, +enum_t *dscmp,/* enum to decide which arm to work on */ +char *unp,/* the union itself */ +const struct xdr_discrim *choices,/* [value, xdr proc] for each arm */ +xdrproc_t dfault)/* default xdr routine */ {enum_t dscm;@@ -756,10 +756,10 @@ xdr_union(xdrs, dscmp, unp, choices, dfault)* of the string as specified by a protocol. */ bool_t -xdr_string (xdrs, cpp, maxsize) -XDR *xdrs; -char **cpp; -u_int maxsize; +xdr_string ( +XDR *xdrs, +char **cpp, +u_int maxsize) {char *sp = *cpp;/* sp is the actual string pointer */ u_int size;@@ -839,9 +839,9 @@ xdr_string(xdrs, cpp, maxsize)* routines like clnt_call */ bool_t -xdr_wrapstring (xdrs, cpp) -XDR *xdrs; -char **cpp; +xdr_wrapstring ( +XDR *xdrs, +char **cpp) {return xdr_string (xdrs, cpp,RPC_MAXDATASIZE ); }@@ -858,9 +858,9 @@ xdr_wrapstring(xdrs, cpp)* XDR 64-bit integers */ bool_t -xdr_int64_t (xdrs, llp) -XDR *xdrs; -int64_t *llp; +xdr_int64_t ( +XDR *xdrs, +int64_t *llp) {u_long ul[2 ];@@ -892,9 +892,9 @@ xdr_int64_t(xdrs, llp)* XDR unsigned 64-bit integers */ bool_t -xdr_u_int64_t (xdrs, ullp) -XDR *xdrs; -u_int64_t *ullp; +xdr_u_int64_t ( +XDR *xdrs, +u_int64_t *ullp) {u_long ul[2 ];@@ -926,9 +926,9 @@ xdr_u_int64_t(xdrs, ullp)* XDR unsigned 64-bit integers */ bool_t -xdr_uint64_t (xdrs, ullp) -XDR *xdrs; -uint64_t *ullp; +xdr_uint64_t ( +XDR *xdrs, +uint64_t *ullp) {return (xdr_u_int64_t (xdrs, (u_int64_t *)ullp)); }@@ -938,9 +938,9 @@ xdr_uint64_t(xdrs, ullp)* XDR hypers */ bool_t -xdr_hyper (xdrs, llp) -XDR *xdrs; -longlong_t *llp; +xdr_hyper ( +XDR *xdrs, +longlong_t *llp) {/* @@ -955,9 +955,9 @@ xdr_hyper(xdrs, llp)* XDR unsigned hypers */ bool_t -xdr_u_hyper (xdrs, ullp) -XDR *xdrs; -u_longlong_t *ullp; +xdr_u_hyper ( +XDR *xdrs, +u_longlong_t *ullp) {/* @@ -972,9 +972,9 @@ xdr_u_hyper(xdrs, ullp)* XDR longlong_t's */ bool_t -xdr_longlong_t (xdrs, llp) -XDR *xdrs; -longlong_t *llp; +xdr_longlong_t ( +XDR *xdrs, +longlong_t *llp) {/* @@ -989,9 +989,9 @@ xdr_longlong_t(xdrs, llp)* XDR u_longlong_t's */ bool_t -xdr_u_longlong_t (xdrs, ullp) -XDR *xdrs; -u_longlong_t *ullp; +xdr_u_longlong_t ( +XDR *xdrs, +u_longlong_t *ullp) {/* @@ -1005,9 +1005,9 @@ xdr_u_longlong_t(xdrs, ullp)* XDR quad_t */ bool_t -xdr_quad_t (xdrs, llp) -XDR *xdrs; -int64_t *llp; +xdr_quad_t ( +XDR *xdrs, +int64_t *llp) {return (xdr_int64_t (xdrs, (int64_t *)llp)); }@@ -1017,9 +1017,9 @@ xdr_quad_t(xdrs, llp)* XDR u_quad_t */ bool_t -xdr_u_quad_t (xdrs, ullp) -XDR *xdrs; -u_int64_t *ullp; +xdr_u_quad_t ( +XDR *xdrs, +u_int64_t *ullp) {return (xdr_u_int64_t (xdrs, (u_int64_t *)ullp)); }src/xdr_array.c +13
-13@@ -55,13 +55,13 @@* xdr procedure to call to handle each element of the array. */ bool_t -xdr_array (xdrs, addrp, sizep, maxsize, elsize, elproc) -XDR *xdrs; -caddr_t *addrp;/* array pointer */ -u_int *sizep;/* number of elements */ -u_int maxsize;/* max numberof elements */ -u_int elsize;/* size in bytes of each element */ -xdrproc_t elproc;/* xdr routine to handle each element */ +xdr_array ( +XDR *xdrs, +caddr_t *addrp,/* array pointer */ +u_int *sizep,/* number of elements */ +u_int maxsize,/* max numberof elements */ +u_int elsize,/* size in bytes of each element */ +xdrproc_t elproc)/* xdr routine to handle each element */ {u_int i;caddr_t target = *addrp;@@ -133,12 +133,12 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc)* > xdr_elem: routine to XDR each element */ bool_t -xdr_vector (xdrs, basep, nelem, elemsize, xdr_elem) -XDR *xdrs; -char *basep; -u_int nelem; -u_int elemsize; -xdrproc_t xdr_elem; +xdr_vector ( +XDR *xdrs, +char *basep, +u_int nelem, +u_int elemsize, +xdrproc_t xdr_elem) {u_int i;char *elptr;src/xdr_float.c +6
-6@@ -95,9 +95,9 @@ static struct sgl_limits {#endif /* vax */ bool_t -xdr_float (xdrs, fp) -XDR *xdrs; -float *fp; +xdr_float ( +XDR *xdrs, +float *fp) {#ifndef IEEEFP struct ieee_single is;@@ -197,9 +197,9 @@ static struct dbl_limits {bool_t -xdr_double (xdrs, dp) -XDR *xdrs; -double *dp; +xdr_double ( +XDR *xdrs, +double *dp) {#ifdef IEEEFP int32_t *i32p;src/xdr_mem.c +36
-38@@ -88,11 +88,11 @@ static const struct xdr_ops xdrmem_ops_unaligned = {* memory buffer. */ void -xdrmem_create (xdrs, addr, size, op) -XDR *xdrs; -char *addr; -u_int size; -enum xdr_op op; +xdrmem_create ( +XDR *xdrs, +char *addr, +u_int size, +enum xdr_op op) { xdrs->x_op = op;@@ -104,16 +104,15 @@ xdrmem_create(xdrs, addr, size, op)/*ARGSUSED*/ static void -xdrmem_destroy (xdrs) -XDR *xdrs; +xdrmem_destroy (XDR *xdrs) { }static bool_t -xdrmem_getlong_aligned (xdrs, lp) -XDR *xdrs; -long *lp; +xdrmem_getlong_aligned ( +XDR *xdrs, +long *lp) {if (xdrs->x_handy <sizeof (int32_t ))@@ -125,9 +124,9 @@ xdrmem_getlong_aligned(xdrs, lp) }static bool_t -xdrmem_putlong_aligned (xdrs, lp) -XDR *xdrs; -const long *lp; +xdrmem_putlong_aligned ( +XDR *xdrs, +const long *lp) {if (xdrs->x_handy <sizeof (int32_t ))@@ -139,9 +138,9 @@ xdrmem_putlong_aligned(xdrs, lp) }static bool_t -xdrmem_getlong_unaligned (xdrs, lp) -XDR *xdrs; -long *lp; +xdrmem_getlong_unaligned ( +XDR *xdrs, +long *lp) {u_int32_t l;@@ -155,9 +154,9 @@ xdrmem_getlong_unaligned(xdrs, lp) }static bool_t -xdrmem_putlong_unaligned (xdrs, lp) -XDR *xdrs; -const long *lp; +xdrmem_putlong_unaligned ( +XDR *xdrs, +const long *lp) {u_int32_t l;@@ -171,10 +170,10 @@ xdrmem_putlong_unaligned(xdrs, lp) }static bool_t -xdrmem_getbytes (xdrs, addr, len) -XDR *xdrs; -char *addr; -u_int len; +xdrmem_getbytes ( +XDR *xdrs, +char *addr, +u_int len) {if (xdrs->x_handy < len)@@ -186,10 +185,10 @@ xdrmem_getbytes(xdrs, addr, len) }static bool_t -xdrmem_putbytes (xdrs, addr, len) -XDR *xdrs; -const char *addr; -u_int len; +xdrmem_putbytes ( +XDR *xdrs, +const char *addr, +u_int len) {if (xdrs->x_handy < len)@@ -201,8 +200,7 @@ xdrmem_putbytes(xdrs, addr, len) }static u_int -xdrmem_getpos (xdrs) -XDR *xdrs; +xdrmem_getpos (XDR *xdrs) {/* XXX w/64-bit pointers, u_int not enough! */ @@ -210,9 +208,9 @@ xdrmem_getpos(xdrs) }static bool_t -xdrmem_setpos (xdrs, pos) -XDR *xdrs; -u_int pos; +xdrmem_setpos ( +XDR *xdrs, +u_int pos) {char *newaddr = xdrs->x_base + pos;char *lastaddr = (char *)xdrs->x_private + xdrs->x_handy;@@ -225,9 +223,9 @@ xdrmem_setpos(xdrs, pos) }static int32_t * -xdrmem_inline_aligned (xdrs ,len ) - XDR *xdrs; -u_int len; +xdrmem_inline_aligned ( +XDR *xdrs, +u_int len) {int32_t *buf =0 ;@@ -241,9 +239,9 @@ xdrmem_inline_aligned(xdrs, len)/* ARGSUSED */ static int32_t * -xdrmem_inline_unaligned (xdrs ,len ) - XDR *xdrs; -u_int len; +xdrmem_inline_unaligned ( +XDR *xdrs, +u_int len) {return (0 );src/xdr_rec.c +57
-64@@ -152,15 +152,15 @@ static bool_t realloc_stream(RECSTREAM *, int);* calls expect that they take an opaque handle rather than an fd. */ void -xdrrec_create (xdrs, sendsize, recvsize, tcp_handle, readit, writeit) -XDR *xdrs; -u_int sendsize; -u_int recvsize; -void *tcp_handle; +xdrrec_create ( +XDR *xdrs, +u_int sendsize, +u_int recvsize, +void *tcp_handle,/* like read, but pass it a tcp_handle, not sock */ -int (*readit)(void *,void *,int ); +int (*readit)(void *,void *,int ),/* like write, but pass it a tcp_handle, not sock */ -int (*writeit)(void *,void *,int ); +int (*writeit)(void *,void *,int )) {RECSTREAM *rstrm =mem_alloc (sizeof (RECSTREAM ));@@ -220,9 +220,9 @@ xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit)*/ static bool_t -xdrrec_getlong (xdrs, lp) -XDR *xdrs; -long *lp; +xdrrec_getlong ( +XDR *xdrs, +long *lp) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);int32_t *buflp = (int32_t *)(void *)(rstrm->in_finger);@@ -244,9 +244,9 @@ xdrrec_getlong(xdrs, lp) }static bool_t -xdrrec_putlong (xdrs, lp) -XDR *xdrs; -const long *lp; +xdrrec_putlong ( +XDR *xdrs, +const long *lp) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);int32_t *dest_lp = ((int32_t *)(void *)(rstrm->out_finger));@@ -268,10 +268,10 @@ xdrrec_putlong(xdrs, lp) }static bool_t /* must manage buffers, fragments, and records */ -xdrrec_getbytes (xdrs, addr, len) -XDR *xdrs; -char *addr; -u_int len; +xdrrec_getbytes ( +XDR *xdrs, +char *addr, +u_int len) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);int current;@@ -296,10 +296,10 @@ xdrrec_getbytes(xdrs, addr, len) }static bool_t -xdrrec_putbytes (xdrs, addr, len) -XDR *xdrs; -const char *addr; -u_int len; +xdrrec_putbytes ( +XDR *xdrs, +const char *addr, +u_int len) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);size_t current;@@ -322,8 +322,7 @@ xdrrec_putbytes(xdrs, addr, len) }static u_int -xdrrec_getpos (xdrs) -XDR *xdrs; +xdrrec_getpos (XDR *xdrs) {RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;off_t pos;@@ -348,9 +347,9 @@ xdrrec_getpos(xdrs) }static bool_t -xdrrec_setpos (xdrs, pos) -XDR *xdrs; -u_int pos; +xdrrec_setpos ( +XDR *xdrs, +u_int pos) {RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;u_int currpos =xdrrec_getpos (xdrs);@@ -387,9 +386,9 @@ xdrrec_setpos(xdrs, pos) }static int32_t * -xdrrec_inline (xdrs ,len ) - XDR *xdrs; -u_int len; +xdrrec_inline ( +XDR *xdrs, +u_int len) {RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;int32_t *buf =NULL ;@@ -419,8 +418,7 @@ xdrrec_inline(xdrs, len) }static void -xdrrec_destroy (xdrs) -XDR *xdrs; +xdrrec_destroy (XDR *xdrs) {RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;@@ -439,8 +437,7 @@ xdrrec_destroy(xdrs)* this procedure to guarantee proper record alignment. */ bool_t -xdrrec_skiprecord (xdrs) -XDR *xdrs; +xdrrec_skiprecord (XDR *xdrs) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);enum xprt_stat xstat;@@ -475,8 +472,7 @@ xdrrec_skiprecord(xdrs)* after consuming the rest of the current record. */ bool_t -xdrrec_eof (xdrs) -XDR *xdrs; +xdrrec_eof (XDR *xdrs) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);@@ -499,9 +495,9 @@ xdrrec_eof(xdrs)* pipelined procedure calls.) TRUE => immmediate flush to tcp connection. */ bool_t -xdrrec_endofrecord (xdrs, sendnow) -XDR *xdrs; -bool_t sendnow; +xdrrec_endofrecord ( +XDR *xdrs, +bool_t sendnow) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);u_long len;/* fragment length */ @@ -525,10 +521,10 @@ xdrrec_endofrecord(xdrs, sendnow)* Return true if a record is available in the buffer, false if not. */ bool_t -__xdrrec_getrec (xdrs, statp, expectdata) -XDR *xdrs; -enum xprt_stat *statp; -bool_t expectdata; +__xdrrec_getrec ( +XDR *xdrs, +enum xprt_stat *statp, +bool_t expectdata) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);ssize_t n;@@ -615,9 +611,9 @@ __xdrrec_getrec(xdrs, statp, expectdata) }bool_t -__xdrrec_setnonblock (xdrs, maxrec) -XDR *xdrs; -int maxrec; +__xdrrec_setnonblock ( +XDR *xdrs, +int maxrec) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);@@ -632,9 +628,9 @@ __xdrrec_setnonblock(xdrs, maxrec)* Internal useful routines */ static bool_t -flush_out (rstrm, eor) -RECSTREAM *rstrm; -bool_t eor; +flush_out ( +RECSTREAM *rstrm, +bool_t eor) {u_int32_t eormask = (eor == TRUE) ?LAST_FRAG :0 ; u_int32_t len = (u_int32_t)((u_long)(rstrm->out_finger) -@@ -652,8 +648,7 @@ flush_out(rstrm, eor) }static bool_t /* knows nothing about records! Only about input buffers */ -fill_input_buf (rstrm) -RECSTREAM *rstrm; +fill_input_buf (RECSTREAM *rstrm) {char *where;u_int32_t i;@@ -675,10 +670,10 @@ fill_input_buf(rstrm) }static bool_t /* knows nothing about records! Only about input buffers */ -get_input_bytes (rstrm, addr, len) -RECSTREAM *rstrm; -char *addr; -int len; +get_input_bytes ( +RECSTREAM *rstrm, +char *addr, +int len) {size_t current;@@ -708,8 +703,7 @@ get_input_bytes(rstrm, addr, len) }static bool_t /* next two bytes of the input stream are treated as a header */ -set_input_fragment (rstrm) -RECSTREAM *rstrm; +set_input_fragment (RECSTREAM *rstrm) {u_int32_t header;@@ -734,9 +728,9 @@ set_input_fragment(rstrm) }static bool_t /* consumes input bytes; knows nothing about records! */ -skip_input_bytes (rstrm, cnt) -RECSTREAM *rstrm; -long cnt; +skip_input_bytes ( +RECSTREAM *rstrm, +long cnt) {u_int32_t current;@@ -756,8 +750,7 @@ skip_input_bytes(rstrm, cnt) }static u_int -fix_buf_size (s) -u_int s; +fix_buf_size (u_int s) {if (s <100 )@@ -769,9 +762,9 @@ fix_buf_size(s)* Reallocate the input buffer for a non-block stream. */ static bool_t -realloc_stream (rstrm, size) -RECSTREAM *rstrm; -int size; +realloc_stream ( +RECSTREAM *rstrm, +int size) {ptrdiff_t diff;char *buf;src/xdr_reference.c +10
-10@@ -58,11 +58,11 @@* proc is the routine to handle the referenced structure. */ bool_t -xdr_reference (xdrs, pp, size, proc) -XDR *xdrs; -caddr_t *pp;/* the pointer to work on */ -u_int size;/* size of the object pointed to */ -xdrproc_t proc;/* xdr routine to handle the object */ +xdr_reference ( +XDR *xdrs, +caddr_t *pp,/* the pointer to work on */ +u_int size,/* size of the object pointed to */ +xdrproc_t proc)/* xdr routine to handle the object */ {caddr_t loc = *pp;bool_t stat;@@ -115,11 +115,11 @@ xdr_reference(xdrs, pp, size, proc)* */ bool_t -xdr_pointer (xdrs,objpp,obj_size,xdr_obj) -XDR *xdrs; -char **objpp; -u_int obj_size; -xdrproc_t xdr_obj; +xdr_pointer ( +XDR *xdrs, +char **objpp, +u_int obj_size, +xdrproc_t xdr_obj) {bool_t more_data;src/xdr_sizeof.c +10
-20@@ -44,9 +44,7 @@/* ARGSUSED */ static bool_t -x_putlong (xdrs, longp) -XDR *xdrs; -long *longp; +x_putlong (XDR *xdrs,const long *longp) { xdrs->x_handy +=BYTES_PER_XDR_UNIT ;return (TRUE);@@ -54,36 +52,31 @@ x_putlong(xdrs, longp)/* ARGSUSED */ static bool_t -x_putbytes (xdrs, bp, len) -XDR *xdrs; -char *bp; -u_int len; +x_putbytes ( +XDR *xdrs, +const char *bp, +u_int len) { xdrs->x_handy += len;return (TRUE); }static u_int -x_getpostn (xdrs) -XDR *xdrs; +x_getpostn (XDR *xdrs) {return (xdrs->x_handy); }/* ARGSUSED */ static bool_t -x_setpostn (xdrs, pos) -XDR *xdrs; -u_int pos; +x_setpostn (XDR *xdrs,u_int pos) {/* This is not allowed */ return (FALSE); }static int32_t * -x_inline (xdrs ,len ) - XDR *xdrs; -u_int len; +x_inline (XDR *xdrs,u_int len) {if (len ==0 ) {return (NULL );@@ -117,8 +110,7 @@ harmless() }static void -x_destroy (xdrs) -XDR *xdrs; +x_destroy (XDR *xdrs) { xdrs->x_handy =0 ; xdrs->x_base =0 ;@@ -130,9 +122,7 @@ x_destroy(xdrs) }unsigned long -xdr_sizeof (func, data) -xdrproc_t func; -void *data; +xdr_sizeof (xdrproc_t func,void *data) {XDR x;struct xdr_ops ops;src/xdr_stdio.c +26
-28@@ -74,10 +74,10 @@ static const struct xdr_ops xdrstdio_ops = {* Operation flag is set to op. */ void -xdrstdio_create (xdrs, file, op) -XDR *xdrs; -FILE *file; -enum xdr_op op; +xdrstdio_create ( +XDR *xdrs, +FILE *file, +enum xdr_op op) { xdrs->x_op = op;@@ -92,17 +92,16 @@ xdrstdio_create(xdrs, file, op)* Cleans up the xdr stream handle xdrs previously set up by xdrstdio_create. */ static void -xdrstdio_destroy (xdrs) -XDR *xdrs; +xdrstdio_destroy (XDR *xdrs) { (void )fflush ((FILE *)xdrs->x_private);/* XXX: should we close the file ?? */ }static bool_t -xdrstdio_getlong (xdrs, lp) -XDR *xdrs; -long *lp; +xdrstdio_getlong ( +XDR *xdrs, +long *lp) {int32_t mycopy;@@ -114,9 +113,9 @@ xdrstdio_getlong(xdrs, lp) }static bool_t -xdrstdio_putlong (xdrs, lp) -XDR *xdrs; -const long *lp; +xdrstdio_putlong ( +XDR *xdrs, +const long *lp) {int32_t mycopy;@@ -132,10 +131,10 @@ xdrstdio_putlong(xdrs, lp) }static bool_t -xdrstdio_getbytes (xdrs, addr, len) -XDR *xdrs; -char *addr; -u_int len; +xdrstdio_getbytes ( +XDR *xdrs, +char *addr, +u_int len) {if ((len !=0 ) && (fread (addr, (size_t )len,1 , (FILE *)xdrs->x_private) !=1 ))@@ -144,10 +143,10 @@ xdrstdio_getbytes(xdrs, addr, len) }static bool_t -xdrstdio_putbytes (xdrs, addr, len) -XDR *xdrs; -const char *addr; -u_int len; +xdrstdio_putbytes ( +XDR *xdrs, +const char *addr, +u_int len) { if ((len != 0) && (fwrite(addr, (size_t)len, 1,@@ -157,17 +156,16 @@ xdrstdio_putbytes(xdrs, addr, len) }static u_int -xdrstdio_getpos (xdrs) -XDR *xdrs; +xdrstdio_getpos (XDR *xdrs) {return ((u_int )ftell ((FILE *)xdrs->x_private)); }static bool_t -xdrstdio_setpos (xdrs, pos) -XDR *xdrs; -u_int pos; +xdrstdio_setpos ( +XDR *xdrs, +u_int pos) { return ((fseek((FILE *)xdrs->x_private, (long)pos, 0) < 0) ?@@ -176,9 +174,9 @@ xdrstdio_setpos(xdrs, pos)/* ARGSUSED */ static int32_t * -xdrstdio_inline (xdrs ,len ) - XDR *xdrs; -u_int len; +xdrstdio_inline ( +XDR *xdrs, +u_int len) {/*
Quoted 10 lines · Steve Dickson via Libtirpc-devel
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 <[email protected]>
Committed... (tag: libtirpc-1-3-7-rc4)
steved.
Quoted 1,229 lines
--- src/xdr.c | 224 ++++++++++++++++++++++---------------------- src/xdr_array.c | 26 ++--- src/xdr_float.c | 12 +-- src/xdr_mem.c | 74 +++++++-------- src/xdr_rec.c | 121 +++++++++++------------- src/xdr_reference.c | 20 ++-- src/xdr_sizeof.c | 30 ++---- src/xdr_stdio.c | 54 +++++------ 8 files changed, 270 insertions(+), 291 deletions(-)src/xdr.c +112
-112@@ -66,9 +66,9 @@ static const char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 };* Not a filter, but a convenient utility nonetheless */ void -xdr_free (proc, objp) -xdrproc_t proc; -void *objp; +xdr_free ( +xdrproc_t proc, +void *objp) {XDR x;@@ -91,9 +91,9 @@ xdr_void(void)* XDR integers */ bool_t -xdr_int (xdrs, ip) -XDR *xdrs; -int *ip; +xdr_int ( +XDR *xdrs, +int *ip) {long l;@@ -121,9 +121,9 @@ xdr_int(xdrs, ip)* XDR unsigned integers */ bool_t -xdr_u_int (xdrs, up) -XDR *xdrs; -u_int *up; +xdr_u_int ( +XDR *xdrs, +u_int *up) {u_long l;@@ -153,9 +153,9 @@ xdr_u_int(xdrs, up)* same as xdr_u_long - open coded to save a proc call! */ bool_t -xdr_long (xdrs, lp) -XDR *xdrs; -long *lp; +xdr_long ( +XDR *xdrs, +long *lp) {switch (xdrs->x_op) {case XDR_ENCODE :@@ -174,9 +174,9 @@ xdr_long(xdrs, lp)* same as xdr_long - open coded to save a proc call! */ bool_t -xdr_u_long (xdrs, ulp) -XDR *xdrs; -u_long *ulp; +xdr_u_long ( +XDR *xdrs, +u_long *ulp) {switch (xdrs->x_op) {case XDR_ENCODE :@@ -196,9 +196,9 @@ xdr_u_long(xdrs, ulp)* same as xdr_u_int32_t - open coded to save a proc call! */ bool_t -xdr_int32_t (xdrs, int32_p) -XDR *xdrs; -int32_t *int32_p; +xdr_int32_t ( +XDR *xdrs, +int32_t *int32_p) {long l;@@ -227,9 +227,9 @@ xdr_int32_t(xdrs, int32_p)* same as xdr_int32_t - open coded to save a proc call! */ bool_t -xdr_u_int32_t (xdrs, u_int32_p) -XDR *xdrs; -u_int32_t *u_int32_p; +xdr_u_int32_t ( +XDR *xdrs, +u_int32_t *u_int32_p) {u_long l;@@ -258,9 +258,9 @@ xdr_u_int32_t(xdrs, u_int32_p)* XDR unsigned 32-bit integers */ bool_t -xdr_uint32_t (xdrs, uint32_p) -XDR *xdrs; -uint32_t *uint32_p; +xdr_uint32_t ( +XDR *xdrs, +uint32_t *uint32_p) {return (xdr_u_int32_t (xdrs, (u_int32_t *)uint32_p)); }@@ -270,9 +270,9 @@ xdr_uint32_t(xdrs, uint32_p)* XDR short integers */ bool_t -xdr_short (xdrs, sp) -XDR *xdrs; -short *sp; +xdr_short ( +XDR *xdrs, +short *sp) {long l;@@ -300,9 +300,9 @@ xdr_short(xdrs, sp)* XDR unsigned short integers */ bool_t -xdr_u_short (xdrs, usp) -XDR *xdrs; -u_short *usp; +xdr_u_short ( +XDR *xdrs, +u_short *usp) {u_long l;@@ -331,9 +331,9 @@ xdr_u_short(xdrs, usp)* XDR 16-bit integers */ bool_t -xdr_int16_t (xdrs, int16_p) -XDR *xdrs; -int16_t *int16_p; +xdr_int16_t ( +XDR *xdrs, +int16_t *int16_p) {long l;@@ -361,9 +361,9 @@ xdr_int16_t(xdrs, int16_p)* XDR unsigned 16-bit integers */ bool_t -xdr_u_int16_t (xdrs, u_int16_p) -XDR *xdrs; -u_int16_t *u_int16_p; +xdr_u_int16_t ( +XDR *xdrs, +u_int16_t *u_int16_p) {u_long l;@@ -392,9 +392,9 @@ xdr_u_int16_t(xdrs, u_int16_p)* XDR unsigned 16-bit integers */ bool_t -xdr_uint16_t (xdrs, uint16_p) -XDR *xdrs; -uint16_t *uint16_p; +xdr_uint16_t ( +XDR *xdrs, +uint16_t *uint16_p) {return (xdr_u_int16_t (xdrs, (u_int16_t *)uint16_p)); }@@ -404,9 +404,9 @@ xdr_uint16_t(xdrs, uint16_p)* XDR 8-bit integers */ bool_t -xdr_int8_t (xdrs, int8_p) -XDR *xdrs; -int8_t *int8_p; +xdr_int8_t ( +XDR *xdrs, +int8_t *int8_p) {long l;@@ -435,9 +435,9 @@ xdr_int8_t(xdrs, int8_p)* XDR unsigned 8-bit integers */ bool_t -xdr_u_int8_t (xdrs, uint8_p) -XDR *xdrs; -uint8_t *uint8_p; +xdr_u_int8_t ( +XDR *xdrs, +uint8_t *uint8_p) {u_long l;@@ -466,9 +466,9 @@ xdr_u_int8_t(xdrs, uint8_p)* XDR unsigned 8-bit integers */ bool_t -xdr_uint8_t (xdrs, uint8_p) -XDR *xdrs; -uint8_t *uint8_p; +xdr_uint8_t ( +XDR *xdrs, +uint8_t *uint8_p) {return (xdr_u_int8_t (xdrs, (uint8_t *)uint8_p)); }@@ -478,9 +478,9 @@ xdr_uint8_t(xdrs, uint8_p)* XDR a char */ bool_t -xdr_char (xdrs, cp) -XDR *xdrs; -char *cp; +xdr_char ( +XDR *xdrs, +char *cp) {int i;@@ -496,9 +496,9 @@ xdr_char(xdrs, cp)* XDR an unsigned char */ bool_t -xdr_u_char (xdrs, cp) -XDR *xdrs; -u_char *cp; +xdr_u_char ( +XDR *xdrs, +u_char *cp) {u_int u;@@ -514,9 +514,9 @@ xdr_u_char(xdrs, cp)* XDR booleans */ bool_t -xdr_bool (xdrs, bp) -XDR *xdrs; -bool_t *bp; +xdr_bool ( +XDR *xdrs, +bool_t *bp) {long lb;@@ -544,9 +544,9 @@ xdr_bool(xdrs, bp)* XDR enumerations */ bool_t -xdr_enum (xdrs, ep) -XDR *xdrs; -enum_t *ep; +xdr_enum ( +XDR *xdrs, +enum_t *ep) {enum sizecheck {SIZEVAL };/* used to find the size of an enum */ @@ -570,10 +570,10 @@ xdr_enum(xdrs, ep)* cp points to the opaque object and cnt gives the byte length. */ bool_t -xdr_opaque (xdrs, cp, cnt) -XDR *xdrs; -caddr_t cp; -u_int cnt; +xdr_opaque ( +XDR *xdrs, +caddr_t cp, +u_int cnt) {u_int rndup;static int crud[BYTES_PER_XDR_UNIT ];@@ -622,11 +622,11 @@ xdr_opaque(xdrs, cp, cnt)* If *cpp is NULL maxsize bytes are allocated */ bool_t -xdr_bytes (xdrs, cpp, sizep, maxsize) -XDR *xdrs; -char **cpp; -u_int *sizep; -u_int maxsize; +xdr_bytes ( +XDR *xdrs, +char **cpp, +u_int *sizep, +u_int maxsize) {char *sp = *cpp;/* sp is the actual string pointer */ u_int nodesize;@@ -687,9 +687,9 @@ xdr_bytes(xdrs, cpp, sizep, maxsize)* Implemented here due to commonality of the object. */ bool_t -xdr_netobj (xdrs, np) -XDR *xdrs; -struct netobj *np; +xdr_netobj ( +XDR *xdrs, +struct netobj *np) {return (xdr_bytes (xdrs, &np->n_bytes, &np->n_len,MAX_NETOBJ_SZ ));@@ -707,12 +707,12 @@ xdr_netobj(xdrs, np)* If there is no specific or default routine an error is returned. */ bool_t -xdr_union (xdrs, dscmp, unp, choices, dfault) -XDR *xdrs; -enum_t *dscmp;/* enum to decide which arm to work on */ -char *unp;/* the union itself */ -const struct xdr_discrim *choices;/* [value, xdr proc] for each arm */ -xdrproc_t dfault;/* default xdr routine */ +xdr_union ( +XDR *xdrs, +enum_t *dscmp,/* enum to decide which arm to work on */ +char *unp,/* the union itself */ +const struct xdr_discrim *choices,/* [value, xdr proc] for each arm */ +xdrproc_t dfault)/* default xdr routine */ {enum_t dscm;@@ -756,10 +756,10 @@ xdr_union(xdrs, dscmp, unp, choices, dfault)* of the string as specified by a protocol. */ bool_t -xdr_string (xdrs, cpp, maxsize) -XDR *xdrs; -char **cpp; -u_int maxsize; +xdr_string ( +XDR *xdrs, +char **cpp, +u_int maxsize) {char *sp = *cpp;/* sp is the actual string pointer */ u_int size;@@ -839,9 +839,9 @@ xdr_string(xdrs, cpp, maxsize)* routines like clnt_call */ bool_t -xdr_wrapstring (xdrs, cpp) -XDR *xdrs; -char **cpp; +xdr_wrapstring ( +XDR *xdrs, +char **cpp) {return xdr_string (xdrs, cpp,RPC_MAXDATASIZE ); }@@ -858,9 +858,9 @@ xdr_wrapstring(xdrs, cpp)* XDR 64-bit integers */ bool_t -xdr_int64_t (xdrs, llp) -XDR *xdrs; -int64_t *llp; +xdr_int64_t ( +XDR *xdrs, +int64_t *llp) {u_long ul[2 ];@@ -892,9 +892,9 @@ xdr_int64_t(xdrs, llp)* XDR unsigned 64-bit integers */ bool_t -xdr_u_int64_t (xdrs, ullp) -XDR *xdrs; -u_int64_t *ullp; +xdr_u_int64_t ( +XDR *xdrs, +u_int64_t *ullp) {u_long ul[2 ];@@ -926,9 +926,9 @@ xdr_u_int64_t(xdrs, ullp)* XDR unsigned 64-bit integers */ bool_t -xdr_uint64_t (xdrs, ullp) -XDR *xdrs; -uint64_t *ullp; +xdr_uint64_t ( +XDR *xdrs, +uint64_t *ullp) {return (xdr_u_int64_t (xdrs, (u_int64_t *)ullp)); }@@ -938,9 +938,9 @@ xdr_uint64_t(xdrs, ullp)* XDR hypers */ bool_t -xdr_hyper (xdrs, llp) -XDR *xdrs; -longlong_t *llp; +xdr_hyper ( +XDR *xdrs, +longlong_t *llp) {/* @@ -955,9 +955,9 @@ xdr_hyper(xdrs, llp)* XDR unsigned hypers */ bool_t -xdr_u_hyper (xdrs, ullp) -XDR *xdrs; -u_longlong_t *ullp; +xdr_u_hyper ( +XDR *xdrs, +u_longlong_t *ullp) {/* @@ -972,9 +972,9 @@ xdr_u_hyper(xdrs, ullp)* XDR longlong_t's */ bool_t -xdr_longlong_t (xdrs, llp) -XDR *xdrs; -longlong_t *llp; +xdr_longlong_t ( +XDR *xdrs, +longlong_t *llp) {/* @@ -989,9 +989,9 @@ xdr_longlong_t(xdrs, llp)* XDR u_longlong_t's */ bool_t -xdr_u_longlong_t (xdrs, ullp) -XDR *xdrs; -u_longlong_t *ullp; +xdr_u_longlong_t ( +XDR *xdrs, +u_longlong_t *ullp) {/* @@ -1005,9 +1005,9 @@ xdr_u_longlong_t(xdrs, ullp)* XDR quad_t */ bool_t -xdr_quad_t (xdrs, llp) -XDR *xdrs; -int64_t *llp; +xdr_quad_t ( +XDR *xdrs, +int64_t *llp) {return (xdr_int64_t (xdrs, (int64_t *)llp)); }@@ -1017,9 +1017,9 @@ xdr_quad_t(xdrs, llp)* XDR u_quad_t */ bool_t -xdr_u_quad_t (xdrs, ullp) -XDR *xdrs; -u_int64_t *ullp; +xdr_u_quad_t ( +XDR *xdrs, +u_int64_t *ullp) {return (xdr_u_int64_t (xdrs, (u_int64_t *)ullp)); }src/xdr_array.c +13
-13@@ -55,13 +55,13 @@* xdr procedure to call to handle each element of the array. */ bool_t -xdr_array (xdrs, addrp, sizep, maxsize, elsize, elproc) -XDR *xdrs; -caddr_t *addrp;/* array pointer */ -u_int *sizep;/* number of elements */ -u_int maxsize;/* max numberof elements */ -u_int elsize;/* size in bytes of each element */ -xdrproc_t elproc;/* xdr routine to handle each element */ +xdr_array ( +XDR *xdrs, +caddr_t *addrp,/* array pointer */ +u_int *sizep,/* number of elements */ +u_int maxsize,/* max numberof elements */ +u_int elsize,/* size in bytes of each element */ +xdrproc_t elproc)/* xdr routine to handle each element */ {u_int i;caddr_t target = *addrp;@@ -133,12 +133,12 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc)* > xdr_elem: routine to XDR each element */ bool_t -xdr_vector (xdrs, basep, nelem, elemsize, xdr_elem) -XDR *xdrs; -char *basep; -u_int nelem; -u_int elemsize; -xdrproc_t xdr_elem; +xdr_vector ( +XDR *xdrs, +char *basep, +u_int nelem, +u_int elemsize, +xdrproc_t xdr_elem) {u_int i;char *elptr;src/xdr_float.c +6
-6@@ -95,9 +95,9 @@ static struct sgl_limits {#endif /* vax */ bool_t -xdr_float (xdrs, fp) -XDR *xdrs; -float *fp; +xdr_float ( +XDR *xdrs, +float *fp) {#ifndef IEEEFP struct ieee_single is;@@ -197,9 +197,9 @@ static struct dbl_limits {bool_t -xdr_double (xdrs, dp) -XDR *xdrs; -double *dp; +xdr_double ( +XDR *xdrs, +double *dp) {#ifdef IEEEFP int32_t *i32p;src/xdr_mem.c +36
-38@@ -88,11 +88,11 @@ static const struct xdr_ops xdrmem_ops_unaligned = {* memory buffer. */ void -xdrmem_create (xdrs, addr, size, op) -XDR *xdrs; -char *addr; -u_int size; -enum xdr_op op; +xdrmem_create ( +XDR *xdrs, +char *addr, +u_int size, +enum xdr_op op) { xdrs->x_op = op;@@ -104,16 +104,15 @@ xdrmem_create(xdrs, addr, size, op)/*ARGSUSED*/ static void -xdrmem_destroy (xdrs) -XDR *xdrs; +xdrmem_destroy (XDR *xdrs) { }static bool_t -xdrmem_getlong_aligned (xdrs, lp) -XDR *xdrs; -long *lp; +xdrmem_getlong_aligned ( +XDR *xdrs, +long *lp) {if (xdrs->x_handy <sizeof (int32_t ))@@ -125,9 +124,9 @@ xdrmem_getlong_aligned(xdrs, lp) }static bool_t -xdrmem_putlong_aligned (xdrs, lp) -XDR *xdrs; -const long *lp; +xdrmem_putlong_aligned ( +XDR *xdrs, +const long *lp) {if (xdrs->x_handy <sizeof (int32_t ))@@ -139,9 +138,9 @@ xdrmem_putlong_aligned(xdrs, lp) }static bool_t -xdrmem_getlong_unaligned (xdrs, lp) -XDR *xdrs; -long *lp; +xdrmem_getlong_unaligned ( +XDR *xdrs, +long *lp) {u_int32_t l;@@ -155,9 +154,9 @@ xdrmem_getlong_unaligned(xdrs, lp) }static bool_t -xdrmem_putlong_unaligned (xdrs, lp) -XDR *xdrs; -const long *lp; +xdrmem_putlong_unaligned ( +XDR *xdrs, +const long *lp) {u_int32_t l;@@ -171,10 +170,10 @@ xdrmem_putlong_unaligned(xdrs, lp) }static bool_t -xdrmem_getbytes (xdrs, addr, len) -XDR *xdrs; -char *addr; -u_int len; +xdrmem_getbytes ( +XDR *xdrs, +char *addr, +u_int len) {if (xdrs->x_handy < len)@@ -186,10 +185,10 @@ xdrmem_getbytes(xdrs, addr, len) }static bool_t -xdrmem_putbytes (xdrs, addr, len) -XDR *xdrs; -const char *addr; -u_int len; +xdrmem_putbytes ( +XDR *xdrs, +const char *addr, +u_int len) {if (xdrs->x_handy < len)@@ -201,8 +200,7 @@ xdrmem_putbytes(xdrs, addr, len) }static u_int -xdrmem_getpos (xdrs) -XDR *xdrs; +xdrmem_getpos (XDR *xdrs) {/* XXX w/64-bit pointers, u_int not enough! */ @@ -210,9 +208,9 @@ xdrmem_getpos(xdrs) }static bool_t -xdrmem_setpos (xdrs, pos) -XDR *xdrs; -u_int pos; +xdrmem_setpos ( +XDR *xdrs, +u_int pos) {char *newaddr = xdrs->x_base + pos;char *lastaddr = (char *)xdrs->x_private + xdrs->x_handy;@@ -225,9 +223,9 @@ xdrmem_setpos(xdrs, pos) }static int32_t * -xdrmem_inline_aligned (xdrs ,len ) - XDR *xdrs; -u_int len; +xdrmem_inline_aligned ( +XDR *xdrs, +u_int len) {int32_t *buf =0 ;@@ -241,9 +239,9 @@ xdrmem_inline_aligned(xdrs, len)/* ARGSUSED */ static int32_t * -xdrmem_inline_unaligned (xdrs ,len ) - XDR *xdrs; -u_int len; +xdrmem_inline_unaligned ( +XDR *xdrs, +u_int len) {return (0 );src/xdr_rec.c +57
-64@@ -152,15 +152,15 @@ static bool_t realloc_stream(RECSTREAM *, int);* calls expect that they take an opaque handle rather than an fd. */ void -xdrrec_create (xdrs, sendsize, recvsize, tcp_handle, readit, writeit) -XDR *xdrs; -u_int sendsize; -u_int recvsize; -void *tcp_handle; +xdrrec_create ( +XDR *xdrs, +u_int sendsize, +u_int recvsize, +void *tcp_handle,/* like read, but pass it a tcp_handle, not sock */ -int (*readit)(void *,void *,int ); +int (*readit)(void *,void *,int ),/* like write, but pass it a tcp_handle, not sock */ -int (*writeit)(void *,void *,int ); +int (*writeit)(void *,void *,int )) {RECSTREAM *rstrm =mem_alloc (sizeof (RECSTREAM ));@@ -220,9 +220,9 @@ xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit)*/ static bool_t -xdrrec_getlong (xdrs, lp) -XDR *xdrs; -long *lp; +xdrrec_getlong ( +XDR *xdrs, +long *lp) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);int32_t *buflp = (int32_t *)(void *)(rstrm->in_finger);@@ -244,9 +244,9 @@ xdrrec_getlong(xdrs, lp) }static bool_t -xdrrec_putlong (xdrs, lp) -XDR *xdrs; -const long *lp; +xdrrec_putlong ( +XDR *xdrs, +const long *lp) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);int32_t *dest_lp = ((int32_t *)(void *)(rstrm->out_finger));@@ -268,10 +268,10 @@ xdrrec_putlong(xdrs, lp) }static bool_t /* must manage buffers, fragments, and records */ -xdrrec_getbytes (xdrs, addr, len) -XDR *xdrs; -char *addr; -u_int len; +xdrrec_getbytes ( +XDR *xdrs, +char *addr, +u_int len) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);int current;@@ -296,10 +296,10 @@ xdrrec_getbytes(xdrs, addr, len) }static bool_t -xdrrec_putbytes (xdrs, addr, len) -XDR *xdrs; -const char *addr; -u_int len; +xdrrec_putbytes ( +XDR *xdrs, +const char *addr, +u_int len) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);size_t current;@@ -322,8 +322,7 @@ xdrrec_putbytes(xdrs, addr, len) }static u_int -xdrrec_getpos (xdrs) -XDR *xdrs; +xdrrec_getpos (XDR *xdrs) {RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;off_t pos;@@ -348,9 +347,9 @@ xdrrec_getpos(xdrs) }static bool_t -xdrrec_setpos (xdrs, pos) -XDR *xdrs; -u_int pos; +xdrrec_setpos ( +XDR *xdrs, +u_int pos) {RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;u_int currpos =xdrrec_getpos (xdrs);@@ -387,9 +386,9 @@ xdrrec_setpos(xdrs, pos) }static int32_t * -xdrrec_inline (xdrs ,len ) - XDR *xdrs; -u_int len; +xdrrec_inline ( +XDR *xdrs, +u_int len) {RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;int32_t *buf =NULL ;@@ -419,8 +418,7 @@ xdrrec_inline(xdrs, len) }static void -xdrrec_destroy (xdrs) -XDR *xdrs; +xdrrec_destroy (XDR *xdrs) {RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;@@ -439,8 +437,7 @@ xdrrec_destroy(xdrs)* this procedure to guarantee proper record alignment. */ bool_t -xdrrec_skiprecord (xdrs) -XDR *xdrs; +xdrrec_skiprecord (XDR *xdrs) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);enum xprt_stat xstat;@@ -475,8 +472,7 @@ xdrrec_skiprecord(xdrs)* after consuming the rest of the current record. */ bool_t -xdrrec_eof (xdrs) -XDR *xdrs; +xdrrec_eof (XDR *xdrs) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);@@ -499,9 +495,9 @@ xdrrec_eof(xdrs)* pipelined procedure calls.) TRUE => immmediate flush to tcp connection. */ bool_t -xdrrec_endofrecord (xdrs, sendnow) -XDR *xdrs; -bool_t sendnow; +xdrrec_endofrecord ( +XDR *xdrs, +bool_t sendnow) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);u_long len;/* fragment length */ @@ -525,10 +521,10 @@ xdrrec_endofrecord(xdrs, sendnow)* Return true if a record is available in the buffer, false if not. */ bool_t -__xdrrec_getrec (xdrs, statp, expectdata) -XDR *xdrs; -enum xprt_stat *statp; -bool_t expectdata; +__xdrrec_getrec ( +XDR *xdrs, +enum xprt_stat *statp, +bool_t expectdata) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);ssize_t n;@@ -615,9 +611,9 @@ __xdrrec_getrec(xdrs, statp, expectdata) }bool_t -__xdrrec_setnonblock (xdrs, maxrec) -XDR *xdrs; -int maxrec; +__xdrrec_setnonblock ( +XDR *xdrs, +int maxrec) {RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private);@@ -632,9 +628,9 @@ __xdrrec_setnonblock(xdrs, maxrec)* Internal useful routines */ static bool_t -flush_out (rstrm, eor) -RECSTREAM *rstrm; -bool_t eor; +flush_out ( +RECSTREAM *rstrm, +bool_t eor) {u_int32_t eormask = (eor == TRUE) ?LAST_FRAG :0 ; u_int32_t len = (u_int32_t)((u_long)(rstrm->out_finger) -@@ -652,8 +648,7 @@ flush_out(rstrm, eor) }static bool_t /* knows nothing about records! Only about input buffers */ -fill_input_buf (rstrm) -RECSTREAM *rstrm; +fill_input_buf (RECSTREAM *rstrm) {char *where;u_int32_t i;@@ -675,10 +670,10 @@ fill_input_buf(rstrm) }static bool_t /* knows nothing about records! Only about input buffers */ -get_input_bytes (rstrm, addr, len) -RECSTREAM *rstrm; -char *addr; -int len; +get_input_bytes ( +RECSTREAM *rstrm, +char *addr, +int len) {size_t current;@@ -708,8 +703,7 @@ get_input_bytes(rstrm, addr, len) }static bool_t /* next two bytes of the input stream are treated as a header */ -set_input_fragment (rstrm) -RECSTREAM *rstrm; +set_input_fragment (RECSTREAM *rstrm) {u_int32_t header;@@ -734,9 +728,9 @@ set_input_fragment(rstrm) }static bool_t /* consumes input bytes; knows nothing about records! */ -skip_input_bytes (rstrm, cnt) -RECSTREAM *rstrm; -long cnt; +skip_input_bytes ( +RECSTREAM *rstrm, +long cnt) {u_int32_t current;@@ -756,8 +750,7 @@ skip_input_bytes(rstrm, cnt) }static u_int -fix_buf_size (s) -u_int s; +fix_buf_size (u_int s) {if (s <100 )@@ -769,9 +762,9 @@ fix_buf_size(s)* Reallocate the input buffer for a non-block stream. */ static bool_t -realloc_stream (rstrm, size) -RECSTREAM *rstrm; -int size; +realloc_stream ( +RECSTREAM *rstrm, +int size) {ptrdiff_t diff;char *buf;src/xdr_reference.c +10
-10@@ -58,11 +58,11 @@* proc is the routine to handle the referenced structure. */ bool_t -xdr_reference (xdrs, pp, size, proc) -XDR *xdrs; -caddr_t *pp;/* the pointer to work on */ -u_int size;/* size of the object pointed to */ -xdrproc_t proc;/* xdr routine to handle the object */ +xdr_reference ( +XDR *xdrs, +caddr_t *pp,/* the pointer to work on */ +u_int size,/* size of the object pointed to */ +xdrproc_t proc)/* xdr routine to handle the object */ {caddr_t loc = *pp;bool_t stat;@@ -115,11 +115,11 @@ xdr_reference(xdrs, pp, size, proc)* */ bool_t -xdr_pointer (xdrs,objpp,obj_size,xdr_obj) -XDR *xdrs; -char **objpp; -u_int obj_size; -xdrproc_t xdr_obj; +xdr_pointer ( +XDR *xdrs, +char **objpp, +u_int obj_size, +xdrproc_t xdr_obj) {bool_t more_data;src/xdr_sizeof.c +10
-20@@ -44,9 +44,7 @@/* ARGSUSED */ static bool_t -x_putlong (xdrs, longp) -XDR *xdrs; -long *longp; +x_putlong (XDR *xdrs,const long *longp) { xdrs->x_handy +=BYTES_PER_XDR_UNIT ;return (TRUE);@@ -54,36 +52,31 @@ x_putlong(xdrs, longp)/* ARGSUSED */ static bool_t -x_putbytes (xdrs, bp, len) -XDR *xdrs; -char *bp; -u_int len; +x_putbytes ( +XDR *xdrs, +const char *bp, +u_int len) { xdrs->x_handy += len;return (TRUE); }static u_int -x_getpostn (xdrs) -XDR *xdrs; +x_getpostn (XDR *xdrs) {return (xdrs->x_handy); }/* ARGSUSED */ static bool_t -x_setpostn (xdrs, pos) -XDR *xdrs; -u_int pos; +x_setpostn (XDR *xdrs,u_int pos) {/* This is not allowed */ return (FALSE); }static int32_t * -x_inline (xdrs ,len ) - XDR *xdrs; -u_int len; +x_inline (XDR *xdrs,u_int len) {if (len ==0 ) {return (NULL );@@ -117,8 +110,7 @@ harmless() }static void -x_destroy (xdrs) -XDR *xdrs; +x_destroy (XDR *xdrs) { xdrs->x_handy =0 ; xdrs->x_base =0 ;@@ -130,9 +122,7 @@ x_destroy(xdrs) }unsigned long -xdr_sizeof (func, data) -xdrproc_t func; -void *data; +xdr_sizeof (xdrproc_t func,void *data) {XDR x;struct xdr_ops ops;src/xdr_stdio.c +26
-28@@ -74,10 +74,10 @@ static const struct xdr_ops xdrstdio_ops = {* Operation flag is set to op. */ void -xdrstdio_create (xdrs, file, op) -XDR *xdrs; -FILE *file; -enum xdr_op op; +xdrstdio_create ( +XDR *xdrs, +FILE *file, +enum xdr_op op) { xdrs->x_op = op;@@ -92,17 +92,16 @@ xdrstdio_create(xdrs, file, op)* Cleans up the xdr stream handle xdrs previously set up by xdrstdio_create. */ static void -xdrstdio_destroy (xdrs) -XDR *xdrs; +xdrstdio_destroy (XDR *xdrs) { (void )fflush ((FILE *)xdrs->x_private);/* XXX: should we close the file ?? */ }static bool_t -xdrstdio_getlong (xdrs, lp) -XDR *xdrs; -long *lp; +xdrstdio_getlong ( +XDR *xdrs, +long *lp) {int32_t mycopy;@@ -114,9 +113,9 @@ xdrstdio_getlong(xdrs, lp) }static bool_t -xdrstdio_putlong (xdrs, lp) -XDR *xdrs; -const long *lp; +xdrstdio_putlong ( +XDR *xdrs, +const long *lp) {int32_t mycopy;@@ -132,10 +131,10 @@ xdrstdio_putlong(xdrs, lp) }static bool_t -xdrstdio_getbytes (xdrs, addr, len) -XDR *xdrs; -char *addr; -u_int len; +xdrstdio_getbytes ( +XDR *xdrs, +char *addr, +u_int len) {if ((len !=0 ) && (fread (addr, (size_t )len,1 , (FILE *)xdrs->x_private) !=1 ))@@ -144,10 +143,10 @@ xdrstdio_getbytes(xdrs, addr, len) }static bool_t -xdrstdio_putbytes (xdrs, addr, len) -XDR *xdrs; -const char *addr; -u_int len; +xdrstdio_putbytes ( +XDR *xdrs, +const char *addr, +u_int len) { if ((len != 0) && (fwrite(addr, (size_t)len, 1,@@ -157,17 +156,16 @@ xdrstdio_putbytes(xdrs, addr, len) }static u_int -xdrstdio_getpos (xdrs) -XDR *xdrs; +xdrstdio_getpos (XDR *xdrs) {return ((u_int )ftell ((FILE *)xdrs->x_private)); }static bool_t -xdrstdio_setpos (xdrs, pos) -XDR *xdrs; -u_int pos; +xdrstdio_setpos ( +XDR *xdrs, +u_int pos) { return ((fseek((FILE *)xdrs->x_private, (long)pos, 0) < 0) ?@@ -176,9 +174,9 @@ xdrstdio_setpos(xdrs, pos)/* ARGSUSED */ static int32_t * -xdrstdio_inline (xdrs ,len ) - XDR *xdrs; -u_int len; +xdrstdio_inline ( +XDR *xdrs, +u_int len) {/*
PATCH 2/12 Convert old-style function definitions into modern-style definitions
In reply to Steve DicksonWith 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
--- src/svc.c | 107 +++++++++++++++++++----------------------- src/svc_auth.c | 14 +++--- src/svc_auth_unix.c | 12 ++--- src/svc_dg.c | 75 ++++++++++++++---------------- src/svc_generic.c | 32 ++++++------- src/svc_raw.c | 46 +++++++++--------- src/svc_simple.c | 19 ++++---- src/svc_vc.c | 111 +++++++++++++++++++++----------------------- 8 files changed, 197 insertions(+), 219 deletions(-)
src/svc.c +49 -58
@@ -88,8 +88,7 @@ static void __xprt_do_unregister (SVCXPRT * xprt, bool_t dolock);* Activate a transport handle. */ void -xprt_register (xprt) -SVCXPRT *xprt; +xprt_register (SVCXPRT *xprt) {int sock;
@@ -158,9 +157,9 @@ __xprt_unregister_unlocked (SVCXPRT * xprt)* De-activate a transport handle. */ static void -__xprt_do_unregister (xprt, dolock) -SVCXPRT *xprt; -bool_t dolock; +__xprt_do_unregister ( +SVCXPRT *xprt, +bool_t dolock) {int sock;
@@ -215,12 +214,12 @@ svc_open_fds()* program number comes in. */ bool_t -svc_reg (xprt, prog, vers, dispatch, nconf) -SVCXPRT *xprt; -const rpcprog_t prog; -const rpcvers_t vers; -void (*dispatch) (struct svc_req *,SVCXPRT *); -const struct netconfig *nconf; +svc_reg ( +SVCXPRT *xprt, +const rpcprog_t prog, +const rpcvers_t vers, +void (*dispatch) (struct svc_req *,SVCXPRT *), +const struct netconfig *nconf) {bool_t dummy;struct svc_callout *prev;
@@ -297,9 +296,9 @@ rpcb_it:* Remove a service program from the callout list. */ void -svc_unreg (prog, vers) -const rpcprog_t prog; -const rpcvers_t vers; +svc_unreg ( +const rpcprog_t prog, +const rpcvers_t vers) {struct svc_callout *prev;struct svc_callout *s;
@@ -334,12 +333,12 @@ svc_unreg (prog, vers)* program number comes in. */ bool_t -svc_register (xprt, prog, vers, dispatch, protocol) -SVCXPRT *xprt; -u_long prog; -u_long vers; -void (*dispatch) (struct svc_req *,SVCXPRT *); -int protocol; +svc_register ( +SVCXPRT *xprt, +u_long prog, +u_long vers, +void (*dispatch) (struct svc_req *,SVCXPRT *), +int protocol) {struct svc_callout *prev;struct svc_callout *s;
@@ -377,9 +376,9 @@ pmap_it:* Remove a service program from the callout list. */ void -svc_unregister (prog, vers) -u_long prog; -u_long vers; +svc_unregister ( +u_long prog, +u_long vers) {struct svc_callout *prev;struct svc_callout *s;
@@ -407,11 +406,11 @@ svc_unregister (prog, vers)* struct. */ static struct svc_callout * -svc_find (prog ,vers ,prev ,netid ) - rpcprog_t prog; -rpcvers_t vers; -struct svc_callout **prev; -char *netid; +svc_find ( +rpcprog_t prog, +rpcvers_t vers, +struct svc_callout **prev, +char *netid) {struct svc_callout *s, *p;
@@ -436,10 +435,10 @@ svc_find (prog, vers, prev, netid)* Send a reply to an rpc request */ bool_t -svc_sendreply (xprt, xdr_results, xdr_location) -SVCXPRT *xprt; -xdrproc_t xdr_results; -void *xdr_location; +svc_sendreply ( +SVCXPRT *xprt, +xdrproc_t xdr_results, +void *xdr_location) {struct rpc_msg rply;
@@ -458,8 +457,7 @@ svc_sendreply (xprt, xdr_results, xdr_location)* No procedure error reply */ void -svcerr_noproc (xprt) -SVCXPRT *xprt; +svcerr_noproc (SVCXPRT *xprt) {struct rpc_msg rply;
@@ -476,8 +474,7 @@ svcerr_noproc (xprt)* Can't decode args error reply */ void -svcerr_decode (xprt) -SVCXPRT *xprt; +svcerr_decode (SVCXPRT *xprt) {struct rpc_msg rply;
@@ -494,8 +491,7 @@ svcerr_decode (xprt)* Some system error */ void -svcerr_systemerr (xprt) -SVCXPRT *xprt; +svcerr_systemerr (SVCXPRT *xprt) {struct rpc_msg rply;
@@ -548,9 +544,9 @@ __svc_versquiet_get (xprt)* Authentication error reply */ void -svcerr_auth (xprt, why) -SVCXPRT *xprt; -enum auth_stat why; +svcerr_auth ( +SVCXPRT *xprt, +enum auth_stat why) {struct rpc_msg rply;
@@ -567,8 +563,7 @@ svcerr_auth (xprt, why)* Auth too weak error reply */ void -svcerr_weakauth (xprt) -SVCXPRT *xprt; +svcerr_weakauth (SVCXPRT *xprt) {assert (xprt !=NULL );
@@ -580,8 +575,7 @@ svcerr_weakauth (xprt)* Program unavailable error reply */ void -svcerr_noprog (xprt) -SVCXPRT *xprt; +svcerr_noprog (SVCXPRT *xprt) {struct rpc_msg rply;
@@ -598,10 +592,10 @@ svcerr_noprog (xprt)* Program version mismatch error reply */ void -svcerr_progvers (xprt, low_vers, high_vers) -SVCXPRT *xprt; -rpcvers_t low_vers; -rpcvers_t high_vers; +svcerr_progvers ( +SVCXPRT *xprt, +rpcvers_t low_vers, +rpcvers_t high_vers) {struct rpc_msg rply;
@@ -635,8 +629,7 @@ svcerr_progvers (xprt, low_vers, high_vers)*/ void -svc_getreq (rdfds) -int rdfds; +svc_getreq (int rdfds) {fd_set readfds;
@@ -646,8 +639,7 @@ svc_getreq (rdfds) }void -svc_getreqset (readfds) -fd_set *readfds; +svc_getreqset (fd_set *readfds) {int bit, fd;fd_mask mask, *maskp;
@@ -670,8 +662,7 @@ svc_getreqset (readfds) }void -svc_getreq_common (fd) -int fd; +svc_getreq_common (int fd) {SVCXPRT *xprt;struct svc_req r;
@@ -772,9 +763,9 @@ svc_getreq_common (fd)void -svc_getreq_poll (pfdp, pollretval) -struct pollfd *pfdp; -int pollretval; +svc_getreq_poll ( +struct pollfd *pfdp, +int pollretval) {int fds_found, i;
src/svc_auth.c +7 -7
@@ -88,10 +88,10 @@ extern enum auth_stat _svcauth_des(struct svc_req *rqst, struct rpc_msg *msg);* invalid. */ enum auth_stat -_gss_authenticate (rqst, msg, no_dispatch) -struct svc_req *rqst; -struct rpc_msg *msg; -bool_t *no_dispatch; +_gss_authenticate ( +struct svc_req *rqst, +struct rpc_msg *msg, +bool_t *no_dispatch) {int cred_flavor;struct authsvc *asp;
@@ -171,9 +171,9 @@ _authenticate(struct svc_req *rqst, struct rpc_msg *msg)*/ int -svc_auth_reg (cred_flavor, handler) -int cred_flavor; -enum auth_stat (*handler)(struct svc_req *,struct rpc_msg *); +svc_auth_reg ( +int cred_flavor, +enum auth_stat (*handler)(struct svc_req *,struct rpc_msg *)) {struct authsvc *asp;extern mutex_t authsvc_lock;
src/svc_auth_unix.c +6 -6
@@ -49,9 +49,9 @@ extern SVCAUTH svc_auth_none;* Unix longhand authenticator */ enum auth_stat -_svcauth_unix (rqst, msg) -struct svc_req *rqst; -struct rpc_msg *msg; +_svcauth_unix ( +struct svc_req *rqst, +struct rpc_msg *msg) {enum auth_stat stat;XDR xdrs;
@@ -140,9 +140,9 @@ done:*/ /*ARGSUSED*/ enum auth_stat -_svcauth_short (rqst, msg) -struct svc_req *rqst; -struct rpc_msg *msg; +_svcauth_short ( +struct svc_req *rqst, +struct rpc_msg *msg) {return (AUTH_REJECTEDCRED ); }
src/svc_dg.c +36 -39
145 lines not on this page · raw message
src/svc_generic.c +16 -16
@@ -65,11 +65,11 @@ extern int __binddynport(int fd);* created earlier instead of creating a new handle every time. */ int -svc_create (dispatch, prognum, versnum, nettype) -void (*dispatch)(struct svc_req *,SVCXPRT *); -rpcprog_t prognum;/* Program number */ -rpcvers_t versnum;/* Version number */ -const char *nettype;/* Networktype token */ +svc_create ( +void (*dispatch)(struct svc_req *,SVCXPRT *), +rpcprog_t prognum,/* Program number */ +rpcvers_t versnum,/* Version number */ +const char *nettype)/* Networktype token */ {struct xlist {SVCXPRT *xprt;/* Server handle */
@@ -138,11 +138,11 @@ svc_create(dispatch, prognum, versnum, nettype)* with the rpcbind. It calls svc_tli_create(); */ SVCXPRT * -svc_tp_create (dispatch ,prognum ,versnum ,nconf ) - void (*dispatch)(struct svc_req *, SVCXPRT *); -rpcprog_t prognum;/* Program number */ -rpcvers_t versnum;/* Version number */ -const struct netconfig *nconf;/* Netconfig structure for the network */ +svc_tp_create ( +void (*dispatch)(struct svc_req *,SVCXPRT *), +rpcprog_t prognum,/* Program number */ +rpcvers_t versnum,/* Version number */ +const struct netconfig *nconf)/* Netconfig structure for the network */ {SVCXPRT *xprt;
@@ -179,12 +179,12 @@ svc_tp_create(dispatch, prognum, versnum, nconf)* If sendsz or recvsz are zero, their default values are chosen. */ SVCXPRT * -svc_tli_create (fd ,nconf ,bindaddr ,sendsz ,recvsz ) - int fd;/* Connection end point */ -const struct netconfig *nconf;/* Netconfig struct for nettoken */ -const struct t_bind *bindaddr;/* Local bind address */ -u_int sendsz;/* Max sendsize */ -u_int recvsz;/* Max recvsize */ +svc_tli_create ( +int fd,/* Connection end point */ +const struct netconfig *nconf,/* Netconfig struct for nettoken */ +const struct t_bind *bindaddr,/* Local bind address */ +u_int sendsz,/* Max sendsize */ +u_int recvsz)/* Max recvsize */ {SVCXPRT *xprt =NULL ;/* service handle */ bool_t madefd = FALSE;/* whether fd opened here */
src/svc_raw.c +22 -24
92 lines not on this page · raw message
src/svc_simple.c +9 -10
@@ -87,13 +87,14 @@ static const char __no_mem_str[] = "out of memory";*/ int -rpc_reg (prognum, versnum, procnum, progname, inproc, outproc, nettype) -rpcprog_t prognum;/* program number */ -rpcvers_t versnum;/* version number */ -rpcproc_t procnum;/* procedure number */ -char *(*progname)(char *);/* Server routine */ -xdrproc_t inproc, outproc;/* in/out XDR procedures */ -char *nettype;/* nettype */ +rpc_reg ( +rpcprog_t prognum,/* program number */ +rpcvers_t versnum,/* version number */ +rpcproc_t procnum,/* procedure number */ +char *(*progname)(char *),/* Server routine */ +xdrproc_t inproc,/* in XDR procedures */ +xdrproc_t outproc,/* out XDR procedures */ +char *nettype)/* nettype */ {struct netconfig *nconf;int done = FALSE;
@@ -231,9 +232,7 @@ rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype)*/ static void -universal (rqstp, transp) -struct svc_req *rqstp; -SVCXPRT *transp; +universal (struct svc_req *rqstp,SVCXPRT *transp) {rpcprog_t prog;rpcvers_t vers;
src/svc_vc.c +52 -59
222 lines not on this page · raw message
Signature · 1 line
2.50.1
PATCH 3/12 Convert old-style function definitions into modern-style definitions
In reply to Steve DicksonWith 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
--- src/rpcb_clnt.c | 154 ++++++++++++++++++++++------------------------ src/rpcb_prot.c | 48 +++++++-------- src/rpcb_st_xdr.c | 42 ++++++------- 3 files changed, 119 insertions(+), 125 deletions(-)
src/rpcb_clnt.c +74 -80
@@ -99,8 +99,7 @@ static struct netbuf *got_entry(rpcb_entry_list_ptr, const struct netconfig *);* */ static void -destroy_addr (addr) -struct address_cache *addr; +destroy_addr (struct address_cache *addr) {if (addr ==NULL )return ;
@@ -133,8 +132,7 @@ destroy_addr(addr)* or the new entry cannot be allocated then NULL is returned. */ static struct address_cache * -copy_addr (addr ) - const struct address_cache *addr; +copy_addr (const struct address_cache *addr) {struct address_cache *copy;
@@ -188,9 +186,7 @@ err:* These are private routines that may not be provided in future releases. */ bool_t -__rpc_control (request, info) -int request; -void *info; +__rpc_control (int request,void *info) {switch (request) {case CLCR_GET_RPCB_TIMEOUT :
@@ -231,9 +227,9 @@ extern pthread_mutex_t rpcbaddr_cache_lock;*/ static struct address_cache * -copy_of_cached (host ,netid ) - const char *host; -char *netid; +copy_of_cached ( +const char *host, +char *netid) {struct address_cache *cptr, *copy =NULL ;
@@ -252,8 +248,7 @@ copy_of_cached(host, netid) }static void -delete_cache (addr) -struct netbuf *addr; +delete_cache (struct netbuf *addr) {struct address_cache *cptr =NULL , *prevptr =NULL ;
@@ -283,10 +278,11 @@ delete_cache(addr) }static void -add_cache (host, netid, taddr, uaddr) -const char *host, *netid; -char *uaddr; -struct netbuf *taddr; +add_cache ( +const char *host, +const char *netid, +struct netbuf *taddr, +char *uaddr) {struct address_cache *ad_cache, *cptr, *prevptr;
@@ -364,10 +360,10 @@ out_free:* On error, returns NULL and free's everything. */ static CLIENT * -getclnthandle (host ,nconf ,targaddr ) - const char *host; -const struct netconfig *nconf; -char **targaddr; +getclnthandle ( +const char *host, +const struct netconfig *nconf, +char **targaddr) {CLIENT *client;struct netbuf taddr;
@@ -497,10 +493,10 @@ out_err:* Create a PMAP client handle. */ static CLIENT * -getpmaphandle (nconf ,hostname ,tgtaddr ) - const struct netconfig *nconf; -const char *hostname; -char **tgtaddr; +getpmaphandle ( +const struct netconfig *nconf, +const char *hostname, +char **tgtaddr) {CLIENT *client =NULL ;rpcvers_t pmapvers =2 ;
@@ -537,8 +533,7 @@ getpmaphandle(nconf, hostname, tgtaddr)* rpcbind. Returns NULL on error and free's everything. */ static CLIENT * -local_rpcb (targaddr ) - char **targaddr; +local_rpcb (char **targaddr) {CLIENT *client;static struct netconfig *loopnconf;
@@ -654,11 +649,11 @@ try_nconf:* Calls the rpcbind service to do the mapping. */ bool_t -rpcb_set (program, version, nconf, address) -rpcprog_t program; -rpcvers_t version; -const struct netconfig *nconf;/* Network structure of transport */ -const struct netbuf *address;/* Services netconfig address */ +rpcb_set ( +rpcprog_t program, +rpcvers_t version, +const struct netconfig *nconf,/* Network structure of transport */ +const struct netbuf *address)/* Services netconfig address */ {CLIENT *client;bool_t rslt = FALSE;
@@ -715,10 +710,10 @@ rpcb_set(program, version, nconf, address)* only for the given transport. */ bool_t -rpcb_unset (program, version, nconf) -rpcprog_t program; -rpcvers_t version; -const struct netconfig *nconf; +rpcb_unset ( +rpcprog_t program, +rpcvers_t version, +const struct netconfig *nconf) {CLIENT *client;bool_t rslt = FALSE;
@@ -756,9 +751,9 @@ rpcb_unset(program, version, nconf)* From the merged list, find the appropriate entry */ static struct netbuf * -got_entry (relp ,nconf ) - rpcb_entry_list_ptr relp; -const struct netconfig *nconf; +got_entry ( +rpcb_entry_list_ptr relp, +const struct netconfig *nconf) {struct netbuf *na =NULL ;rpcb_entry_list_ptr sp;
@@ -829,12 +824,12 @@ __rpcbind_is_up()#ifdef PORTMAP static struct netbuf * -__try_protocol_version_2 (program ,version ,nconf ,host ,tp ) - rpcprog_t program; -rpcvers_t version; -const struct netconfig *nconf; -const char *host; -struct timeval *tp; +__try_protocol_version_2 ( +rpcprog_t program, +rpcvers_t version, +const struct netconfig *nconf, +const char *host, +struct timeval *tp) {u_short port =0 ;struct netbuf remote;
@@ -934,13 +929,13 @@ error:* starts working properly. Also look under clnt_vc.c. */ struct netbuf * -__rpcb_findaddr_timed (program ,version ,nconf ,host ,clpp ,tp ) - rpcprog_t program; -rpcvers_t version; -const struct netconfig *nconf; -const char *host; -CLIENT **clpp; -struct timeval *tp; +__rpcb_findaddr_timed ( +rpcprog_t program, +rpcvers_t version, +const struct netconfig *nconf, +const char *host, +CLIENT **clpp, +struct timeval *tp) {#ifdef NOTUSED static bool_t check_rpcbind = TRUE;
@@ -1116,12 +1111,12 @@ done:* Assuming that the address is all properly allocated */ int -rpcb_getaddr (program, version, nconf, address, host) -rpcprog_t program; -rpcvers_t version; -const struct netconfig *nconf; -struct netbuf *address; -const char *host; +rpcb_getaddr ( +rpcprog_t program, +rpcvers_t version, +const struct netconfig *nconf, +struct netbuf *address, +const char *host) {struct netbuf *na;
@@ -1152,9 +1147,9 @@ rpcb_getaddr(program, version, nconf, address, host)* It returns NULL on failure. */ rpcblist * -rpcb_getmaps (nconf ,host ) - const struct netconfig *nconf; -const char *host; +rpcb_getmaps ( +const struct netconfig *nconf, +const char *host) {rpcblist_ptr head =NULL ;CLIENT *client;
@@ -1204,17 +1199,18 @@ done:* programs to do a lookup and call in one step. */ enum clnt_stat -rpcb_rmtcall (nconf, host, prog, vers, proc, xdrargs, argsp, - xdrres, resp, tout, addr_ptr) -const struct netconfig *nconf;/* Netconfig structure */ -const char *host;/* Remote host name */ -rpcprog_t prog; -rpcvers_t vers; -rpcproc_t proc;/* Remote proc identifiers */ -xdrproc_t xdrargs, xdrres;/* XDR routines */ -caddr_t argsp, resp;/* Argument and Result */ -struct timeval tout;/* Timeout value for this call */ -const struct netbuf *addr_ptr;/* Preallocated netbuf address */ +rpcb_rmtcall ( +const struct netconfig *nconf,/* Netconfig structure */ +const char *host,/* Remote host name */ +rpcprog_t prog, +rpcvers_t vers, +rpcproc_t proc,/* Remote proc identifiers */ +xdrproc_t xdrargs,/* In XDR routines */ +caddr_t argsp,/* In Argument */ +xdrproc_t xdrres,/* Out XDR routines */ +caddr_t resp,/* out Result */ +struct timeval tout,/* Timeout value for this call */ +const struct netbuf *addr_ptr)/* Preallocated netbuf address */ {CLIENT *client;enum clnt_stat stat;
@@ -1285,9 +1281,7 @@ error:* Returns 1 if succeeds else 0. */ bool_t -rpcb_gettime (host, timep) -const char *host; -time_t *timep; +rpcb_gettime (const char *host,time_t *timep) {CLIENT *client =NULL ;void *handle;
@@ -1345,9 +1339,9 @@ rpcb_gettime(host, timep)* really be called because local n2a libraries are always provided. */ char * -rpcb_taddr2uaddr (nconf ,taddr ) - struct netconfig *nconf; -struct netbuf *taddr; +rpcb_taddr2uaddr ( +struct netconfig *nconf, +struct netbuf *taddr) {CLIENT *client;char *uaddr =NULL ;
@@ -1379,9 +1373,9 @@ rpcb_taddr2uaddr(nconf, taddr)* really be called because local n2a libraries are always provided. */ struct netbuf * -rpcb_uaddr2taddr (nconf ,uaddr ) - struct netconfig *nconf; -char *uaddr; +rpcb_uaddr2taddr ( +struct netconfig *nconf, +char *uaddr) {CLIENT *client;struct netbuf *taddr;
src/rpcb_prot.c +24 -24
96 lines not on this page · raw message
src/rpcb_st_xdr.c +21 -21
84 lines not on this page · raw message
Signature · 1 line
2.50.1
PATCH 4/12 Convert old-style function definitions into modern-style definitions
In reply to Steve DicksonWith 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
--- src/rpcdname.c | 3 +-- src/rtime.c | 11 +++++------ 2 files changed, 6 insertions(+), 8 deletions(-)
src/rpcdname.c +1 -2
@@ -63,8 +63,7 @@ get_default_domain()* get rejected elsewhere in the NIS client package. */ int -__rpc_get_default_domain (domain) -char **domain; +__rpc_get_default_domain (char **domain) {if ((*domain =get_default_domain ()) !=0 )return (0 );
src/rtime.c +5 -6
@@ -62,10 +62,10 @@ extern int _rpc_dtablesize( void );static void do_close (int );int -rtime (addrp, timep, timeout) -struct sockaddr_in *addrp; -struct timeval *timep; -struct timeval *timeout; +rtime ( +struct sockaddr_in *addrp, +struct timeval *timep, +struct timeval *timeout) {int s;struct pollfd fd;
@@ -146,8 +146,7 @@ rtime(addrp, timep, timeout) }static void -do_close (s) -int s; +do_close (int s) {int save;
Signature · 1 line
2.50.1
PATCH 5/12 Convert old-style function definitions into modern-style definitions
In reply to Steve DicksonWith 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
--- src/rpc_callmsg.c | 4 +- src/rpc_generic.c | 31 ++--- src/rpc_prot.c | 36 ++---- src/rpc_soc.c | 310 +++++++++++++++++++++++----------------------- 4 files changed, 180 insertions(+), 201 deletions(-)
src/rpc_callmsg.c +1 -3
@@ -46,9 +46,7 @@* XDR a call message */ bool_t -xdr_callmsg (xdrs, cmsg) -XDR *xdrs; -struct rpc_msg *cmsg; +xdr_callmsg (XDR *xdrs,struct rpc_msg *cmsg) {int32_t *buf;struct opaque_auth *oa;
src/rpc_generic.c +12 -19
@@ -127,9 +127,10 @@ __rpc_dtbsize()*/ u_int /*ARGSUSED*/ -__rpc_get_t_size (af, proto, size) -int af, proto; -int size;/* Size requested */ +__rpc_get_t_size ( +int af, +int proto, +int size)/* Size requested */ {int maxsize, defsize;
@@ -156,8 +157,7 @@ __rpc_get_t_size(af, proto, size)* Find the appropriate address buffer size */ u_int -__rpc_get_a_size (af) -int af; +__rpc_get_a_size (int af) {switch (af) {case AF_INET :
@@ -193,8 +193,7 @@ strlocase(p)* If nettype is NULL, it defaults to NETPATH. */ static int -getnettype (nettype) -const char *nettype; +getnettype (const char *nettype) {int i;
@@ -218,8 +217,7 @@ getnettype(nettype)* This should be freed by calling freenetconfigent() */ struct netconfig * -__rpc_getconfip (nettype ) - const char *nettype; +__rpc_getconfip (const char *nettype) {char *netid;char *netid_tcp = (char *)NULL ;
@@ -287,8 +285,7 @@ __rpc_getconfip(nettype)* __rpc_getconf(). */ void * -__rpc_setconf (nettype ) - const char *nettype; +__rpc_setconf (const char *nettype) {struct handle *handle;
@@ -331,8 +328,7 @@ __rpc_setconf(nettype)* __rpc_setconf() should have been called previously. */ struct netconfig * -__rpc_getconf (vhandle ) - void *vhandle; +__rpc_getconf (void *vhandle) {struct handle *handle;struct netconfig *nconf;
@@ -408,8 +404,7 @@ __rpc_getconf(vhandle) }void -__rpc_endconf (vhandle) -void * vhandle; +__rpc_endconf (void * vhandle) {struct handle *handle;
@@ -430,8 +425,7 @@ __rpc_endconf(vhandle)* Returns NULL if fails, else a non-NULL pointer. */ void * -rpc_nullproc (clnt ) - CLIENT *clnt; +rpc_nullproc (CLIENT *clnt) {struct timeval TIMEOUT = {25 ,0 };
@@ -447,8 +441,7 @@ rpc_nullproc(clnt)* one succeeds in finding the netconf for the given fd. */ struct netconfig * -__rpcgettp (fd ) - int fd; +__rpcgettp (int fd) {const char *netid;struct __rpc_sockinfo si;
src/rpc_prot.c +9 -27
@@ -57,9 +57,7 @@ extern struct opaque_auth _null_auth;* (see auth.h) */ bool_t -xdr_opaque_auth (xdrs, ap) -XDR *xdrs; -struct opaque_auth *ap; +xdr_opaque_auth (XDR *xdrs,struct opaque_auth *ap) {assert (xdrs !=NULL );
@@ -75,9 +73,7 @@ xdr_opaque_auth(xdrs, ap)* XDR a DES block */ bool_t -xdr_des_block (xdrs, blkp) -XDR *xdrs; -des_block *blkp; +xdr_des_block (XDR *xdrs,des_block *blkp) {assert (xdrs !=NULL );
@@ -92,9 +88,7 @@ xdr_des_block(xdrs, blkp)* XDR the MSG_ACCEPTED part of a reply message union */ bool_t -xdr_accepted_reply (xdrs, ar) -XDR *xdrs; -struct accepted_reply *ar; +xdr_accepted_reply (XDR *xdrs,struct accepted_reply *ar) {assert (xdrs !=NULL );
@@ -128,9 +122,7 @@ xdr_accepted_reply(xdrs, ar)* XDR the MSG_DENIED part of a reply message union */ bool_t -xdr_rejected_reply (xdrs, rr) -XDR *xdrs; -struct rejected_reply *rr; +xdr_rejected_reply (XDR *xdrs,struct rejected_reply *rr) {assert (xdrs !=NULL );
@@ -162,9 +154,7 @@ static const struct xdr_discrim reply_dscrm[3] = {* XDR a reply message */ bool_t -xdr_replymsg (xdrs, rmsg) -XDR *xdrs; -struct rpc_msg *rmsg; +xdr_replymsg (XDR *xdrs,struct rpc_msg *rmsg) {assert (xdrs !=NULL );assert (rmsg !=NULL );
@@ -186,9 +176,7 @@ xdr_replymsg(xdrs, rmsg)* The rm_xid is not really static, but the user can easily munge on the fly. */ bool_t -xdr_callhdr (xdrs, cmsg) -XDR *xdrs; -struct rpc_msg *cmsg; +xdr_callhdr (XDR *xdrs,struct rpc_msg *cmsg) {assert (xdrs !=NULL );
@@ -209,9 +197,7 @@ xdr_callhdr(xdrs, cmsg)/* ************************** Client utility routine ************* */ static void -accepted (acpt_stat, error) -enum accept_stat acpt_stat; -struct rpc_err *error; +accepted (enum accept_stat acpt_stat,struct rpc_err *error) {assert (error !=NULL );
@@ -250,9 +236,7 @@ accepted(acpt_stat, error) }static void -rejected (rjct_stat, error) -enum reject_stat rjct_stat; -struct rpc_err *error; +rejected (enum reject_stat rjct_stat,struct rpc_err *error) {assert (error !=NULL );
@@ -277,9 +261,7 @@ rejected(rjct_stat, error)* given a reply message, fills in the error */ void -_seterr_reply (msg, error) -struct rpc_msg *msg; -struct rpc_err *error; +_seterr_reply (struct rpc_msg *msg,struct rpc_err *error) {assert (msg !=NULL );
src/rpc_soc.c +158 -152
479 lines not on this page · raw message
Signature · 1 line
2.50.1
PATCH 6/12 Convert old-style function definitions into modern-style definitions
In reply to Steve DicksonWith 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
--- 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(-)
src/pmap_getmaps.c +1 -2
@@ -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 ;
src/pmap_getport.c +5 -5
@@ -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 ;
src/pmap_prot.c +1 -3
@@ -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 );
src/pmap_prot2.c +2 -6
@@ -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); }
src/pmap_rmt.c +17 -14
@@ -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;
Signature · 1 line
2.50.1
PATCH 7/12 Convert old-style function definitions into modern-style definitions
In reply to Steve DicksonWith 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
--- src/netname.c | 19 +++++++++---------- src/netnamer.c | 31 ++++++++++++++++--------------- 2 files changed, 25 insertions(+), 25 deletions(-)
src/netname.c +9 -10
@@ -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 ];
src/netnamer.c +16 -15
@@ -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;
Signature · 1 line
2.50.1
PATCH 8/12 Convert old-style function definitions into modern-style definitions
In reply to Steve DicksonWith 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
--- src/key_call.c | 58 +++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 31 deletions(-)
src/key_call.c +27 -31
@@ -79,8 +79,7 @@ des_block *(*__key_gendes_LOCAL)(uid_t, char *) = 0;static int key_call (u_long ,xdrproc_t ,void *,xdrproc_t ,void *);int -key_setsecret (secretkey) -const char *secretkey; +key_setsecret (const char *secretkey) {keystatus status;
@@ -122,10 +121,10 @@ key_secretkey_is_set(void) }int -key_encryptsession_pk (remotename, remotekey, deskey) -char *remotename; -netobj *remotekey; -des_block *deskey; +key_encryptsession_pk ( +char *remotename, +netobj *remotekey, +des_block *deskey) {cryptkeyarg2 arg;cryptkeyres res;
@@ -146,10 +145,10 @@ key_encryptsession_pk(remotename, remotekey, deskey) }int -key_decryptsession_pk (remotename, remotekey, deskey) -char *remotename; -netobj *remotekey; -des_block *deskey; +key_decryptsession_pk ( +char *remotename, +netobj *remotekey, +des_block *deskey) {cryptkeyarg2 arg;cryptkeyres res;
@@ -170,9 +169,9 @@ key_decryptsession_pk(remotename, remotekey, deskey) }int -key_encryptsession (remotename, deskey) -const char *remotename; -des_block *deskey; +key_encryptsession ( +const char *remotename, +des_block *deskey) {cryptkeyarg arg;cryptkeyres res;
@@ -192,9 +191,9 @@ key_encryptsession(remotename, deskey) }int -key_decryptsession (remotename, deskey) -const char *remotename; -des_block *deskey; +key_decryptsession ( +const char *remotename, +des_block *deskey) {cryptkeyarg arg;cryptkeyres res;
@@ -214,8 +213,7 @@ key_decryptsession(remotename, deskey) }int -key_gendes (key) -des_block *key; +key_gendes (des_block *key) {if (!key_call ((u_long )KEY_GEN , (xdrproc_t )xdr_void,NULL , (xdrproc_t )xdr_des_block, key)) {
@@ -225,8 +223,7 @@ key_gendes(key) }int -key_setnet (arg) -struct key_netstarg *arg; +key_setnet (struct key_netstarg *arg) {keystatus status;
@@ -245,9 +242,9 @@ struct key_netstarg *arg;int -key_get_conv (pkey, deskey) -char *pkey; -des_block *deskey; +key_get_conv ( +char *pkey, +des_block *deskey) {cryptkeyres res;
@@ -286,8 +283,7 @@ key_call_destroy(void *vp)* Keep the handle cached. This call may be made quite often. */ static CLIENT * -getkeyserv_handle (vers ) -int vers; +getkeyserv_handle (int vers) {void *localhandle;struct netconfig *nconf;
@@ -396,12 +392,12 @@ int vers;/* returns 0 on failure, 1 on success */ static int -key_call (proc, xdr_arg, arg, xdr_rslt, rslt) -u_long proc; -xdrproc_t xdr_arg; -void *arg; -xdrproc_t xdr_rslt; -void *rslt; +key_call ( +u_long proc, +xdrproc_t xdr_arg, +void *arg, +xdrproc_t xdr_rslt, +void *rslt) {CLIENT *clnt;struct timeval wait_time;
Signature · 1 line
2.50.1
PATCH 9/12 Convert old-style function definitions into modern-style definitions
In reply to Steve DicksonWith 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
--- src/getnetconfig.c | 24 +++++++++--------------- src/getnetpath.c | 12 +++++------- src/getpublickey.c | 20 ++++++++++---------- src/getrpcport.c | 8 +++++--- 4 files changed, 29 insertions(+), 35 deletions(-)
src/getnetconfig.c +9 -15
@@ -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;
src/getnetpath.c +5 -7
@@ -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 */
src/getpublickey.c +10 -10
@@ -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));
src/getrpcport.c +5 -3
@@ -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;
Signature · 1 line
2.50.1
PATCH 10/12 Convert old-style function definitions into modern-style definitions
In reply to Steve DicksonWith 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
--- src/clnt_bcast.c | 46 ++++++++++++++--------------- src/clnt_dg.c | 59 +++++++++++++++++-------------------- src/clnt_perror.c | 23 +++++---------- src/clnt_raw.c | 46 +++++++++++++---------------- src/clnt_simple.c | 19 ++++++------ src/clnt_vc.c | 75 ++++++++++++++++++++++------------------------- 6 files changed, 121 insertions(+), 147 deletions(-)
src/clnt_bcast.c +22 -24
@@ -257,19 +257,18 @@ __ipv6v4_fixup(struct sockaddr_storage *ss, const char *uaddr) }enum clnt_stat -rpc_broadcast_exp (prog, vers, proc, xargs, argsp, xresults, resultsp, - eachresult, inittime, waittime, nettype) -rpcprog_t prog;/* program number */ -rpcvers_t vers;/* version number */ -rpcproc_t proc;/* procedure number */ -xdrproc_t xargs;/* xdr routine for args */ -caddr_t argsp;/* pointer to args */ -xdrproc_t xresults;/* xdr routine for results */ -caddr_t resultsp;/* pointer to results */ -resultproc_t eachresult;/* call with each result obtained */ -int inittime;/* how long to wait initially */ -int waittime;/* maximum time to wait */ -const char *nettype;/* transport type */ +rpc_broadcast_exp ( +rpcprog_t prog,/* program number */ +rpcvers_t vers,/* version number */ +rpcproc_t proc,/* procedure number */ +xdrproc_t xargs,/* xdr routine for args */ +caddr_t argsp,/* pointer to args */ +xdrproc_t xresults,/* xdr routine for results */ +caddr_t resultsp,/* pointer to results */ +resultproc_t eachresult,/* call with each result obtained */ +int inittime,/* how long to wait initially */ +int waittime,/* maximum time to wait */ +const char *nettype)/* transport type */ {enum clnt_stat stat =RPC_SUCCESS ;/* Return status */ XDR xdr_stream;/* XDR stream */
@@ -677,17 +676,16 @@ done_broad:enum clnt_stat -rpc_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, - eachresult, nettype) -rpcprog_t prog;/* program number */ -rpcvers_t vers;/* version number */ -rpcproc_t proc;/* procedure number */ -xdrproc_t xargs;/* xdr routine for args */ -caddr_t argsp;/* pointer to args */ -xdrproc_t xresults;/* xdr routine for results */ -caddr_t resultsp;/* pointer to results */ -resultproc_t eachresult;/* call with each result obtained */ -const char *nettype;/* transport type */ +rpc_broadcast ( +rpcprog_t prog,/* program number */ +rpcvers_t vers,/* version number */ +rpcproc_t proc,/* procedure number */ +xdrproc_t xargs,/* xdr routine for args */ +caddr_t argsp,/* pointer to args */ +xdrproc_t xresults,/* xdr routine for results */ +caddr_t resultsp,/* pointer to results */ +resultproc_t eachresult,/* call with each result obtained */ +const char *nettype)/* transport type */ {enum clnt_stat dummy;
src/clnt_dg.c +27 -32
105 lines not on this page · raw message
src/clnt_perror.c +7 -16
@@ -60,9 +60,7 @@ _buf()* Print reply error info */ char * -clnt_sperror (rpch ,s ) - CLIENT *rpch; -const char *s; +clnt_sperror (CLIENT *rpch,const char *s) {struct rpc_err e;char *err;
@@ -174,9 +172,7 @@ clnt_sperror(rpch, s) }void -clnt_perror (rpch, s) -CLIENT *rpch; -const char *s; +clnt_perror (CLIENT *rpch,const char *s) {if (rpch ==NULL || s ==NULL )
@@ -211,8 +207,7 @@ static const char *const rpc_errlist[] = {* This interface for use by clntrpc */ char * -clnt_sperrno (stat ) - enum clnt_stat stat; +clnt_sperrno (enum clnt_stat stat) {unsigned int errnum = stat;
@@ -224,16 +219,14 @@ clnt_sperrno(stat) }void -clnt_perrno (num) -enum clnt_stat num; +clnt_perrno (enum clnt_stat num) { (void )fprintf (stderr,"%s\n" ,clnt_sperrno (num)); }char * -clnt_spcreateerror (s ) - const char *s; +clnt_spcreateerror (const char *s) {char *str, *err;size_t len, i;
@@ -300,8 +293,7 @@ clnt_spcreateerror(s) }void -clnt_pcreateerror (s) -const char *s; +clnt_pcreateerror (const char *s) {if (s ==NULL )
@@ -322,8 +314,7 @@ static const char *const auth_errlist[] = { };static char * -auth_errmsg (stat ) - enum auth_stat stat; +auth_errmsg (enum auth_stat stat) {unsigned int errnum = stat;
src/clnt_raw.c +20 -26
87 lines not on this page · raw message
src/clnt_simple.c +10 -9
@@ -87,15 +87,16 @@ rpc_call_destroy(void *vp)* The total time available is 25 seconds. */ enum clnt_stat -rpc_call (host, prognum, versnum, procnum, inproc, in, outproc, out, nettype) -const char *host;/* host name */ -rpcprog_t prognum;/* program number */ -rpcvers_t versnum;/* version number */ -rpcproc_t procnum;/* procedure number */ -xdrproc_t inproc, outproc;/* in/out XDR procedures */ -const char *in; -char *out;/* recv/send data */ -const char *nettype;/* nettype */ +rpc_call ( +const char *host,/* host name */ +rpcprog_t prognum,/* program number */ +rpcvers_t versnum,/* version number */ +rpcproc_t procnum,/* procedure number */ +xdrproc_t inproc,/* recv data */ +const char *in,/* recv XDR data */ +xdrproc_t outproc,/* out XDR procedures */ +char *out,/* send data */ +const char *nettype)/* nettype */ {struct rpc_call_private *rcp = (struct rpc_call_private *)0 ;enum clnt_stat clnt_stat;
src/clnt_vc.c +35 -40
133 lines not on this page · raw message
Signature · 1 line
2.50.1
PATCH 11/12 Convert old-style function definitions into modern-style definitions
In reply to Steve DicksonWith 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
--- src/bindresvport.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
src/bindresvport.c +1 -3
@@ -147,9 +147,7 @@ load_blacklist (void) }int -bindresvport_sa (sd, sa) -int sd; -struct sockaddr *sa; +bindresvport_sa (int sd,struct sockaddr *sa) {int res, af;struct sockaddr_storage myaddr;
Signature · 1 line
2.50.1
PATCH 12/12 Convert old-style function definitions into modern-style definitions
In reply to Steve DicksonWith 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
--- src/auth_time.c | 42 +++++++++++++++++++----------------------- src/auth_unix.c | 29 +++++++++++------------------ src/authunix_prot.c | 4 +--- 3 files changed, 31 insertions(+), 44 deletions(-)
src/auth_time.c +19 -23
@@ -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 */
src/auth_unix.c +11 -18
@@ -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;
src/authunix_prot.c +1 -3
@@ -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 );
Signature · 1 line
2.50.1