From ffab68620f121460586af38654ee5be9efaa11f3 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 26 Feb 2009 20:32:11 +0000 Subject: Use ANSI function declarations in librpcsvc. When compiling librpcsvc with LLVM, we get a compiler error, because hexval() uses an ANSI prototype, but a K&R declaration. I could have just changed hexval(), but I'd rather keep this consistent. It's not that much code. Submitted by: Pawel Worach --- lib/librpcsvc/rnusers.c | 7 ++----- lib/librpcsvc/rstat.c | 7 ++----- lib/librpcsvc/rwall.c | 4 +--- lib/librpcsvc/secretkey.c | 5 +---- lib/librpcsvc/xcrypt.c | 25 ++++++------------------- 5 files changed, 12 insertions(+), 36 deletions(-) (limited to 'lib') diff --git a/lib/librpcsvc/rnusers.c b/lib/librpcsvc/rnusers.c index 49cab07..2a68de5 100644 --- a/lib/librpcsvc/rnusers.c +++ b/lib/librpcsvc/rnusers.c @@ -47,9 +47,7 @@ static char sccsid[] = "@(#)rnusers.c 1.2 91/03/11 TIRPC 1.0; from 1.7 89/03/24 #include int -rusers(host, up) - char *host; - struct utmpidlearr *up; +rusers(char *host, utmpidlearr *up) { return (callrpc(host, RUSERSPROG, RUSERSVERS_IDLE, RUSERSPROC_NAMES, (xdrproc_t)xdr_void, (char *) NULL, @@ -57,8 +55,7 @@ rusers(host, up) } int -rnusers(host) - char *host; +rnusers(char *host) { int nusers; diff --git a/lib/librpcsvc/rstat.c b/lib/librpcsvc/rstat.c index 1c19c4e..c5cbe80 100644 --- a/lib/librpcsvc/rstat.c +++ b/lib/librpcsvc/rstat.c @@ -46,9 +46,7 @@ static char sccsid[] = "@(#)rstat.c 1.2 91/03/11 TIRPC 1.0; from 1.6 89/03/24 SM #include enum clnt_stat -rstat(host, statp) - char *host; - struct statstime *statp; +rstat(char *host, struct statstime *statp) { return (callrpc(host, RSTATPROG, RSTATVERS_TIME, RSTATPROC_STATS, (xdrproc_t)xdr_void, (char *) NULL, @@ -56,8 +54,7 @@ rstat(host, statp) } int -havedisk(host) - char *host; +havedisk(char *host) { long have; diff --git a/lib/librpcsvc/rwall.c b/lib/librpcsvc/rwall.c index dd7b590..d53f264 100644 --- a/lib/librpcsvc/rwall.c +++ b/lib/librpcsvc/rwall.c @@ -46,9 +46,7 @@ static char sccsid[] = "@(#)rwall.c 1.2 91/03/11 TIRPC 1.0; from 1.3 89/03/24 S #include int -rwall(host, msg) - char *host; - char *msg; +rwall(char *host, char *msg) { return (callrpc(host, WALLPROG, WALLVERS, WALLPROC_WALL, (xdrproc_t)xdr_wrapstring, (char *) &msg, diff --git a/lib/librpcsvc/secretkey.c b/lib/librpcsvc/secretkey.c index f455445..636fd89 100644 --- a/lib/librpcsvc/secretkey.c +++ b/lib/librpcsvc/secretkey.c @@ -58,10 +58,7 @@ extern int xdecrypt( char *, char * ); * passwd to decrypt it. */ int -getsecretkey(netname, secretkey, passwd) - char *netname; - char *secretkey; - char *passwd; +getsecretkey(char *netname, char *secretkey, char *passwd) { char lookup[3 * HEXKEYBYTES]; char *p; diff --git a/lib/librpcsvc/xcrypt.c b/lib/librpcsvc/xcrypt.c index 7a310d3..17eec49 100644 --- a/lib/librpcsvc/xcrypt.c +++ b/lib/librpcsvc/xcrypt.c @@ -56,9 +56,7 @@ void passwd2des( char *, char * ); * Its length must be a multiple of 16 hex digits (64 bits). */ int -xencrypt(secret, passwd) - char *secret; - char *passwd; +xencrypt(char *secret, char *passwd) { char key[8]; char ivec[8]; @@ -91,9 +89,7 @@ xencrypt(secret, passwd) * Once again, the length is a multiple of 16 hex digits */ int -xdecrypt(secret, passwd) - char *secret; - char *passwd; +xdecrypt(char *secret, char *passwd) { char key[8]; char ivec[8]; @@ -125,9 +121,7 @@ xdecrypt(secret, passwd) * Turn password into DES key */ void -passwd2des(pw, key) - char *pw; - char *key; +passwd2des(char *pw, char *key) { int i; @@ -144,10 +138,7 @@ passwd2des(pw, key) * Hex to binary conversion */ static void -hex2bin(len, hexnum, binnum) - int len; - char *hexnum; - char *binnum; +hex2bin(int len, char *hexnum, char *binnum) { int i; @@ -160,10 +151,7 @@ hex2bin(len, hexnum, binnum) * Binary to hex conversion */ static void -bin2hex(len, binnum, hexnum) - int len; - unsigned char *binnum; - char *hexnum; +bin2hex(int len, unsigned char *binnum, char *hexnum) { int i; unsigned val; @@ -177,8 +165,7 @@ bin2hex(len, binnum, hexnum) } static char -hexval(c) - char c; +hexval(char c) { if (c >= '0' && c <= '9') { return (c - '0'); -- cgit v1.1