Skip to content

Commit

Permalink
Convert 69 more function definitions to prototype style (line wrap ca…
Browse files Browse the repository at this point in the history
…ses).

This automatically-generated patch converts 69 function definitions in
glibc from old-style K&R to prototype-style.

This patch, covering both sysdeps and non-sysdeps files, deals with
cases where the prototype needed to be wrapped over more than one
line.  Otherwise, exclusions and caveats are as for
<https://sourceware.org/ml/libc-alpha/2015-10/msg00594.html> and
<https://sourceware.org/ml/libc-alpha/2015-10/msg00599.html>.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	* crypt/crypt-entry.c (__crypt_r): Convert to prototype-style
	function definition.
	* crypt/crypt_util.c (__encrypt_r): Likewise.
	* libio/genops.c (_IO_no_init): Likewise.
	* libio/iofopncook.c (_IO_fopencookie): Likewise.
	(_IO_old_fopencookie): Likewise.
	* libio/iofwrite_u.c (fwrite_unlocked): Likewise.
	* libio/iogetline.c (_IO_getline): Likewise.
	(_IO_getline_info): Likewise.
	* libio/iogetwline.c (_IO_getwline): Likewise.
	(_IO_getwline_info): Likewise.
	* libio/vsnprintf.c (_IO_vsnprintf): Likewise.
	* libio/vswprintf.c (_IO_vswprintf): Likewise.
	* locale/programs/simple-hash.c (insert_entry_2): Likewise.
	(find_entry): Likewise.
	(iterate_table): Likewise.
	(lookup): Likewise.
	* login/forkpty.c (forkpty): Likewise.
	* misc/hsearch_r.c (__hsearch_r): Likewise.
	* misc/select.c (__select): Likewise.
	* nptl/cleanup_defer_compat.c (_pthread_cleanup_pop_restore):
	Likewise.
	* nptl/old_pthread_cond_init.c (__pthread_cond_init_2_0):
	Likewise.
	* nptl/old_pthread_cond_timedwait.c
	(__pthread_cond_timedwait_2_0): Likewise.
	* nptl/pthread_barrier_init.c (__pthread_barrier_init): Likewise.
	* nptl/pthread_barrierattr_getpshared.c
	(pthread_barrierattr_getpshared): Likewise.
	* nptl/pthread_getschedparam.c (__pthread_getschedparam):
	Likewise.
	* nptl/pthread_mutex_setprioceiling.c
	(pthread_mutex_setprioceiling): Likewise.
	* nptl/pthread_mutexattr_getprioceiling.c
	(pthread_mutexattr_getprioceiling): Likewise.
	* nptl/pthread_rwlock_init.c (__pthread_rwlock_init): Likewise.
	* nptl/pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
	Likewise.
	* nptl/pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
	Likewise.
	* nptl/pthread_setschedparam.c (__pthread_setschedparam):
	Likewise.
	* socket/recvfrom.c (__recvfrom): Likewise.
	* socket/sendto.c (__sendto): Likewise.
	* socket/setsockopt.c (__setsockopt): Likewise.
	* stdio-common/_itoa.c (_itoa): Likewise.
	* stdio-common/_itowa.c (_itowa): Likewise.
	* stdio-common/reg-printf.c (__register_printf_specifier):
	Likewise.
	(__register_printf_function): Likewise.
	* stdio-common/tempname.c (__path_search): Likewise.
	* stdlib/addmul_1.c (mpn_addmul_1): Likewise.
	* stdlib/mul_1.c (mpn_mul_1): Likewise.
	* stdlib/random_r.c (__initstate_r): Likewise.
	* stdlib/setenv.c (__add_to_environ): Likewise.
	* stdlib/submul_1.c (mpn_submul_1): Likewise.
	* streams/getpmsg.c (getpmsg): Likewise.
	* streams/putmsg.c (putmsg): Likewise.
	* streams/putpmsg.c (putpmsg): Likewise.
	* sunrpc/clnt_raw.c (clntraw_call): Likewise.
	* sunrpc/clnt_tcp.c (clnttcp_call): Likewise.
	* sunrpc/clnt_udp.c (clntudp_create): Likewise.
	* sunrpc/clnt_unix.c (clntunix_call): Likewise.
	* sunrpc/pm_getport.c (pmap_getport): Likewise.
	* sunrpc/svc_udp.c (cache_get): Likewise.
	* sunrpc/xdr_array.c (xdr_vector): Likewise.
	* sysdeps/mach/hurd/getcwd.c
	(__canonicalize_directory_name_internal): Likewise.
	* sysdeps/mach/hurd/pselect.c (__pselect): Likewise.
	* sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise.
	* sysdeps/mach/hurd/select.c (__select): Likewise.
	* sysdeps/posix/ttyname_r.c (getttyname_r): Likewise.
	* sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
	* sysdeps/sparc/nptl/pthread_barrier_init.c
	(__pthread_barrier_init): Likewise.
	* sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c
	(__pthread_cond_timedwait): Likewise.
	* sysdeps/unix/sysv/linux/i386/putmsg.c (putmsg): Likewise.
	* sysdeps/unix/sysv/linux/s390/semtimedop.c (semtimedop):
	Likewise.
	* sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Likewise.
	* sysdeps/unix/sysv/linux/timer_settime.c (timer_settime):
	Likewise.
	* sysvipc/semtimedop.c (semtimedop): Likewise.
	* time/setitimer.c (__setitimer): Likewise.
	* time/strftime_l.c (emacs_strftime): Likewise.
  • Loading branch information
Joseph Myers committed Oct 19, 2015
1 parent 6ab674e commit f63f2bf
Show file tree
Hide file tree
Showing 63 changed files with 229 additions and 354 deletions.
89 changes: 89 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,92 @@
2015-10-19 Joseph Myers <joseph@codesourcery.com>

* crypt/crypt-entry.c (__crypt_r): Convert to prototype-style
function definition.
* crypt/crypt_util.c (__encrypt_r): Likewise.
* libio/genops.c (_IO_no_init): Likewise.
* libio/iofopncook.c (_IO_fopencookie): Likewise.
(_IO_old_fopencookie): Likewise.
* libio/iofwrite_u.c (fwrite_unlocked): Likewise.
* libio/iogetline.c (_IO_getline): Likewise.
(_IO_getline_info): Likewise.
* libio/iogetwline.c (_IO_getwline): Likewise.
(_IO_getwline_info): Likewise.
* libio/vsnprintf.c (_IO_vsnprintf): Likewise.
* libio/vswprintf.c (_IO_vswprintf): Likewise.
* locale/programs/simple-hash.c (insert_entry_2): Likewise.
(find_entry): Likewise.
(iterate_table): Likewise.
(lookup): Likewise.
* login/forkpty.c (forkpty): Likewise.
* misc/hsearch_r.c (__hsearch_r): Likewise.
* misc/select.c (__select): Likewise.
* nptl/cleanup_defer_compat.c (_pthread_cleanup_pop_restore):
Likewise.
* nptl/old_pthread_cond_init.c (__pthread_cond_init_2_0):
Likewise.
* nptl/old_pthread_cond_timedwait.c
(__pthread_cond_timedwait_2_0): Likewise.
* nptl/pthread_barrier_init.c (__pthread_barrier_init): Likewise.
* nptl/pthread_barrierattr_getpshared.c
(pthread_barrierattr_getpshared): Likewise.
* nptl/pthread_getschedparam.c (__pthread_getschedparam):
Likewise.
* nptl/pthread_mutex_setprioceiling.c
(pthread_mutex_setprioceiling): Likewise.
* nptl/pthread_mutexattr_getprioceiling.c
(pthread_mutexattr_getprioceiling): Likewise.
* nptl/pthread_rwlock_init.c (__pthread_rwlock_init): Likewise.
* nptl/pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
Likewise.
* nptl/pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
Likewise.
* nptl/pthread_setschedparam.c (__pthread_setschedparam):
Likewise.
* socket/recvfrom.c (__recvfrom): Likewise.
* socket/sendto.c (__sendto): Likewise.
* socket/setsockopt.c (__setsockopt): Likewise.
* stdio-common/_itoa.c (_itoa): Likewise.
* stdio-common/_itowa.c (_itowa): Likewise.
* stdio-common/reg-printf.c (__register_printf_specifier):
Likewise.
(__register_printf_function): Likewise.
* stdio-common/tempname.c (__path_search): Likewise.
* stdlib/addmul_1.c (mpn_addmul_1): Likewise.
* stdlib/mul_1.c (mpn_mul_1): Likewise.
* stdlib/random_r.c (__initstate_r): Likewise.
* stdlib/setenv.c (__add_to_environ): Likewise.
* stdlib/submul_1.c (mpn_submul_1): Likewise.
* streams/getpmsg.c (getpmsg): Likewise.
* streams/putmsg.c (putmsg): Likewise.
* streams/putpmsg.c (putpmsg): Likewise.
* sunrpc/clnt_raw.c (clntraw_call): Likewise.
* sunrpc/clnt_tcp.c (clnttcp_call): Likewise.
* sunrpc/clnt_udp.c (clntudp_create): Likewise.
* sunrpc/clnt_unix.c (clntunix_call): Likewise.
* sunrpc/pm_getport.c (pmap_getport): Likewise.
* sunrpc/svc_udp.c (cache_get): Likewise.
* sunrpc/xdr_array.c (xdr_vector): Likewise.
* sysdeps/mach/hurd/getcwd.c
(__canonicalize_directory_name_internal): Likewise.
* sysdeps/mach/hurd/pselect.c (__pselect): Likewise.
* sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise.
* sysdeps/mach/hurd/select.c (__select): Likewise.
* sysdeps/posix/ttyname_r.c (getttyname_r): Likewise.
* sysdeps/pthread/timer_settime.c (timer_settime): Likewise.
* sysdeps/sparc/nptl/pthread_barrier_init.c
(__pthread_barrier_init): Likewise.
* sysdeps/unix/sysv/linux/hppa/pthread_cond_timedwait.c
(__pthread_cond_timedwait): Likewise.
* sysdeps/unix/sysv/linux/i386/putmsg.c (putmsg): Likewise.
* sysdeps/unix/sysv/linux/s390/semtimedop.c (semtimedop):
Likewise.
* sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Likewise.
* sysdeps/unix/sysv/linux/timer_settime.c (timer_settime):
Likewise.
* sysvipc/semtimedop.c (semtimedop): Likewise.
* time/setitimer.c (__setitimer): Likewise.
* time/strftime_l.c (emacs_strftime): Likewise.

2015-10-19 Mike Frysinger <vapier@gentoo.org>

* config.make.in (have-ssp): Delete.
Expand Down
6 changes: 2 additions & 4 deletions crypt/crypt-entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ extern struct crypt_data _ufc_foobar;
*/

char *
__crypt_r (key, salt, data)
const char *key;
const char *salt;
struct crypt_data * __restrict data;
__crypt_r (const char *key, const char *salt,
struct crypt_data * __restrict data)
{
ufc_long res[4];
char ktab[9];
Expand Down
6 changes: 2 additions & 4 deletions crypt/crypt_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,10 +797,8 @@ _ufc_output_conversion_r(v1, v2, salt, __data)
*/

void
__encrypt_r(__block, __edflag, __data)
char *__block;
int __edflag;
struct crypt_data * __restrict __data;
__encrypt_r (char *__block, int __edflag,
struct crypt_data * __restrict __data)
{
ufc_long l1, l2, r1, r2, res[4];
int i;
Expand Down
8 changes: 2 additions & 6 deletions libio/genops.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,12 +596,8 @@ _IO_old_init (_IO_FILE *fp, int flags)
}

void
_IO_no_init (fp, flags, orientation, wd, jmp)
_IO_FILE *fp;
int flags;
int orientation;
struct _IO_wide_data *wd;
const struct _IO_jump_t *jmp;
_IO_no_init (_IO_FILE *fp, int flags, int orientation,
struct _IO_wide_data *wd, const struct _IO_jump_t *jmp)
{
_IO_old_init (fp, flags);
fp->_mode = orientation;
Expand Down
12 changes: 4 additions & 8 deletions libio/iofopncook.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,8 @@ _IO_cookie_init (struct _IO_cookie_file *cfile, int read_write,


_IO_FILE *
_IO_fopencookie (cookie, mode, io_functions)
void *cookie;
const char *mode;
_IO_cookie_io_functions_t io_functions;
_IO_fopencookie (void *cookie, const char *mode,
_IO_cookie_io_functions_t io_functions)
{
int read_write;
struct locked_FILE
Expand Down Expand Up @@ -244,10 +242,8 @@ static const struct _IO_jump_t _IO_old_cookie_jumps = {

_IO_FILE *
attribute_compat_text_section
_IO_old_fopencookie (cookie, mode, io_functions)
void *cookie;
const char *mode;
_IO_cookie_io_functions_t io_functions;
_IO_old_fopencookie (void *cookie, const char *mode,
_IO_cookie_io_functions_t io_functions)
{
_IO_FILE *ret;

Expand Down
7 changes: 2 additions & 5 deletions libio/iofwrite_u.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@
#undef fwrite_unlocked

_IO_size_t
fwrite_unlocked (buf, size, count, fp)
const void *buf;
_IO_size_t size;
_IO_size_t count;
_IO_FILE *fp;
fwrite_unlocked (const void *buf, _IO_size_t size, _IO_size_t count,
_IO_FILE *fp)
{
_IO_size_t request = size * count;
_IO_size_t written = 0;
Expand Down
17 changes: 4 additions & 13 deletions libio/iogetline.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,8 @@
#include <string.h>

_IO_size_t
_IO_getline (fp, buf, n, delim, extract_delim)
_IO_FILE *fp;
char *buf;
_IO_size_t n;
int delim;
int extract_delim;
_IO_getline (_IO_FILE *fp, char *buf, _IO_size_t n, int delim,
int extract_delim)
{
return _IO_getline_info (fp, buf, n, delim, extract_delim, (int *) 0);
}
Expand All @@ -48,13 +44,8 @@ libc_hidden_def (_IO_getline)
If extract_delim > 0, insert delim in output. */

_IO_size_t
_IO_getline_info (fp, buf, n, delim, extract_delim, eof)
_IO_FILE *fp;
char *buf;
_IO_size_t n;
int delim;
int extract_delim;
int *eof;
_IO_getline_info (_IO_FILE *fp, char *buf, _IO_size_t n, int delim,
int extract_delim, int *eof)
{
char *ptr = buf;
if (eof != NULL)
Expand Down
17 changes: 4 additions & 13 deletions libio/iogetwline.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@
#endif

_IO_size_t
_IO_getwline (fp, buf, n, delim, extract_delim)
_IO_FILE *fp;
wchar_t *buf;
_IO_size_t n;
wint_t delim;
int extract_delim;
_IO_getwline (_IO_FILE *fp, wchar_t *buf, _IO_size_t n, wint_t delim,
int extract_delim)
{
return _IO_getwline_info (fp, buf, n, delim, extract_delim, (wint_t *) 0);
}
Expand All @@ -52,13 +48,8 @@ _IO_getwline (fp, buf, n, delim, extract_delim)
If extract_delim > 0, insert delim in output. */

_IO_size_t
_IO_getwline_info (fp, buf, n, delim, extract_delim, eof)
_IO_FILE *fp;
wchar_t *buf;
_IO_size_t n;
wint_t delim;
int extract_delim;
wint_t *eof;
_IO_getwline_info (_IO_FILE *fp, wchar_t *buf, _IO_size_t n, wint_t delim,
int extract_delim, wint_t *eof)
{
wchar_t *ptr = buf;
if (eof != NULL)
Expand Down
7 changes: 2 additions & 5 deletions libio/vsnprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ const struct _IO_jump_t _IO_strn_jumps attribute_hidden =


int
_IO_vsnprintf (string, maxlen, format, args)
char *string;
_IO_size_t maxlen;
const char *format;
_IO_va_list args;
_IO_vsnprintf (char *string, _IO_size_t maxlen, const char *format,
_IO_va_list args)
{
_IO_strnfile sf;
int ret;
Expand Down
7 changes: 2 additions & 5 deletions libio/vswprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,8 @@ const struct _IO_jump_t _IO_wstrn_jumps attribute_hidden =


int
_IO_vswprintf (string, maxlen, format, args)
wchar_t *string;
_IO_size_t maxlen;
const wchar_t *format;
_IO_va_list args;
_IO_vswprintf (wchar_t *string, _IO_size_t maxlen, const wchar_t *format,
_IO_va_list args)
{
_IO_wstrnfile sf;
int ret;
Expand Down
31 changes: 8 additions & 23 deletions locale/programs/simple-hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,8 @@ insert_entry (hash_table *htab, const void *key, size_t keylen, void *data)
}

static void
insert_entry_2 (htab, key, keylen, hval, idx, data)
hash_table *htab;
const void *key;
size_t keylen;
unsigned long int hval;
size_t idx;
void *data;
insert_entry_2 (hash_table *htab, const void *key, size_t keylen,
unsigned long int hval, size_t idx, void *data)
{
hash_entry *table = (hash_entry *) htab->table;

Expand Down Expand Up @@ -169,11 +164,8 @@ insert_entry_2 (htab, key, keylen, hval, idx, data)


int
find_entry (htab, key, keylen, result)
const hash_table *htab;
const void *key;
size_t keylen;
void **result;
find_entry (const hash_table *htab, const void *key, size_t keylen,
void **result)
{
hash_entry *table = (hash_entry *) htab->table;
size_t idx = lookup (htab, key, keylen, compute_hashval (key, keylen));
Expand Down Expand Up @@ -201,12 +193,8 @@ set_entry (hash_table *htab, const void *key, size_t keylen, void *newval)


int
iterate_table (htab, ptr, key, keylen, data)
const hash_table *htab;
void **ptr;
const void **key;
size_t *keylen;
void **data;
iterate_table (const hash_table *htab, void **ptr, const void **key,
size_t *keylen, void **data)
{
if (*ptr == NULL)
{
Expand All @@ -233,11 +221,8 @@ iterate_table (htab, ptr, key, keylen, data)
[Knuth] The Art of Computer Programming, part3 (6.4) */

static size_t
lookup (htab, key, keylen, hval)
const hash_table *htab;
const void *key;
size_t keylen;
unsigned long int hval;
lookup (const hash_table *htab, const void *key, size_t keylen,
unsigned long int hval)
{
unsigned long int hash;
size_t idx;
Expand Down
7 changes: 2 additions & 5 deletions login/forkpty.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@
#include <pty.h>

int
forkpty (amaster, name, termp, winp)
int *amaster;
char *name;
const struct termios *termp;
const struct winsize *winp;
forkpty (int *amaster, char *name, const struct termios *termp,
const struct winsize *winp)
{
int master, slave, pid;

Expand Down
7 changes: 2 additions & 5 deletions misc/hsearch_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,8 @@ weak_alias (__hdestroy_r, hdestroy_r)
equality of the stored and the parameter value. This helps to prevent
unnecessary expensive calls of strcmp. */
int
__hsearch_r (item, action, retval, htab)
ENTRY item;
ACTION action;
ENTRY **retval;
struct hsearch_data *htab;
__hsearch_r (ENTRY item, ACTION action, ENTRY **retval,
struct hsearch_data *htab)
{
unsigned int hval;
unsigned int count;
Expand Down
8 changes: 2 additions & 6 deletions misc/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@
after waiting the interval specified therein. Returns the number of ready
descriptors, or -1 for errors. */
int
__select (nfds, readfds, writefds, exceptfds, timeout)
int nfds;
fd_set *readfds;
fd_set *writefds;
fd_set *exceptfds;
struct timeval *timeout;
__select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
struct timeval *timeout)
{
__set_errno (ENOSYS);
return -1;
Expand Down
5 changes: 2 additions & 3 deletions nptl/cleanup_defer_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ strong_alias (_pthread_cleanup_push_defer, __pthread_cleanup_push_defer)


void
_pthread_cleanup_pop_restore (buffer, execute)
struct _pthread_cleanup_buffer *buffer;
int execute;
_pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer,
int execute)
{
struct pthread *self = THREAD_SELF;

Expand Down
5 changes: 2 additions & 3 deletions nptl/old_pthread_cond_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@

#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
int
__pthread_cond_init_2_0 (cond, cond_attr)
pthread_cond_2_0_t *cond;
const pthread_condattr_t *cond_attr;
__pthread_cond_init_2_0 (pthread_cond_2_0_t *cond,
const pthread_condattr_t *cond_attr)
{
struct pthread_condattr *icond_attr = (struct pthread_condattr *) cond_attr;

Expand Down
Loading

0 comments on commit f63f2bf

Please sign in to comment.