You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

421 lines
11 KiB

commit 24b9788285effddba3d52f174d483583cf820d19
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Thu Dec 4 08:45:55 2014 +0530
Fix up function definition style
Don't use K&R style for function definitions.
Conflicts:
libio/fileops.c
Due to vtable hardening in glibc-rh1398413.patch.
diff --git a/libio/fileops.c b/libio/fileops.c
index ae56437168efc524..29aec8265a0317f6 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -139,8 +139,7 @@ extern struct __gconv_trans_data __libio_translit attribute_hidden;
void
-_IO_new_file_init_internal (fp)
- struct _IO_FILE_plus *fp;
+_IO_new_file_init_internal (struct _IO_FILE_plus *fp)
{
/* POSIX.1 allows another file handle to be used to change the position
of our file descriptor. Hence we actually don't know the actual
@@ -162,8 +161,7 @@ _IO_new_file_init (struct _IO_FILE_plus *fp)
}
int
-_IO_new_file_close_it (fp)
- _IO_FILE *fp;
+_IO_new_file_close_it (_IO_FILE *fp)
{
int write_status;
if (!_IO_file_is_open (fp))
@@ -205,9 +203,7 @@ _IO_new_file_close_it (fp)
libc_hidden_ver (_IO_new_file_close_it, _IO_file_close_it)
void
-_IO_new_file_finish (fp, dummy)
- _IO_FILE *fp;
- int dummy;
+_IO_new_file_finish (_IO_FILE *fp, int dummy)
{
if (_IO_file_is_open (fp))
{
@@ -220,13 +216,8 @@ _IO_new_file_finish (fp, dummy)
libc_hidden_ver (_IO_new_file_finish, _IO_file_finish)
_IO_FILE *
-_IO_file_open (fp, filename, posix_mode, prot, read_write, is32not64)
- _IO_FILE *fp;
- const char *filename;
- int posix_mode;
- int prot;
- int read_write;
- int is32not64;
+_IO_file_open (_IO_FILE *fp, const char *filename, int posix_mode, int prot,
+ int read_write, int is32not64)
{
int fdesc;
#ifdef _LIBC
@@ -260,11 +251,8 @@ _IO_file_open (fp, filename, posix_mode, prot, read_write, is32not64)
libc_hidden_def (_IO_file_open)
_IO_FILE *
-_IO_new_file_fopen (fp, filename, mode, is32not64)
- _IO_FILE *fp;
- const char *filename;
- const char *mode;
- int is32not64;
+_IO_new_file_fopen (_IO_FILE *fp, const char *filename, const char *mode,
+ int is32not64)
{
int oflags = 0, omode;
int read_write;
@@ -439,9 +427,7 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
libc_hidden_ver (_IO_new_file_fopen, _IO_file_fopen)
_IO_FILE *
-_IO_new_file_attach (fp, fd)
- _IO_FILE *fp;
- int fd;
+_IO_new_file_attach (_IO_FILE *fp, int fd)
{
if (_IO_file_is_open (fp))
return NULL;
@@ -461,10 +447,7 @@ _IO_new_file_attach (fp, fd)
libc_hidden_ver (_IO_new_file_attach, _IO_file_attach)
_IO_FILE *
-_IO_new_file_setbuf (fp, p, len)
- _IO_FILE *fp;
- char *p;
- _IO_ssize_t len;
+_IO_new_file_setbuf (_IO_FILE *fp, char *p, _IO_ssize_t len)
{
if (_IO_default_setbuf (fp, p, len) == NULL)
return NULL;
@@ -479,10 +462,7 @@ libc_hidden_ver (_IO_new_file_setbuf, _IO_file_setbuf)
_IO_FILE *
-_IO_file_setbuf_mmap (fp, p, len)
- _IO_FILE *fp;
- char *p;
- _IO_ssize_t len;
+_IO_file_setbuf_mmap (_IO_FILE *fp, char *p, _IO_ssize_t len)
{
_IO_FILE *result;
@@ -509,10 +489,7 @@ static _IO_size_t new_do_write (_IO_FILE *, const char *, _IO_size_t);
Then mark FP as having empty buffers. */
int
-_IO_new_do_write (fp, data, to_do)
- _IO_FILE *fp;
- const char *data;
- _IO_size_t to_do;
+_IO_new_do_write (_IO_FILE *fp, const char *data, _IO_size_t to_do)
{
return (to_do == 0
|| (_IO_size_t) new_do_write (fp, data, to_do) == to_do) ? 0 : EOF;
@@ -521,10 +498,7 @@ libc_hidden_ver (_IO_new_do_write, _IO_do_write)
static
_IO_size_t
-new_do_write (fp, data, to_do)
- _IO_FILE *fp;
- const char *data;
- _IO_size_t to_do;
+new_do_write (_IO_FILE *fp, const char *data, _IO_size_t to_do)
{
_IO_size_t count;
if (fp->_flags & _IO_IS_APPENDING)
@@ -554,8 +528,7 @@ new_do_write (fp, data, to_do)
}
int
-_IO_new_file_underflow (fp)
- _IO_FILE *fp;
+_IO_new_file_underflow (_IO_FILE *fp)
{
_IO_ssize_t count;
#if 0
@@ -825,9 +798,7 @@ _IO_file_underflow_maybe_mmap (_IO_FILE *fp)
int
-_IO_new_file_overflow (f, ch)
- _IO_FILE *f;
- int ch;
+_IO_new_file_overflow (_IO_FILE *f, int ch)
{
if (f->_flags & _IO_NO_WRITES) /* SET ERROR */
{
@@ -888,8 +859,7 @@ _IO_new_file_overflow (f, ch)
libc_hidden_ver (_IO_new_file_overflow, _IO_file_overflow)
int
-_IO_new_file_sync (fp)
- _IO_FILE *fp;
+_IO_new_file_sync (_IO_FILE *fp)
{
_IO_ssize_t delta;
int retval = 0;
@@ -1007,11 +977,7 @@ do_ftell (_IO_FILE *fp)
}
_IO_off64_t
-_IO_new_file_seekoff (fp, offset, dir, mode)
- _IO_FILE *fp;
- _IO_off64_t offset;
- int dir;
- int mode;
+_IO_new_file_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
{
_IO_off64_t result;
_IO_off64_t delta, new_offset;
@@ -1167,11 +1133,7 @@ resync:
libc_hidden_ver (_IO_new_file_seekoff, _IO_file_seekoff)
_IO_off64_t
-_IO_file_seekoff_mmap (fp, offset, dir, mode)
- _IO_FILE *fp;
- _IO_off64_t offset;
- int dir;
- int mode;
+_IO_file_seekoff_mmap (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
{
_IO_off64_t result;
@@ -1242,10 +1204,7 @@ _IO_file_seekoff_maybe_mmap (_IO_FILE *fp, _IO_off64_t offset, int dir,
}
_IO_ssize_t
-_IO_file_read (fp, buf, size)
- _IO_FILE *fp;
- void *buf;
- _IO_ssize_t size;
+_IO_file_read (_IO_FILE *fp, void *buf, _IO_ssize_t size)
{
return (__builtin_expect (fp->_flags2 & _IO_FLAGS2_NOTCANCEL, 0)
? read_not_cancel (fp->_fileno, buf, size)
@@ -1254,27 +1213,21 @@ _IO_file_read (fp, buf, size)
libc_hidden_def (_IO_file_read)
_IO_off64_t
-_IO_file_seek (fp, offset, dir)
- _IO_FILE *fp;
- _IO_off64_t offset;
- int dir;
+_IO_file_seek (_IO_FILE *fp, _IO_off64_t offset, int dir)
{
return __lseek64 (fp->_fileno, offset, dir);
}
libc_hidden_def (_IO_file_seek)
int
-_IO_file_stat (fp, st)
- _IO_FILE *fp;
- void *st;
+_IO_file_stat (_IO_FILE *fp, void *st)
{
return __fxstat64 (_STAT_VER, fp->_fileno, (struct stat64 *) st);
}
libc_hidden_def (_IO_file_stat)
int
-_IO_file_close_mmap (fp)
- _IO_FILE *fp;
+_IO_file_close_mmap (_IO_FILE *fp)
{
/* In addition to closing the file descriptor we have to unmap the file. */
(void) __munmap (fp->_IO_buf_base, fp->_IO_buf_end - fp->_IO_buf_base);
@@ -1285,8 +1238,7 @@ _IO_file_close_mmap (fp)
}
int
-_IO_file_close (fp)
- _IO_FILE *fp;
+_IO_file_close (_IO_FILE *fp)
{
/* Cancelling close should be avoided if possible since it leaves an
unrecoverable state behind. */
@@ -1295,10 +1247,7 @@ _IO_file_close (fp)
libc_hidden_def (_IO_file_close)
_IO_ssize_t
-_IO_new_file_write (f, data, n)
- _IO_FILE *f;
- const void *data;
- _IO_ssize_t n;
+_IO_new_file_write (_IO_FILE *f, const void *data, _IO_ssize_t n)
{
_IO_ssize_t to_do = n;
while (to_do > 0)
@@ -1322,10 +1271,7 @@ _IO_new_file_write (f, data, n)
}
_IO_size_t
-_IO_new_file_xsputn (f, data, n)
- _IO_FILE *f;
- const void *data;
- _IO_size_t n;
+_IO_new_file_xsputn (_IO_FILE *f, const void *data, _IO_size_t n)
{
const char *s = (const char *) data;
_IO_size_t to_do = n;
@@ -1405,10 +1351,7 @@ _IO_new_file_xsputn (f, data, n)
libc_hidden_ver (_IO_new_file_xsputn, _IO_file_xsputn)
_IO_size_t
-_IO_file_xsgetn (fp, data, n)
- _IO_FILE *fp;
- void *data;
- _IO_size_t n;
+_IO_file_xsgetn (_IO_FILE *fp, void *data, _IO_size_t n)
{
_IO_size_t want, have;
_IO_ssize_t count;
@@ -1505,12 +1448,8 @@ _IO_file_xsgetn (fp, data, n)
}
libc_hidden_def (_IO_file_xsgetn)
-static _IO_size_t _IO_file_xsgetn_mmap (_IO_FILE *, void *, _IO_size_t);
static _IO_size_t
-_IO_file_xsgetn_mmap (fp, data, n)
- _IO_FILE *fp;
- void *data;
- _IO_size_t n;
+_IO_file_xsgetn_mmap (_IO_FILE *fp, void *data, _IO_size_t n)
{
_IO_size_t have;
char *read_ptr = fp->_IO_read_ptr;
@@ -1564,12 +1503,8 @@ _IO_file_xsgetn_mmap (fp, data, n)
return s - (char *) data;
}
-static _IO_size_t _IO_file_xsgetn_maybe_mmap (_IO_FILE *, void *, _IO_size_t);
static _IO_size_t
-_IO_file_xsgetn_maybe_mmap (fp, data, n)
- _IO_FILE *fp;
- void *data;
- _IO_size_t n;
+_IO_file_xsgetn_maybe_mmap (_IO_FILE *fp, void *data, _IO_size_t n)
{
/* We only get here if this is the first attempt to read something.
Decide which operations to use and then punt to the chosen one. */
diff --git a/libio/iofopen.c b/libio/iofopen.c
index 44ba253e072ef18d..9262038a57b96215 100644
--- a/libio/iofopen.c
+++ b/libio/iofopen.c
@@ -35,8 +35,7 @@
#endif
_IO_FILE *
-__fopen_maybe_mmap (fp)
- _IO_FILE *fp;
+__fopen_maybe_mmap (_IO_FILE *fp)
{
#ifdef _G_HAVE_MMAP
if ((fp->_flags2 & _IO_FLAGS2_MMAP) && (fp->_flags & _IO_NO_WRITES))
@@ -58,10 +57,7 @@ __fopen_maybe_mmap (fp)
_IO_FILE *
-__fopen_internal (filename, mode, is32)
- const char *filename;
- const char *mode;
- int is32;
+__fopen_internal (const char *filename, const char *mode, int is32)
{
struct locked_FILE
{
@@ -96,9 +92,7 @@ __fopen_internal (filename, mode, is32)
}
_IO_FILE *
-_IO_new_fopen (filename, mode)
- const char *filename;
- const char *mode;
+_IO_new_fopen (const char *filename, const char *mode)
{
return __fopen_internal (filename, mode, 1);
}
diff --git a/libio/wfileops.c b/libio/wfileops.c
index 5ed1a922ae6ccbd0..d26b6e9f0a769d0b 100644
--- a/libio/wfileops.c
+++ b/libio/wfileops.c
@@ -54,10 +54,7 @@
/* Convert TO_DO wide character from DATA to FP.
Then mark FP as having empty buffers. */
int
-_IO_wdo_write (fp, data, to_do)
- _IO_FILE *fp;
- const wchar_t *data;
- _IO_size_t to_do;
+_IO_wdo_write (_IO_FILE *fp, const wchar_t *data, _IO_size_t to_do)
{
struct _IO_codecvt *cc = fp->_codecvt;
@@ -116,8 +113,7 @@ libc_hidden_def (_IO_wdo_write)
wint_t
-_IO_wfile_underflow (fp)
- _IO_FILE *fp;
+_IO_wfile_underflow (_IO_FILE *fp)
{
struct _IO_codecvt *cd;
enum __codecvt_result status;
@@ -410,9 +406,7 @@ _IO_wfile_underflow_maybe_mmap (_IO_FILE *fp)
wint_t
-_IO_wfile_overflow (f, wch)
- _IO_FILE *f;
- wint_t wch;
+_IO_wfile_overflow (_IO_FILE *f, wint_t wch)
{
if (f->_flags & _IO_NO_WRITES) /* SET ERROR */
{
@@ -484,8 +478,7 @@ _IO_wfile_overflow (f, wch)
libc_hidden_def (_IO_wfile_overflow)
wint_t
-_IO_wfile_sync (fp)
- _IO_FILE *fp;
+_IO_wfile_sync (_IO_FILE *fp)
{
_IO_ssize_t delta;
wint_t retval = 0;
@@ -746,11 +739,7 @@ do_ftell_wide (_IO_FILE *fp)
}
_IO_off64_t
-_IO_wfile_seekoff (fp, offset, dir, mode)
- _IO_FILE *fp;
- _IO_off64_t offset;
- int dir;
- int mode;
+_IO_wfile_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
{
_IO_off64_t result;
_IO_off64_t delta, new_offset;
@@ -961,10 +950,7 @@ libc_hidden_def (_IO_wfile_seekoff)
_IO_size_t
-_IO_wfile_xsputn (f, data, n)
- _IO_FILE *f;
- const void *data;
- _IO_size_t n;
+_IO_wfile_xsputn (_IO_FILE *f, const void *data, _IO_size_t n)
{
const wchar_t *s = (const wchar_t *) data;
_IO_size_t to_do = n;