Blame SOURCES/glibc-rh1505492-prototypes-15.patch

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