Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove use of INTDEF/INTUSE in libio
  • Loading branch information
Andreas Schwab committed May 24, 2012
1 parent c148749 commit d18ea0c
Show file tree
Hide file tree
Showing 98 changed files with 801 additions and 729 deletions.
168 changes: 168 additions & 0 deletions ChangeLog
@@ -1,3 +1,171 @@
2012-05-24 Andreas Schwab <schwab@linux-m68k.org>

[BZ #14132]
* include/libio.h (_IO_free_backup_area, _IO_free_wbackup_area)
(_IO_padn, _IO_putc, _IO_sgetn, _IO_vfprintf, _IO_vfscanf):
Declare hidden proto.
* include/stdio.h (__asprintf_internal): Don't declare.
(__asprintf): Don't define as macro. Declare hidden proto.
* include/stdio_ext.h (__fsetlocking_internal): Don't declare.
(__fsetlocking): Declare hidden proto.
* libio/iolibio.h (_IO_fdopen, _IO_fflush, _IO_ftell, _IO_fread)
(_IO_fwrite, _IO_setbuffer, _IO_setvbuf, _IO_vsprintf): Declare
hidden proto.
(_IO_vprintf, _IO_freopen, _IO_freopen64, _IO_setbuf)
(_IO_setlinebuf): Remove use of INTUSE.
(_IO_setbuffer_internal, _IO_fread_internal, _IO_fdopen_internal)
(_IO_vsprintf_internal, _IO_fflush_internal, _IO_fwrite_internal)
(_IO_ftell_internal, _IO_fputs_internal, _IO_setvbuf_internal):
Remove declaration.
* libio/libioP.h (INTUSE, INTDEF, INTDEF2): Don't define.
(_IO_do_flush): Remove use of INTUSE.
(_IO_switch_to_get_mode, _IO_init, _IO_sputbackc, _IO_un_link)
(_IO_link_in, _IO_doallocbuf, _IO_unsave_markers, _IO_setb)
(_IO_adjust_column, _IO_least_wmarker)
(_IO_switch_to_main_wget_area, _IO_switch_to_wbackup_area)
(_IO_switch_to_wget_mode, _IO_wsetb, _IO_sputbackwc)
(_IO_wdoallocbuf, _IO_default_uflow, _IO_wdefault_uflow)
(_IO_default_doallocate, _IO_wdefault_doallocate)
(_IO_default_finish, _IO_wdefault_finish, _IO_default_pbackfail)
(_IO_wdefault_pbackfail, _IO_default_xsputn, _IO_wdefault_xsputn)
(_IO_default_xsgetn, _IO_wdefault_xsgetn, _IO_do_write)
(_IO_wdo_write, _IO_flush_all, _IO_flush_all_linebuffered)
(_IO_file_doallocate, _IO_file_setbuf, _IO_file_seekoff)
(_IO_file_xsputn, _IO_file_xsgetn, _IO_file_stat, _IO_file_close)
(_IO_file_underflow, _IO_file_overflow, _IO_file_init)
(_IO_file_attach, _IO_file_fopen, _IO_file_read, _IO_file_sync)
(_IO_file_close_it, _IO_file_seek, _IO_file_finish)
(_IO_wfile_xsputn, _IO_wfile_sync, _IO_wfile_underflow)
(_IO_wfile_overflow, _IO_wfile_seekoff, _IO_str_underflow)
(_IO_str_overflow, _IO_str_pbackfail, _IO_str_seekoff)
(_IO_getline, _IO_getline_info, _IO_list_all): Declare hidden
proto.
(_IO_flush_all_internal, _IO_adjust_column_internal)
(_IO_default_uflow_internal, _IO_default_finish_internal)
(_IO_default_pbackfail_internal, _IO_default_xsputn_internal)
(_IO_default_xsgetn_internal, _IO_default_doallocate_internal)
(_IO_wdefault_finish_internal, _IO_wdefault_pbackfail_internal)
(_IO_wdefault_xsputn_internal, _IO_wdefault_xsgetn_internal)
(_IO_wdefault_doallocate_internal, _IO_wdefault_uflow_internal)
(_IO_file_doallocate_internal, _IO_file_setbuf_internal)
(_IO_file_seekoff_internal, _IO_file_xsputn_internal)
(_IO_file_xsgetn_internal, _IO_file_stat_internal)
(_IO_file_close_internal, _IO_file_close_it_internal)
(_IO_file_underflow_internal, _IO_file_overflow_internal)
(_IO_file_init_internal, _IO_file_attach_internal)
(_IO_file_fopen_internal, _IO_file_read_internal)
(_IO_file_sync_internal, _IO_file_seek_internal)
(_IO_file_finish_internal, _IO_wfile_xsputn_internal)
(_IO_wfile_seekoff_internal, _IO_wfile_sync_internal)
(_IO_str_underflow_internal, _IO_str_overflow_internal)
(_IO_str_pbackfail_internal, _IO_str_seekoff_internal)
(_IO_file_jumps_internal, _IO_wfile_jumps_internal)
(_IO_list_all_internal, _IO_link_in_internal)
(_IO_sputbackc_internal, _IO_wdoallocbuf_internal)
(_IO_sgetn_internal, _IO_flush_all_linebuffered_internal)
(_IO_switch_to_wget_mode_internal, _IO_unsave_markers_internal)
(_IO_switch_to_main_wget_area_internal, _IO_wdo_write_internal)
(_IO_do_write_internal, _IO_padn_internal)
(_IO_getline_info_internal, _IO_getline_internal)
(_IO_free_wbackup_area_internal, _IO_free_backup_area_internal)
(_IO_switch_to_wbackup_area_internal, _IO_setb_internal)
(_IO_sputbackwc_internal, _IO_switch_to_get_mode_internal)
(_IO_vfscanf_internal, _IO_vfprintf_internal)
(_IO_doallocbuf_internal, _IO_wsetb_internal, _IO_putc_internal)
(_IO_init_internal, _IO_un_link_internal): Don't declare.
* libio/fileops.c: Replace INTDEF with libc_hidden_def and INTDEF2
with libc_hidden_ver, remove use of INTUSE.
* libio/genops.c: Likewise.
* libio/freopen.c: Likewise.
* libio/freopen64.c: Likewise.
* libio/iofclose.c: Likewise.
* libio/iofdopen.c: Likewise.
* libio/iofflush.c: Likewise.
* libio/iofflush_u.c: Likewise.
* libio/iofgets.c: Likewise.
* libio/iofgets_u.c: Likewise.
* libio/iofopen.c: Likewise.
* libio/iofopncook.c: Likewise.
* libio/iofread.c: Likewise.
* libio/iofread_u.c: Likewise.
* libio/ioftell.c: Likewise.
* libio/iofwrite.c: Likewise.
* libio/iogetline.c: Likewise.
* libio/iogets.c: Likewise.
* libio/iogetwline.c: Likewise.
* libio/iopadn.c: Likewise.
* libio/iopopen.c: Likewise.
* libio/ioseekoff.c: Likewise.
* libio/ioseekpos.c: Likewise.
* libio/iosetbuffer.c: Likewise.
* libio/iosetvbuf.c: Likewise.
* libio/ioungetc.c: Likewise.
* libio/ioungetwc.c: Likewise.
* libio/iovdprintf.c: Likewise.
* libio/iovsprintf.c: Likewise.
* libio/iovsscanf.c: Likewise.
* libio/memstream.c: Likewise.
* libio/obprintf.c: Likewise.
* libio/oldfileops.c: Likewise.
* libio/oldiofclose.c: Likewise.
* libio/oldiofdopen.c: Likewise.
* libio/oldiofopen.c: Likewise.
* libio/oldiopopen.c: Likewise.
* libio/oldstdfiles.c: Likewise.
* libio/putc.c: Likewise.
* libio/setbuf.c: Likewise.
* libio/setlinebuf.c: Likewise.
* libio/stdfiles.c: Likewise.
* libio/strops.c: Likewise.
* libio/vasprintf.c: Likewise.
* libio/vscanf.c: Likewise.
* libio/vsnprintf.c: Likewise.
* libio/vswprintf.c: Likewise.
* libio/wfiledoalloc.c: Likewise.
* libio/wfileops.c: Likewise.
* libio/wgenops.c: Likewise.
* libio/wmemstream.c: Likewise.
* libio/wstrops.c: Likewise.
* libio/__fpurge.c: Likewise.
* libio/__fsetlocking.c: Likewise.
* assert/assert.c: Likewise.
* debug/fgets_chk.c: Likewise.
* debug/fgets_u_chk.c: Likewise.
* debug/fread_chk.c: Likewise.
* debug/fread_u_chk.c: Likewise.
* debug/gets_chk.c: Likewise.
* debug/obprintf_chk.c: Likewise.
* debug/vasprintf_chk.c: Likewise.
* debug/vdprintf_chk.c: Likewise.
* debug/vsnprintf_chk.c: Likewise.
* debug/vsprintf_chk.c: Likewise.
* malloc/mtrace.c: Likewise.
* misc/error.c: Likewise.
* misc/syslog.c: Likewise.
* stdio-common/asprintf.c: Likewise.
* stdio-common/fxprintf.c: Likewise.
* stdio-common/getw.c: Likewise.
* stdio-common/isoc99_fscanf.c: Likewise.
* stdio-common/isoc99_scanf.c: Likewise.
* stdio-common/isoc99_vfscanf.c: Likewise.
* stdio-common/isoc99_vscanf.c: Likewise.
* stdio-common/isoc99_vsscanf.c: Likewise.
* stdio-common/printf-prs.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
* stdio-common/printf_fphex.c: Likewise.
* stdio-common/printf_size.c: Likewise.
* stdio-common/putw.c: Likewise.
* stdio-common/scanf.c: Likewise.
* stdio-common/sprintf.c: Likewise.
* stdio-common/tmpfile.c: Likewise.
* stdio-common/vfprintf.c: Likewise.
* stdio-common/vfscanf.c: Likewise.
* stdlib/strfmon_l.c: Likewise.
* sunrpc/openchild.c: Likewise.
* sunrpc/xdr_stdio.c: Likewise.
* sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Likewise.
* sysdeps/mach/hurd/tmpfile.c: Likewise.

2012-05-24 Roland McGrath <roland@hack.frob.com>

* sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list: New file.
Expand Down
5 changes: 2 additions & 3 deletions assert/assert.c
@@ -1,5 +1,4 @@
/* Copyright (C) 1991,1994-1996,1998,2001,2002,2005,2009,2011
Free Software Foundation, Inc.
/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -31,7 +30,7 @@ extern const char *__progname;

#include <wchar.h>
#include <libio/iolibio.h>
#define fflush(s) INTUSE(_IO_fflush) (s)
#define fflush(s) _IO_fflush (s)

/* This function, when passed a string containing an asserted
expression, a filename, and a line number, prints a message
Expand Down
5 changes: 2 additions & 3 deletions debug/fgets_chk.c
@@ -1,5 +1,4 @@
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2005
Free Software Foundation, Inc.
/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -47,7 +46,7 @@ __fgets_chk (buf, size, n, fp)
case. We return an error only when there is a new error. */
int old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
fp->_IO_file_flags &= ~_IO_ERR_SEEN;
count = INTUSE(_IO_getline) (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
count = _IO_getline (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
/* If we read in some bytes and errno is EAGAIN, that error will
be reported for next read. */
if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
Expand Down
5 changes: 2 additions & 3 deletions debug/fgets_u_chk.c
@@ -1,5 +1,4 @@
/* Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2005
Free Software Foundation, Inc.
/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -46,7 +45,7 @@ __fgets_unlocked_chk (buf, size, n, fp)
case. We return an error only when there is a new error. */
int old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
fp->_IO_file_flags &= ~_IO_ERR_SEEN;
count = INTUSE(_IO_getline) (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
count = _IO_getline (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
/* If we read in some bytes and errno is EAGAIN, that error will
be reported for next read. */
if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
Expand Down
5 changes: 2 additions & 3 deletions debug/fread_chk.c
@@ -1,5 +1,4 @@
/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2002, 2003, 2007
Free Software Foundation, Inc.
/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -49,7 +48,7 @@ __fread_chk (void *__restrict ptr, size_t ptrlen,

size_t bytes_read;
_IO_acquire_lock (stream);
bytes_read = INTUSE(_IO_sgetn) (stream, (char *) ptr, bytes_requested);
bytes_read = _IO_sgetn (stream, (char *) ptr, bytes_requested);
_IO_release_lock (stream);
return bytes_requested == bytes_read ? n : bytes_read / size;
}
6 changes: 2 additions & 4 deletions debug/fread_u_chk.c
@@ -1,5 +1,4 @@
/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2002, 2003, 2007
Free Software Foundation, Inc.
/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -47,7 +46,6 @@ __fread_unlocked_chk (void *__restrict ptr, size_t ptrlen,
if (bytes_requested == 0)
return 0;

size_t bytes_read
= INTUSE(_IO_sgetn) (stream, (char *) ptr, bytes_requested);
size_t bytes_read = _IO_sgetn (stream, (char *) ptr, bytes_requested);
return bytes_requested == bytes_read ? n : bytes_read / size;
}
5 changes: 2 additions & 3 deletions debug/gets_chk.c
@@ -1,5 +1,4 @@
/* Copyright (C) 1993, 1996, 1997, 1998, 2002, 2003, 2004
Free Software Foundation, Inc.
/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -55,7 +54,7 @@ __gets_chk (char *buf, size_t size)
int old_error = _IO_stdin->_IO_file_flags & _IO_ERR_SEEN;
_IO_stdin->_IO_file_flags &= ~_IO_ERR_SEEN;
buf[0] = (char) ch;
count = INTUSE(_IO_getline) (_IO_stdin, buf + 1, size - 1, '\n', 0) + 1;
count = _IO_getline (_IO_stdin, buf + 1, size - 1, '\n', 0) + 1;
if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN)
{
retval = NULL;
Expand Down
5 changes: 2 additions & 3 deletions debug/obprintf_chk.c
@@ -1,6 +1,5 @@
/* Print output of stream to given obstack.
Copyright (C) 1996,1997,1999,2000,2001,2002,2003,2004,2005,2006,2008
Free Software Foundation, Inc.
Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
Expand Down Expand Up @@ -92,7 +91,7 @@ __obstack_vprintf_chk (struct obstack *obstack, int flags, const char *format,
if (flags > 0)
new_f.ofile.file.file._flags2 |= _IO_FLAGS2_FORTIFY;

result = INTUSE(_IO_vfprintf) (&new_f.ofile.file.file, format, args);
result = _IO_vfprintf (&new_f.ofile.file.file, format, args);

/* Shrink the buffer to the space we really currently need. */
obstack_blank_fast (obstack, (new_f.ofile.file.file._IO_write_ptr
Expand Down
5 changes: 2 additions & 3 deletions debug/vasprintf_chk.c
@@ -1,5 +1,4 @@
/* Copyright (C) 1995,1997,1999-2002,2004,2006,2008,2009
Free Software Foundation, Inc.
/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -64,7 +63,7 @@ __vasprintf_chk (char **result_ptr, int flags, const char *format,
if (flags > 0)
sf._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;

ret = INTUSE(_IO_vfprintf) (&sf._sbf._f, format, args);
ret = _IO_vfprintf (&sf._sbf._f, format, args);
if (ret < 0)
{
free (sf._sbf._f._IO_buf_base);
Expand Down
11 changes: 5 additions & 6 deletions debug/vdprintf_chk.c
@@ -1,5 +1,4 @@
/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006, 2008, 2010
Free Software Foundation, Inc.
/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -40,13 +39,13 @@ __vdprintf_chk (int d, int flags, const char *format, va_list arg)
#endif
_IO_no_init (&tmpfil.file, _IO_USER_LOCK, 0, &wd, &_IO_wfile_jumps);
_IO_JUMPS (&tmpfil) = &_IO_file_jumps;
INTUSE(_IO_file_init) (&tmpfil);
_IO_file_init (&tmpfil);
#if !_IO_UNIFIED_JUMPTABLES
tmpfil.vtable = NULL;
#endif
if (INTUSE(_IO_file_attach) (&tmpfil.file, d) == NULL)
if (_IO_file_attach (&tmpfil.file, d) == NULL)
{
INTUSE(_IO_un_link) (&tmpfil);
_IO_un_link (&tmpfil);
return EOF;
}
tmpfil.file._flags |= _IO_DELETE_DONT_CLOSE;
Expand All @@ -59,7 +58,7 @@ __vdprintf_chk (int d, int flags, const char *format, va_list arg)
if (flags > 0)
tmpfil.file._flags2 |= _IO_FLAGS2_FORTIFY;

done = INTUSE(_IO_vfprintf) (&tmpfil.file, format, arg);
done = _IO_vfprintf (&tmpfil.file, format, arg);

_IO_FINISH (&tmpfil.file);

Expand Down
5 changes: 2 additions & 3 deletions debug/vsnprintf_chk.c
@@ -1,5 +1,4 @@
/* Copyright (C) 1991, 1995, 1997, 1998, 2004, 2006, 2009
Free Software Foundation, Inc.
/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -61,7 +60,7 @@ ___vsnprintf_chk (char *s, size_t maxlen, int flags, size_t slen,
sf.f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;

_IO_str_init_static_internal (&sf.f, s, maxlen - 1, s);
ret = INTUSE(_IO_vfprintf) (&sf.f._sbf._f, format, args);
ret = _IO_vfprintf (&sf.f._sbf._f, format, args);

if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
*sf.f._sbf._f._IO_write_ptr = '\0';
Expand Down
19 changes: 9 additions & 10 deletions debug/vsprintf_chk.c
@@ -1,5 +1,4 @@
/* Copyright (C) 1994, 1997, 1999-2003, 2004, 2006, 2009
Free Software Foundation, Inc.
/* Copyright (C) 1994-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -40,16 +39,16 @@ static const struct _IO_jump_t _IO_str_chk_jumps =
JUMP_INIT_DUMMY,
JUMP_INIT(finish, _IO_str_finish),
JUMP_INIT(overflow, _IO_str_chk_overflow),
JUMP_INIT(underflow, INTUSE(_IO_str_underflow)),
JUMP_INIT(uflow, INTUSE(_IO_default_uflow)),
JUMP_INIT(pbackfail, INTUSE(_IO_str_pbackfail)),
JUMP_INIT(xsputn, INTUSE(_IO_default_xsputn)),
JUMP_INIT(xsgetn, INTUSE(_IO_default_xsgetn)),
JUMP_INIT(seekoff, INTUSE(_IO_str_seekoff)),
JUMP_INIT(underflow, _IO_str_underflow),
JUMP_INIT(uflow, _IO_default_uflow),
JUMP_INIT(pbackfail, _IO_str_pbackfail),
JUMP_INIT(xsputn, _IO_default_xsputn),
JUMP_INIT(xsgetn, _IO_default_xsgetn),
JUMP_INIT(seekoff, _IO_str_seekoff),
JUMP_INIT(seekpos, _IO_default_seekpos),
JUMP_INIT(setbuf, _IO_default_setbuf),
JUMP_INIT(sync, _IO_default_sync),
JUMP_INIT(doallocate, INTUSE(_IO_default_doallocate)),
JUMP_INIT(doallocate, _IO_default_doallocate),
JUMP_INIT(read, _IO_default_read),
JUMP_INIT(write, _IO_default_write),
JUMP_INIT(seek, _IO_default_seek),
Expand Down Expand Up @@ -83,7 +82,7 @@ ___vsprintf_chk (char *s, int flags, size_t slen, const char *format,
if (flags > 0)
f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;

ret = INTUSE(_IO_vfprintf) (&f._sbf._f, format, args);
ret = _IO_vfprintf (&f._sbf._f, format, args);

*f._sbf._f._IO_write_ptr = '\0';
return ret;
Expand Down

0 comments on commit d18ea0c

Please sign in to comment.