Skip to content

Commit 78add20

Browse files
committed
Use proper typed function declarations
C23 changes the meaning for an empty parameter declaration to mean that there are no parameters. Make sure we can still work with such compilers.
1 parent be1ffd2 commit 78add20

34 files changed

+338
-319
lines changed

librpc/auth_non.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ static char sccsid[] = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro";
6161
/*
6262
* Authenticator operations routines
6363
*/
64-
static void authnone_verf();
65-
static void authnone_destroy();
66-
static bool_t authnone_marshal();
67-
static bool_t authnone_validate();
68-
static bool_t authnone_refresh();
64+
static void authnone_verf(AUTH *);
65+
static void authnone_destroy(AUTH *);
66+
static bool_t authnone_marshal(AUTH *, XDR *);
67+
static bool_t authnone_validate(AUTH *, struct opaque_auth *);
68+
static bool_t authnone_refresh(AUTH *);
6969

7070
static struct auth_ops ops = {
7171
authnone_verf,
@@ -123,25 +123,30 @@ authnone_marshal(client, xdrs)
123123
}
124124

125125
static void
126-
authnone_verf()
126+
authnone_verf(client)
127+
AUTH *client;
127128
{
128129
}
129130

130131
static bool_t
131-
authnone_validate()
132+
authnone_validate(client, verf)
133+
AUTH *client;
134+
struct opaque_auth *verf;
132135
{
133136

134137
return (TRUE);
135138
}
136139

137140
static bool_t
138-
authnone_refresh()
141+
authnone_refresh(client)
142+
AUTH *client;
139143
{
140144

141145
return (FALSE);
142146
}
143147

144148
static void
145-
authnone_destroy()
149+
authnone_destroy(client)
150+
AUTH *client;
146151
{
147152
}

librpc/auth_uni.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ static char sccsid[] = "@(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro";
7171
/*
7272
* Unix authenticator operations vector
7373
*/
74-
static void authunix_nextverf();
75-
static bool_t authunix_marshal();
76-
static bool_t authunix_validate();
77-
static bool_t authunix_refresh();
78-
static void authunix_destroy();
74+
static void authunix_nextverf(AUTH *);
75+
static bool_t authunix_marshal(AUTH *, XDR *);
76+
static bool_t authunix_validate(AUTH *, struct opaque_auth *);
77+
static bool_t authunix_refresh(AUTH *);
78+
static void authunix_destroy(AUTH *);
7979

8080
static struct auth_ops auth_unix_ops = {
8181
authunix_nextverf,
@@ -97,7 +97,7 @@ struct audata {
9797
};
9898
#define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private)
9999

100-
static bool_t marshal_new_auth();
100+
static bool_t marshal_new_auth(AUTH *);
101101

102102

103103
/*

librpc/clnt_gen.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ static char sccsid[] = "@(#)clnt_generic.c 1.4 87/08/11 (C) 1987 SMI";
6262
CLIENT *
6363
clnt_create(hostname, prog, vers, proto)
6464
char *hostname;
65-
unsigned prog;
66-
unsigned vers;
65+
u_long prog;
66+
u_long vers;
6767
char *proto;
6868
{
6969
struct hostent *h;

librpc/clnt_per.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,7 @@ static char sccsid[] = "@(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro";
5757
#include <rpc/auth.h>
5858
#include <rpc/clnt.h>
5959

60-
#ifndef WIN32
61-
extern char *sys_errlist[];
62-
extern char *sprintf();
63-
#endif
64-
static char *auth_errmsg();
65-
66-
extern char *strcpy();
60+
static char *auth_errmsg(enum auth_stat);
6761

6862
static char *buf;
6963

@@ -85,7 +79,7 @@ clnt_sperror(rpch, s)
8579
char *s;
8680
{
8781
struct rpc_err e;
88-
void clnt_perrno();
82+
void clnt_perrno(enum clnt_stat);
8983
char *err;
9084
char *str = _buf();
9185
char *strstart = str;

librpc/clnt_raw.c

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ static struct clntraw_private {
7171
u_int mcnt;
7272
} *clntraw_private;
7373

74-
static enum clnt_stat clntraw_call();
75-
static void clntraw_abort();
76-
static void clntraw_geterr();
77-
static bool_t clntraw_freeres();
78-
static bool_t clntraw_control();
79-
static void clntraw_destroy();
74+
static enum clnt_stat clntraw_call(CLIENT *, u_long, xdrproc_t, caddr_t, xdrproc_t, caddr_t, struct timeval);
75+
static void clntraw_abort(CLIENT *);
76+
static void clntraw_geterr(CLIENT *, struct rpc_err *);
77+
static bool_t clntraw_freeres(CLIENT *, xdrproc_t, caddr_t);
78+
static bool_t clntraw_control(CLIENT *, int, caddr_t);
79+
static void clntraw_destroy(CLIENT *);
8080

8181
static struct clnt_ops client_ops = {
8282
clntraw_call,
@@ -87,8 +87,6 @@ static struct clnt_ops client_ops = {
8787
clntraw_control
8888
};
8989

90-
void svc_getreq();
91-
9290
/*
9391
* Create a client handle for memory based rpc.
9492
*/
@@ -211,7 +209,9 @@ clntraw_call(h, proc, xargs, argsp, xresults, resultsp, timeout)
211209
}
212210

213211
static void
214-
clntraw_geterr()
212+
clntraw_geterr(cl, error)
213+
CLIENT *cl;
214+
struct rpc_err *error;
215215
{
216216
}
217217

@@ -236,17 +236,22 @@ clntraw_freeres(cl, xdr_res, res_ptr)
236236
}
237237

238238
static void
239-
clntraw_abort()
239+
clntraw_abort(cl)
240+
CLIENT *cl;
240241
{
241242
}
242243

243244
static bool_t
244-
clntraw_control()
245+
clntraw_control(cl, request, info)
246+
CLIENT *cl;
247+
int request;
248+
char *info;
245249
{
246250
return (FALSE);
247251
}
248252

249253
static void
250-
clntraw_destroy()
254+
clntraw_destroy(cl)
255+
CLIENT *cl;
251256
{
252257
}

librpc/clnt_tcp.c

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";
8484
extern int errno;
8585
#endif
8686

87-
static int readtcp();
88-
static int writetcp();
87+
static int readtcp(caddr_t, caddr_t, int);
88+
static int writetcp(caddr_t, caddr_t, int);
8989

90-
static enum clnt_stat clnttcp_call();
91-
static void clnttcp_abort();
92-
static void clnttcp_geterr();
93-
static bool_t clnttcp_freeres();
94-
static bool_t clnttcp_control();
95-
static void clnttcp_destroy();
90+
static enum clnt_stat clnttcp_call(CLIENT *, u_long, xdrproc_t, caddr_t, xdrproc_t, caddr_t, struct timeval);
91+
static void clnttcp_abort(CLIENT *);
92+
static void clnttcp_geterr(CLIENT *, struct rpc_err *);
93+
static bool_t clnttcp_freeres(CLIENT *, xdrproc_t, caddr_t);
94+
static bool_t clnttcp_control(CLIENT *, int, caddr_t);
95+
static void clnttcp_destroy(CLIENT *);
9696

9797
static struct clnt_ops tcp_ops = {
9898
clnttcp_call,
@@ -399,7 +399,8 @@ clnttcp_freeres(cl, xdr_res, res_ptr)
399399
}
400400

401401
static void
402-
clnttcp_abort()
402+
clnttcp_abort(cl)
403+
CLIENT *cl;
403404
{
404405
}
405406

@@ -454,11 +455,12 @@ clnttcp_destroy(h)
454455
* around for the rpc level.
455456
*/
456457
static int
457-
readtcp(ct, buf, len)
458-
register struct ct_data *ct;
458+
readtcp(ctp, buf, len)
459+
caddr_t ctp;
459460
caddr_t buf;
460461
register int len;
461462
{
463+
register struct ct_data *ct = (struct ct_data *)ctp;
462464
#ifdef FD_SETSIZE
463465
fd_set mask;
464466
fd_set readfds;
@@ -543,12 +545,13 @@ readtcp(ct, buf, len)
543545
}
544546

545547
static int
546-
writetcp(ct, buf, len)
547-
struct ct_data *ct;
548+
writetcp(ctp, buf, len)
549+
caddr_t ctp;
548550
caddr_t buf;
549551
int len;
550552
{
551553
register int i, cnt;
554+
struct ct_data *ct = (struct ct_data *) ctp;
552555

553556
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
554557
#ifdef WIN32

librpc/clnt_udp.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ extern int errno;
7171
/*
7272
* UDP bases client side rpc operations
7373
*/
74-
static enum clnt_stat clntudp_call();
75-
static void clntudp_abort();
76-
static void clntudp_geterr();
77-
static bool_t clntudp_freeres();
78-
static bool_t clntudp_control();
79-
static void clntudp_destroy();
74+
static enum clnt_stat clntudp_call(CLIENT *, u_long, xdrproc_t, caddr_t, xdrproc_t, caddr_t, struct timeval);
75+
static void clntudp_abort(CLIENT *);
76+
static void clntudp_geterr(CLIENT *, struct rpc_err *);
77+
static bool_t clntudp_freeres(CLIENT *, xdrproc_t, caddr_t);
78+
static bool_t clntudp_control(CLIENT *, int, caddr_t);
79+
static void clntudp_destroy(CLIENT *);
8080

8181
static struct clnt_ops udp_ops = {
8282
clntudp_call,
@@ -459,8 +459,8 @@ clntudp_freeres(cl, xdr_res, res_ptr)
459459
}
460460

461461
static void
462-
clntudp_abort(/*h*/)
463-
/*CLIENT *h;*/
462+
clntudp_abort(cl)
463+
CLIENT *cl;
464464
{
465465
}
466466

librpc/getrpcen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct rpcdata {
7373
static void setrpcent(int f);
7474
static void endrpcent();
7575

76-
static struct rpcent *interpret();
76+
static struct rpcent *interpret(char *, int);
7777
struct hostent *gethostent();
7878
#ifdef WIN32
7979
#define index(str,ch) strchr(str,ch)

librpc/pmap_cln.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static char sccsid[] = "@(#)pmap_clnt.c 1.37 87/08/11 Copyr 1984 Sun Micro";
5858
static struct timeval timeout = { 5, 0 };
5959
static struct timeval tottimeout = { 60, 0 };
6060

61-
void clnt_perror();
61+
void clnt_perror(CLIENT *, char *);
6262

6363

6464
/*

librpc/pmap_rmt.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,6 @@ getbroadcastnets(addrs, sock, buf)
238238
#endif
239239
}
240240

241-
typedef bool_t (*resultproc_t)();
242-
243241
enum clnt_stat
244242
clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
245243
u_long prog; /* program number */

0 commit comments

Comments
 (0)