c6d234
commit 41075ae3e7f406e67d51da8cc5e89e397710d54b
c6d234
Author: Joseph Myers <joseph@codesourcery.com>
c6d234
Date:   Tue Oct 20 11:52:27 2015 +0000
c6d234
c6d234
    Convert 29 more function definitions to prototype style (multiple parameters in one K&R parameter declaration).
c6d234
    
c6d234
    This automatically-generated patch converts 29 function definitions in
c6d234
    glibc (including one in an example in the manual) from old-style K&R
c6d234
    to prototype-style.  Following my other recent such patches, this one
c6d234
    deals with the case of function definitions where one K&R parameter
c6d234
    declaration declares multiple parameters, as in:
c6d234
    
c6d234
    void
c6d234
    foo (a, b)
c6d234
         int a, *b;
c6d234
    {
c6d234
    }
c6d234
    
c6d234
    Tested for x86_64 and x86 (testsuite, and that installed stripped
c6d234
    shared libraries are unchanged by the patch).
c6d234
    
c6d234
            * crypt/crypt.c (_ufc_doit_r): Convert to prototype-style function
c6d234
            definition.
c6d234
            (_ufc_doit_r): Likewise.
c6d234
            * crypt/crypt_util.c (_ufc_copymem): Likewise.
c6d234
            (_ufc_output_conversion_r): Likewise.
c6d234
            * inet/inet_mkadr.c (__inet_makeaddr): Likewise.
c6d234
            * inet/rcmd.c (rcmd_af): Likewise.
c6d234
            (rcmd): Likewise.
c6d234
            (ruserok_af): Likewise.
c6d234
            (ruserok): Likewise.
c6d234
            (ruserok2_sa): Likewise.
c6d234
            (ruserok_sa): Likewise.
c6d234
            (iruserok_af): Likewise.
c6d234
            (iruserok): Likewise.
c6d234
            (__ivaliduser): Likewise.
c6d234
            (__validuser2_sa): Likewise.
c6d234
            * inet/rexec.c (rexec_af): Likewise.
c6d234
            (rexec): Likewise.
c6d234
            * inet/ruserpass.c (ruserpass): Likewise.
c6d234
            * locale/programs/xmalloc.c (xcalloc): Likewise.
c6d234
            * manual/examples/timeval_subtract.c (timeval_subtract): Likewise.
c6d234
            * math/w_drem.c (__drem): Likewise.
c6d234
            * math/w_dremf.c (__dremf): Likewise.
c6d234
            * math/w_dreml.c (__dreml): Likewise.
c6d234
            * misc/daemon.c (daemon): Likewise.
c6d234
            * resolv/res_debug.c (p_fqnname): Likewise.
c6d234
            * stdlib/div.c (div): Likewise.
c6d234
            * string/memcmp.c (memcmp_bytes): Likewise.
c6d234
            * sunrpc/pmap_rmt.c (pmap_rmtcall): Likewise.
c6d234
            * sunrpc/svc_udp.c (svcudp_bufcreate): Likewise.
c6d234
c6d234
diff --git a/crypt/crypt.c b/crypt/crypt.c
c6d234
index 34b8f2e280263f7a..c86f8a8ab0663f47 100644
c6d234
--- a/crypt/crypt.c
c6d234
+++ b/crypt/crypt.c
c6d234
@@ -36,9 +36,8 @@
c6d234
 #define SBA(sb, v) (*(long32*)((char*)(sb)+(v)))
c6d234
 
c6d234
 void
c6d234
-_ufc_doit_r(itr, __data, res)
c6d234
-     ufc_long itr, *res;
c6d234
-     struct crypt_data * __restrict __data;
c6d234
+_ufc_doit_r (ufc_long itr, struct crypt_data * __restrict __data,
c6d234
+	     ufc_long *res)
c6d234
 {
c6d234
   int i;
c6d234
   long32 s, *k;
c6d234
@@ -82,9 +81,8 @@ _ufc_doit_r(itr, __data, res)
c6d234
 #define SBA(sb, v) (*(long64*)((char*)(sb)+(v)))
c6d234
 
c6d234
 void
c6d234
-_ufc_doit_r(itr, __data, res)
c6d234
-     ufc_long itr, *res;
c6d234
-     struct crypt_data * __restrict __data;
c6d234
+_ufc_doit_r (ufc_long itr, struct crypt_data * __restrict __data,
c6d234
+	     ufc_long *res)
c6d234
 {
c6d234
   int i;
c6d234
   long64 l, r, s, *k;
c6d234
diff --git a/crypt/crypt_util.c b/crypt/crypt_util.c
c6d234
index 954bbfcfebd169b6..9a48e27a81ea7eb3 100644
c6d234
--- a/crypt/crypt_util.c
c6d234
+++ b/crypt/crypt_util.c
c6d234
@@ -312,9 +312,7 @@ _ufc_clearmem (char *start, int cnt)
c6d234
 }
c6d234
 
c6d234
 void
c6d234
-_ufc_copymem(from, to, cnt)
c6d234
-     char *from, *to;
c6d234
-     int cnt;
c6d234
+_ufc_copymem (char *from, char *to, int cnt)
c6d234
 {
c6d234
   while(cnt--)
c6d234
     *to++ = *from++;
c6d234
@@ -770,10 +768,8 @@ _ufc_dofinalperm_r (ufc_long *res, struct crypt_data * __restrict __data)
c6d234
  */
c6d234
 
c6d234
 void
c6d234
-_ufc_output_conversion_r(v1, v2, salt, __data)
c6d234
-     ufc_long v1, v2;
c6d234
-     const char *salt;
c6d234
-     struct crypt_data * __restrict __data;
c6d234
+_ufc_output_conversion_r (ufc_long v1, ufc_long v2, const char *salt,
c6d234
+			  struct crypt_data * __restrict __data)
c6d234
 {
c6d234
   int i, s, shf;
c6d234
 
c6d234
diff --git a/inet/rcmd.c b/inet/rcmd.c
c6d234
index efca27d674720e9c..9f7455eb1ca29045 100644
c6d234
--- a/inet/rcmd.c
c6d234
+++ b/inet/rcmd.c
c6d234
@@ -103,12 +103,8 @@ libc_hidden_proto (iruserok_af)
c6d234
 libc_freeres_ptr(static char *ahostbuf);
c6d234
 
c6d234
 int
c6d234
-rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
c6d234
-	char **ahost;
c6d234
-	u_short rport;
c6d234
-	const char *locuser, *remuser, *cmd;
c6d234
-	int *fd2p;
c6d234
-	sa_family_t af;
c6d234
+rcmd_af (char **ahost, u_short rport, const char *locuser, const char *remuser,
c6d234
+	 const char *cmd, int *fd2p, sa_family_t af)
c6d234
 {
c6d234
 	char paddr[INET6_ADDRSTRLEN];
c6d234
 	struct addrinfo hints, *res, *ai;
c6d234
@@ -360,11 +356,8 @@ bad:
c6d234
 libc_hidden_def (rcmd_af)
c6d234
 
c6d234
 int
c6d234
-rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
c6d234
-	char **ahost;
c6d234
-	u_short rport;
c6d234
-	const char *locuser, *remuser, *cmd;
c6d234
-	int *fd2p;
c6d234
+rcmd (char **ahost, u_short rport, const char *locuser, const char *remuser,
c6d234
+      const char *cmd, int *fd2p)
c6d234
 {
c6d234
   return rcmd_af (ahost, rport, locuser, remuser, cmd, fd2p, AF_INET);
c6d234
 }
c6d234
@@ -434,10 +427,8 @@ int	__check_rhosts_file = 1;
c6d234
 char	*__rcmd_errstr;
c6d234
 
c6d234
 int
c6d234
-ruserok_af(rhost, superuser, ruser, luser, af)
c6d234
-	const char *rhost, *ruser, *luser;
c6d234
-	int superuser;
c6d234
-	sa_family_t af;
c6d234
+ruserok_af (const char *rhost, int superuser, const char *ruser,
c6d234
+	    const char *luser, sa_family_t af)
c6d234
 {
c6d234
 	struct addrinfo hints, *res, *res0;
c6d234
 	int gai;
c6d234
@@ -461,9 +452,8 @@ ruserok_af(rhost, superuser, ruser, luser, af)
c6d234
 libc_hidden_def (ruserok_af)
c6d234
 
c6d234
 int
c6d234
-ruserok(rhost, superuser, ruser, luser)
c6d234
-	const char *rhost, *ruser, *luser;
c6d234
-	int superuser;
c6d234
+ruserok (const char *rhost, int superuser, const char *ruser,
c6d234
+	 const char *luser)
c6d234
 {
c6d234
 	return ruserok_af(rhost, superuser, ruser, luser, AF_INET);
c6d234
 }
c6d234
@@ -523,11 +513,8 @@ iruserfopen (const char *file, uid_t okuser)
c6d234
  * Returns 0 if ok, -1 if not ok.
c6d234
  */
c6d234
 static int
c6d234
-ruserok2_sa (ra, ralen, superuser, ruser, luser, rhost)
c6d234
-     struct sockaddr *ra;
c6d234
-     size_t ralen;
c6d234
-     int superuser;
c6d234
-     const char *ruser, *luser, *rhost;
c6d234
+ruserok2_sa (struct sockaddr *ra, size_t ralen, int superuser,
c6d234
+	     const char *ruser, const char *luser, const char *rhost)
c6d234
 {
c6d234
   FILE *hostf = NULL;
c6d234
   int isbad = -1;
c6d234
@@ -584,22 +571,17 @@ ruserok2_sa (ra, ralen, superuser, ruser, luser, rhost)
c6d234
  * ruserok_sa() is now discussed on ipng, so
c6d234
  * currently disabled for external use
c6d234
  */
c6d234
-static int ruserok_sa(ra, ralen, superuser, ruser, luser)
c6d234
-     struct sockaddr *ra;
c6d234
-     size_t ralen;
c6d234
-     int superuser;
c6d234
-     const char *ruser, *luser;
c6d234
+static int
c6d234
+ruserok_sa (struct sockaddr *ra, size_t ralen, int superuser,
c6d234
+	    const char *ruser, const char *luser)
c6d234
 {
c6d234
   return ruserok2_sa(ra, ralen, superuser, ruser, luser, "-");
c6d234
 }
c6d234
 
c6d234
 /* This is the exported version.  */
c6d234
 int
c6d234
-iruserok_af (raddr, superuser, ruser, luser, af)
c6d234
-     const void *raddr;
c6d234
-     int superuser;
c6d234
-     const char *ruser, *luser;
c6d234
-     sa_family_t af;
c6d234
+iruserok_af (const void *raddr, int superuser, const char *ruser,
c6d234
+	     const char *luser, sa_family_t af)
c6d234
 {
c6d234
   struct sockaddr_storage ra;
c6d234
   size_t ralen;
c6d234
@@ -626,10 +608,7 @@ iruserok_af (raddr, superuser, ruser, luser, af)
c6d234
 libc_hidden_def (iruserok_af)
c6d234
 
c6d234
 int
c6d234
-iruserok (raddr, superuser, ruser, luser)
c6d234
-     u_int32_t raddr;
c6d234
-     int superuser;
c6d234
-     const char *ruser, *luser;
c6d234
+iruserok (u_int32_t raddr, int superuser, const char *ruser, const char *luser)
c6d234
 {
c6d234
   return iruserok_af (&raddr, superuser, ruser, luser, AF_INET);
c6d234
 }
c6d234
@@ -646,10 +625,8 @@ iruserok (raddr, superuser, ruser, luser)
c6d234
  * Returns 0 if ok, -1 if not ok.
c6d234
  */
c6d234
 int
c6d234
-__ivaliduser(hostf, raddr, luser, ruser)
c6d234
-	FILE *hostf;
c6d234
-	u_int32_t raddr;
c6d234
-	const char *luser, *ruser;
c6d234
+__ivaliduser (FILE *hostf, u_int32_t raddr, const char *luser,
c6d234
+	      const char *ruser)
c6d234
 {
c6d234
 	struct sockaddr_in ra;
c6d234
 	memset(&ra, '\0', sizeof(ra));
c6d234
@@ -760,11 +737,8 @@ __isempty (char *p)
c6d234
  * Returns 0 if positive match, -1 if _not_ ok.
c6d234
  */
c6d234
 static int
c6d234
-__validuser2_sa(hostf, ra, ralen, luser, ruser, rhost)
c6d234
-	FILE *hostf;
c6d234
-	struct sockaddr *ra;
c6d234
-	size_t ralen;
c6d234
-	const char *luser, *ruser, *rhost;
c6d234
+__validuser2_sa (FILE *hostf, struct sockaddr *ra, size_t ralen,
c6d234
+		 const char *luser, const char *ruser, const char *rhost)
c6d234
 {
c6d234
     const char *user;
c6d234
     char *p;
c6d234
diff --git a/inet/rexec.c b/inet/rexec.c
c6d234
index 75bb47082b3fa4f2..4e6d48d6b8060b07 100644
c6d234
--- a/inet/rexec.c
c6d234
+++ b/inet/rexec.c
c6d234
@@ -49,12 +49,8 @@ int	rexecoptions;
c6d234
 libc_freeres_ptr (static char *ahostbuf);
c6d234
 
c6d234
 int
c6d234
-rexec_af(ahost, rport, name, pass, cmd, fd2p, af)
c6d234
-	char **ahost;
c6d234
-	int rport;
c6d234
-	const char *name, *pass, *cmd;
c6d234
-	int *fd2p;
c6d234
-	sa_family_t af;
c6d234
+rexec_af (char **ahost, int rport, const char *name, const char *pass,
c6d234
+	  const char *cmd, int *fd2p, sa_family_t af)
c6d234
 {
c6d234
 	struct sockaddr_storage from;
c6d234
 	struct addrinfo hints, *res0;
c6d234
@@ -198,11 +194,8 @@ bad:
c6d234
 libc_hidden_def (rexec_af)
c6d234
 
c6d234
 int
c6d234
-rexec(ahost, rport, name, pass, cmd, fd2p)
c6d234
-	char **ahost;
c6d234
-	int rport;
c6d234
-	const char *name, *pass, *cmd;
c6d234
-	int *fd2p;
c6d234
+rexec (char **ahost, int rport, const char *name, const char *pass,
c6d234
+       const char *cmd, int *fd2p)
c6d234
 {
c6d234
 	return rexec_af(ahost, rport, name, pass, cmd, fd2p, AF_INET);
c6d234
 }
c6d234
diff --git a/inet/ruserpass.c b/inet/ruserpass.c
c6d234
index f64ca3f1c12d478e..ec0acb4d46a1bb43 100644
c6d234
--- a/inet/ruserpass.c
c6d234
+++ b/inet/ruserpass.c
c6d234
@@ -94,8 +94,7 @@ static const struct toktab {
c6d234
 
c6d234
 
c6d234
 int
c6d234
-ruserpass(host, aname, apass)
c6d234
-	const char *host, **aname, **apass;
c6d234
+ruserpass (const char *host, const char **aname, const char **apass)
c6d234
 {
c6d234
 	char *hdir, *buf, *tmp;
c6d234
 	char myname[1024], *mydomain;
c6d234
diff --git a/locale/programs/xmalloc.c b/locale/programs/xmalloc.c
c6d234
index bfc86ab77c29ef0b..4415664d45b4bddd 100644
c6d234
--- a/locale/programs/xmalloc.c
c6d234
+++ b/locale/programs/xmalloc.c
c6d234
@@ -81,8 +81,7 @@ xmalloc (size_t n)
c6d234
 /* Allocate memory for N elements of S bytes, with error checking.  */
c6d234
 
c6d234
 VOID *
c6d234
-xcalloc (n, s)
c6d234
-     size_t n, s;
c6d234
+xcalloc (size_t n, size_t s)
c6d234
 {
c6d234
   VOID *p;
c6d234
 
c6d234
diff --git a/manual/examples/timeval_subtract.c b/manual/examples/timeval_subtract.c
c6d234
index 232d4b199c9d8b1a..bff6f0204e4cdc34 100644
c6d234
--- a/manual/examples/timeval_subtract.c
c6d234
+++ b/manual/examples/timeval_subtract.c
c6d234
@@ -20,8 +20,7 @@
c6d234
    Return 1 if the difference is negative, otherwise 0.  */
c6d234
 
c6d234
 int
c6d234
-timeval_subtract (result, x, y)
c6d234
-     struct timeval *result, *x, *y;
c6d234
+timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y)
c6d234
 {
c6d234
   /* Perform the carry for the later subtraction by updating @var{y}. */
c6d234
   if (x->tv_usec < y->tv_usec) {
c6d234
diff --git a/math/w_drem.c b/math/w_drem.c
c6d234
index 9e2b1e7472cc565b..843b67aa80335849 100644
c6d234
--- a/math/w_drem.c
c6d234
+++ b/math/w_drem.c
c6d234
@@ -8,8 +8,7 @@
c6d234
 #include <math.h>
c6d234
 
c6d234
 double
c6d234
-__drem(x, y)
c6d234
-	double x, y;
c6d234
+__drem (double x, double y)
c6d234
 {
c6d234
 	return __remainder(x, y);
c6d234
 }
c6d234
diff --git a/math/w_dremf.c b/math/w_dremf.c
c6d234
index 4ec4baffd4c4fa3f..029e6bdf7f811e08 100644
c6d234
--- a/math/w_dremf.c
c6d234
+++ b/math/w_dremf.c
c6d234
@@ -9,8 +9,7 @@
c6d234
 #include <math_private.h>
c6d234
 
c6d234
 float
c6d234
-__dremf(x, y)
c6d234
-	float x, y;
c6d234
+__dremf (float x, float y)
c6d234
 {
c6d234
 	return __remainderf(x, y);
c6d234
 }
c6d234
diff --git a/math/w_dreml.c b/math/w_dreml.c
c6d234
index aa73eedc496bca65..8d0139ac28061ccc 100644
c6d234
--- a/math/w_dreml.c
c6d234
+++ b/math/w_dreml.c
c6d234
@@ -10,8 +10,7 @@
c6d234
 #include <math.h>
c6d234
 
c6d234
 long double
c6d234
-__dreml(x, y)
c6d234
-	long double x, y;
c6d234
+__dreml (long double x, long double y)
c6d234
 {
c6d234
 	return __remainderl(x, y);
c6d234
 }
c6d234
diff --git a/misc/daemon.c b/misc/daemon.c
c6d234
index 7597ce9996d5fde1..9d186b24bdc8ead0 100644
c6d234
--- a/misc/daemon.c
c6d234
+++ b/misc/daemon.c
c6d234
@@ -41,8 +41,7 @@ static char sccsid[] = "@(#)daemon.c	8.1 (Berkeley) 6/4/93";
c6d234
 #include <not-cancel.h>
c6d234
 
c6d234
 int
c6d234
-daemon(nochdir, noclose)
c6d234
-	int nochdir, noclose;
c6d234
+daemon (int nochdir, int noclose)
c6d234
 {
c6d234
 	int fd;
c6d234
 
c6d234
diff --git a/stdlib/div.c b/stdlib/div.c
c6d234
index a388080ed2852792..f4367c8770cff758 100644
c6d234
--- a/stdlib/div.c
c6d234
+++ b/stdlib/div.c
c6d234
@@ -51,8 +51,7 @@
c6d234
 
c6d234
 /* Return the `div_t' representation of NUMER over DENOM.  */
c6d234
 div_t
c6d234
-div (numer, denom)
c6d234
-     int numer, denom;
c6d234
+div (int numer, int denom)
c6d234
 {
c6d234
   div_t result;
c6d234
 
c6d234
diff --git a/string/memcmp.c b/string/memcmp.c
c6d234
index 2600c9d8038043a6..dbb286c7061fcbd6 100644
c6d234
--- a/string/memcmp.c
c6d234
+++ b/string/memcmp.c
c6d234
@@ -97,8 +97,7 @@ static int memcmp_bytes (op_t, op_t) __THROW;
c6d234
 __inline
c6d234
 # endif
c6d234
 static int
c6d234
-memcmp_bytes (a, b)
c6d234
-     op_t a, b;
c6d234
+memcmp_bytes (op_t a, op_t b)
c6d234
 {
c6d234
   long int srcp1 = (long int) &a;
c6d234
   long int srcp2 = (long int) &b;
c6d234
diff --git a/sunrpc/pmap_rmt.c b/sunrpc/pmap_rmt.c
c6d234
index c0adc5b49ac4c54f..c8a8011ea5474b3b 100644
c6d234
--- a/sunrpc/pmap_rmt.c
c6d234
+++ b/sunrpc/pmap_rmt.c
c6d234
@@ -64,13 +64,9 @@ static const struct timeval timeout = {3, 0};
c6d234
  * programs to do a lookup and call in one step.
c6d234
  */
c6d234
 enum clnt_stat
c6d234
-pmap_rmtcall (addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_ptr)
c6d234
-     struct sockaddr_in *addr;
c6d234
-     u_long prog, vers, proc;
c6d234
-     xdrproc_t xdrargs, xdrres;
c6d234
-     caddr_t argsp, resp;
c6d234
-     struct timeval tout;
c6d234
-     u_long *port_ptr;
c6d234
+pmap_rmtcall (struct sockaddr_in *addr, u_long prog, u_long vers, u_long proc,
c6d234
+	      xdrproc_t xdrargs, caddr_t argsp, xdrproc_t xdrres, caddr_t resp,
c6d234
+	      struct timeval tout, u_long *port_ptr)
c6d234
 {
c6d234
   int socket = -1;
c6d234
   CLIENT *client;
c6d234
diff --git a/sunrpc/svc_udp.c b/sunrpc/svc_udp.c
c6d234
index d1c8788d20b6805c..c1139b035317e886 100644
c6d234
--- a/sunrpc/svc_udp.c
c6d234
+++ b/sunrpc/svc_udp.c
c6d234
@@ -118,9 +118,7 @@ struct svcudp_data
c6d234
  * The routines returns NULL if a problem occurred.
c6d234
  */
c6d234
 SVCXPRT *
c6d234
-svcudp_bufcreate (sock, sendsz, recvsz)
c6d234
-     int sock;
c6d234
-     u_int sendsz, recvsz;
c6d234
+svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
c6d234
 {
c6d234
   bool_t madesock = FALSE;
c6d234
   SVCXPRT *xprt;