Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit a72ddc1

Browse files
committed
Convert 24 more function definitions to prototype style (array parameters).
This automatically-generated patch converts 24 function definitions in glibc from old-style K&R to prototype-style. Following my other recent such patches, this one deals with the case of functions with array parameters. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * crypt/cert.c (main): Convert to prototype-style function definition. * io/pipe.c (__pipe): Likewise. * io/pipe2.c (__pipe2): Likewise. * misc/futimesat.c (futimesat): Likewise. * misc/utimes.c (__utimes): Likewise. * posix/execve.c (__execve): Likewise. * posix/execvp.c (execvp): Likewise. * posix/execvpe.c (__execvpe): Likewise. * posix/fexecve.c (fexecve): Likewise. * socket/socketpair.c (socketpair): Likewise. * stdlib/drand48-iter.c (__drand48_iterate): Likewise. * stdlib/erand48.c (erand48): Likewise. * stdlib/erand48_r.c (__erand48_r): Likewise. * stdlib/jrand48.c (jrand48): Likewise. * stdlib/jrand48_r.c (__jrand48_r): Likewise. * stdlib/lcong48.c (lcong48): Likewise. * stdlib/lcong48_r.c (__lcong48_r): Likewise. * stdlib/nrand48.c (nrand48): Likewise. * stdlib/nrand48_r.c (__nrand48_r): Likewise. * stdlib/seed48.c (seed48): Likewise. * stdlib/seed48_r.c (__seed48_r): Likewise. * sysdeps/mach/hurd/execve.c (__execve): Likewise. * sysdeps/mach/hurd/utimes.c (__utimes): Likewise. * sysdeps/unix/sysv/linux/fexecve.c (fexecve): Likewise.
1 parent 864198e commit a72ddc1

25 files changed

+55
-77
lines changed

ChangeLog

+28
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
2015-10-20 Joseph Myers <[email protected]>
2+
3+
* crypt/cert.c (main): Convert to prototype-style function
4+
definition.
5+
* io/pipe.c (__pipe): Likewise.
6+
* io/pipe2.c (__pipe2): Likewise.
7+
* misc/futimesat.c (futimesat): Likewise.
8+
* misc/utimes.c (__utimes): Likewise.
9+
* posix/execve.c (__execve): Likewise.
10+
* posix/execvp.c (execvp): Likewise.
11+
* posix/execvpe.c (__execvpe): Likewise.
12+
* posix/fexecve.c (fexecve): Likewise.
13+
* socket/socketpair.c (socketpair): Likewise.
14+
* stdlib/drand48-iter.c (__drand48_iterate): Likewise.
15+
* stdlib/erand48.c (erand48): Likewise.
16+
* stdlib/erand48_r.c (__erand48_r): Likewise.
17+
* stdlib/jrand48.c (jrand48): Likewise.
18+
* stdlib/jrand48_r.c (__jrand48_r): Likewise.
19+
* stdlib/lcong48.c (lcong48): Likewise.
20+
* stdlib/lcong48_r.c (__lcong48_r): Likewise.
21+
* stdlib/nrand48.c (nrand48): Likewise.
22+
* stdlib/nrand48_r.c (__nrand48_r): Likewise.
23+
* stdlib/seed48.c (seed48): Likewise.
24+
* stdlib/seed48_r.c (__seed48_r): Likewise.
25+
* sysdeps/mach/hurd/execve.c (__execve): Likewise.
26+
* sysdeps/mach/hurd/utimes.c (__utimes): Likewise.
27+
* sysdeps/unix/sysv/linux/fexecve.c (fexecve): Likewise.
28+
129
2015-10-19 Joseph Myers <[email protected]>
230

331
* configure.ac (libc_cv_asm_unique_object): Remove configure test.

crypt/cert.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ good_bye (void)
3030
}
3131

3232
int
33-
main(argc, argv)
34-
int argc;
35-
char *argv[];
33+
main (int argc, char *argv[])
3634
{
3735
char key[64],plain[64],cipher[64],answer[64];
3836
int i;

io/pipe.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
bytes written on PIPEDES[1] can be read from PIPEDES[0].
2525
Returns 0 if successful, -1 if not. */
2626
int
27-
__pipe (__pipedes)
28-
int __pipedes[2];
27+
__pipe (int __pipedes[2])
2928
{
3029
if (__pipedes == NULL)
3130
{

io/pipe2.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
PIPEDES[1] can be read from PIPEDES[0]. Apply FLAGS to the new
2525
file descriptors. Returns 0 if successful, -1 if not. */
2626
int
27-
__pipe2 (pipedes, flags)
28-
int pipedes[2];
29-
int flags;
27+
__pipe2 (int pipedes[2], int flags)
3028
{
3129
if (pipedes == NULL)
3230
{

misc/futimesat.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
/* Change the access time of FILE relative to FD to TVP[0] and
2525
the modification time of FILE to TVP[1]. */
2626
int
27-
futimesat (fd, file, tvp)
28-
int fd;
29-
const char *file;
30-
const struct timeval tvp[2];
27+
futimesat (int fd, const char *file, const struct timeval tvp[2])
3128
{
3229
if (fd < 0
3330
&& (file == NULL

misc/utimes.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
/* Change the access time of FILE to TVP[0] and
2323
the modification time of FILE to TVP[1]. */
2424
int
25-
__utimes (file, tvp)
26-
const char *file;
27-
const struct timeval tvp[2];
25+
__utimes (const char *file, const struct timeval tvp[2])
2826
{
2927
if (file == NULL)
3028
{

posix/execve.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323
/* Replace the current process, executing PATH with arguments ARGV and
2424
environment ENVP. ARGV and ENVP are terminated by NULL pointers. */
2525
int
26-
__execve (path, argv, envp)
27-
const char *path;
28-
char *const argv[];
29-
char *const envp[];
26+
__execve (const char *path, char *const argv[], char *const envp[])
3027
{
3128
if (path == NULL || argv == NULL || envp == NULL)
3229
{

posix/execvp.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
/* Execute FILE, searching in the `PATH' environment variable if it contains
2222
no slashes, with arguments ARGV and environment from `environ'. */
2323
int
24-
execvp (file, argv)
25-
const char *file;
26-
char *const argv[];
24+
execvp (const char *file, char *const argv[])
2725
{
2826
return __execvpe (file, argv, __environ);
2927
}

posix/execvpe.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ scripts_argv (const char *file, char *const argv[], int argc, char **new_argv)
4545
/* Execute FILE, searching in the `PATH' environment variable if it contains
4646
no slashes, with arguments ARGV and environment from ENVP. */
4747
int
48-
__execvpe (file, argv, envp)
49-
const char *file;
50-
char *const argv[];
51-
char *const envp[];
48+
__execvpe (const char *file, char *const argv[], char *const envp[])
5249
{
5350
if (*file == '\0')
5451
{

posix/fexecve.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323
/* Execute the file FD refers to, overlaying the running program image.
2424
ARGV and ENVP are passed to the new program, as for `execve'. */
2525
int
26-
fexecve (fd, argv, envp)
27-
int fd;
28-
char *const argv[];
29-
char *const envp[];
26+
fexecve (int fd, char *const argv[], char *const envp[])
3027
{
3128
if (fd < 0 || argv == NULL || envp == NULL)
3229
{

socket/socketpair.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@
2323
descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero,
2424
one will be chosen automatically. Returns 0 on success, -1 for errors. */
2525
int
26-
socketpair (domain, type, protocol, fds)
27-
int domain;
28-
int type;
29-
int protocol;
30-
int fds[2];
26+
socketpair (int domain, int type, int protocol, int fds[2])
3127
{
3228
__set_errno (ENOSYS);
3329
return -1;

stdlib/drand48-iter.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ struct drand48_data __libc_drand48_data;
2727

2828

2929
int
30-
__drand48_iterate (xsubi, buffer)
31-
unsigned short int xsubi[3];
32-
struct drand48_data *buffer;
30+
__drand48_iterate (unsigned short int xsubi[3], struct drand48_data *buffer)
3331
{
3432
uint64_t X;
3533
uint64_t result;

stdlib/erand48.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121

2222
double
23-
erand48 (xsubi)
24-
unsigned short int xsubi[3];
23+
erand48 (unsigned short int xsubi[3])
2524
{
2625
double result;
2726

stdlib/erand48_r.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222

2323

2424
int
25-
__erand48_r (xsubi, buffer, result)
26-
unsigned short int xsubi[3];
27-
struct drand48_data *buffer;
28-
double *result;
25+
__erand48_r (unsigned short int xsubi[3], struct drand48_data *buffer,
26+
double *result)
2927
{
3028
union ieee754_double temp;
3129

stdlib/jrand48.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121

2222
long int
23-
jrand48 (xsubi)
24-
unsigned short int xsubi[3];
23+
jrand48 (unsigned short int xsubi[3])
2524
{
2625
long int result;
2726

stdlib/jrand48_r.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
#include <stdlib.h>
2020

2121
int
22-
__jrand48_r (xsubi, buffer, result)
23-
unsigned short int xsubi[3];
24-
struct drand48_data *buffer;
25-
long int *result;
22+
__jrand48_r (unsigned short int xsubi[3], struct drand48_data *buffer,
23+
long int *result)
2624
{
2725
/* Compute next state. */
2826
if (__drand48_iterate (xsubi, buffer) < 0)

stdlib/lcong48.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121

2222
void
23-
lcong48 (param)
24-
unsigned short int param[7];
23+
lcong48 (unsigned short int param[7])
2524
{
2625
(void) __lcong48_r (param, &__libc_drand48_data);
2726
}

stdlib/lcong48_r.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
#include <limits.h>
2323

2424
int
25-
__lcong48_r (param, buffer)
26-
unsigned short int param[7];
27-
struct drand48_data *buffer;
25+
__lcong48_r (unsigned short int param[7], struct drand48_data *buffer)
2826
{
2927
/* Store the given values. */
3028
memcpy (buffer->__x, &param[0], sizeof (buffer->__x));

stdlib/nrand48.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121

2222
long int
23-
nrand48 (xsubi)
24-
unsigned short int xsubi[3];
23+
nrand48 (unsigned short int xsubi[3])
2524
{
2625
long int result;
2726

stdlib/nrand48_r.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
#include <stdlib.h>
2020

2121
int
22-
__nrand48_r (xsubi, buffer, result)
23-
unsigned short int xsubi[3];
24-
struct drand48_data *buffer;
25-
long int *result;
22+
__nrand48_r (unsigned short int xsubi[3], struct drand48_data *buffer,
23+
long int *result)
2624
{
2725
/* Compute next state. */
2826
if (__drand48_iterate (xsubi, buffer) < 0)

stdlib/seed48.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121

2222
unsigned short int *
23-
seed48 (seed16v)
24-
unsigned short int seed16v[3];
23+
seed48 (unsigned short int seed16v[3])
2524
{
2625
(void) __seed48_r (seed16v, &__libc_drand48_data);
2726

stdlib/seed48_r.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
#include <limits.h>
2222

2323
int
24-
__seed48_r (seed16v, buffer)
25-
unsigned short int seed16v[3];
26-
struct drand48_data *buffer;
24+
__seed48_r (unsigned short int seed16v[3], struct drand48_data *buffer)
2725
{
2826
/* Save old value at a private place to be used as return value. */
2927
memcpy (buffer->__old_x, buffer->__x, sizeof (buffer->__x));

sysdeps/mach/hurd/execve.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
/* Replace the current process, executing FILE_NAME with arguments ARGV and
2323
environment ENVP. ARGV and ENVP are terminated by NULL pointers. */
2424
int
25-
__execve (file_name, argv, envp)
26-
const char *file_name;
27-
char *const argv[];
28-
char *const envp[];
25+
__execve (const char *file_name, char *const argv[], char *const envp[])
2926
{
3027
error_t err;
3128
file_t file = __file_name_lookup (file_name, O_EXEC, 0);

sysdeps/mach/hurd/utimes.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
/* Change the access time of FILE to TVP[0] and
2424
the modification time of FILE to TVP[1]. */
2525
int
26-
__utimes (file, tvp)
27-
const char *file;
28-
const struct timeval tvp[2];
26+
__utimes (const char *file, const struct timeval tvp[2])
2927
{
3028
union tv
3129
{

sysdeps/unix/sysv/linux/fexecve.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
/* Execute the file FD refers to, overlaying the running program image.
2626
ARGV and ENVP are passed to the new program, as for `execve'. */
2727
int
28-
fexecve (fd, argv, envp)
29-
int fd;
30-
char *const argv[];
31-
char *const envp[];
28+
fexecve (int fd, char *const argv[], char *const envp[])
3229
{
3330
if (fd < 0 || argv == NULL || envp == NULL)
3431
{

0 commit comments

Comments
 (0)