1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

Remove use of INTDEF/INTUSE in libio

This commit is contained in:
Andreas Schwab
2012-05-23 13:33:15 +02:00
parent c14874927b
commit d18ea0c5e6
98 changed files with 801 additions and 729 deletions

View File

@ -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
@ -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)

View File

@ -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
@ -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)

View File

@ -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
@ -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;
}

View File

@ -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
@ -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;
}

View File

@ -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
@ -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;

View File

@ -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.
@ -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

View File

@ -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
@ -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);

View File

@ -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
@ -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;
@ -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);

View File

@ -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
@ -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';

View File

@ -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
@ -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),
@ -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;