diff options
author | Zack Weinberg <zackw@panix.com> | 2018-02-21 14:38:24 -0500 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2018-02-21 14:39:54 -0500 |
commit | 30bfee2630b960050d1d50cafaab43fc171abc03 (patch) | |
tree | 0e07b4ca9b2e087edec24afe3bfa07b42f7cfdb2 /libio/genops.c | |
parent | df6c012b99499d95ed7fee53553a9f4d4473ccae (diff) | |
download | glibc-30bfee2630b960050d1d50cafaab43fc171abc03.tar.gz glibc-30bfee2630b960050d1d50cafaab43fc171abc03.tar.xz glibc-30bfee2630b960050d1d50cafaab43fc171abc03.zip |
Remove miscellaneous debris from libio.
This patch eliminates a number of #if 0 and #ifdef TODO blocks, macros that are never used, macros that provide portability to substrates that lack basic things like EINVAL and off_t, and other such debris. I preserved IO_DEBUG and CHECK_FILE, even though as far as I can tell IO_DEBUG is never defined and therefore CHECK_FILE never does anything, because it seems like we might actually want to turn it _on_. Installed stripped libraries and executables are unchanged, except, again, that the line number of an assertion changes (this time it's somewhere in fileops.c). * libio/libio.h (_IO_pos_BAD, _IO_pos_0, _IO_pos_adjust): Define here, unconditionally. * libio/iolibio.h (_IO_pos_BAD): Don't define here. * libio/libioP.h: Remove #if 0 blocks. (_IO_pos_BAD, _IO_pos_0, _IO_pos_adjust): Don't define here. (_IO_va_start, COERCE_FILE, MAYBE_SET_EINVAL): Don't define. (CHECK_FILE): Don't use MAYBE_SET_EINVAL or COERCE_FILE. Fix style. * libio/clearerr.c, libio/fputc.c, libio/getchar.c: Assume weak_alias is always defined. * libio/fileops.c, libio/genops.c, libio/oldfileops.c * libio/oldpclose.c, libio/pclose.c, libio/wfileops.c: Remove #if 0 and #ifdef TODO blocks. Assume text_set_element is always defined. * libio/iofdopen.c, libio/iogetdelim.c, libio/oldiofdopen.c Use __set_errno (EINVAL) instead of MAYBE_SET_EINVAL. * libio/tst-mmap-eofsync.c: Make #if 1 block unconditional.
Diffstat (limited to 'libio/genops.c')
-rw-r--r-- | libio/genops.c | 116 |
1 files changed, 2 insertions, 114 deletions
diff --git a/libio/genops.c b/libio/genops.c index 2b820c86d2..2fec221b99 100644 --- a/libio/genops.c +++ b/libio/genops.c @@ -194,24 +194,6 @@ _IO_free_backup_area (FILE *fp) } libc_hidden_def (_IO_free_backup_area) -#if 0 -int -_IO_switch_to_put_mode (FILE *fp) -{ - fp->_IO_write_base = fp->_IO_read_ptr; - fp->_IO_write_ptr = fp->_IO_read_ptr; - /* Following is wrong if line- or un-buffered? */ - fp->_IO_write_end = (fp->_flags & _IO_IN_BACKUP - ? fp->_IO_read_end : fp->_IO_buf_end); - - fp->_IO_read_ptr = fp->_IO_read_end; - fp->_IO_read_base = fp->_IO_read_end; - - fp->_flags |= _IO_CURRENTLY_PUTTING; - return 0; -} -#endif - int __overflow (FILE *f, int ch) { @@ -465,15 +447,6 @@ _IO_default_xsgetn (FILE *fp, void *data, size_t n) } libc_hidden_def (_IO_default_xsgetn) -#if 0 -/* Seems not to be needed. --drepper */ -int -_IO_sync (FILE *fp) -{ - return 0; -} -#endif - FILE * _IO_default_setbuf (FILE *fp, char *p, ssize_t len) { @@ -697,28 +670,6 @@ _IO_sungetc (FILE *fp) return result; } -#if 0 /* Work in progress */ -/* Seems not to be needed. */ -#if 0 -void -_IO_set_column (FILE *fp, int c) -{ - if (c == -1) - fp->_column = -1; - else - fp->_column = c - (fp->_IO_write_ptr - fp->_IO_write_base); -} -#else -int -_IO_set_column (FILE *fp, int i) -{ - fp->_cur_column = i + 1; - return 0; -} -#endif -#endif - - unsigned _IO_adjust_column (unsigned start, const char *line, int count) { @@ -730,20 +681,6 @@ _IO_adjust_column (unsigned start, const char *line, int count) } libc_hidden_def (_IO_adjust_column) -#if 0 -/* Seems not to be needed. --drepper */ -int -_IO_get_column (FILE *fp) -{ - if (fp->_cur_column) - return _IO_adjust_column (fp->_cur_column - 1, - fp->_IO_write_base, - fp->_IO_write_ptr - fp->_IO_write_base); - return -1; -} -#endif - - int _IO_flush_all_lockp (int do_lock) { @@ -964,10 +901,8 @@ _IO_remove_marker (struct _IO_marker *marker) return; } } -#if 0 - if _sbuf has a backup area that is no longer needed, should we delete - it now, or wait until the next underflow? -#endif + /* FIXME: if _sbuf has a backup area that is no longer needed, + should we delete it now, or wait until the next underflow? */ } #define BAD_DELTA EOF @@ -1018,20 +953,6 @@ _IO_unsave_markers (FILE *fp) struct _IO_marker *mark = fp->_markers; if (mark) { -#ifdef TODO - streampos offset = seekoff (0, ios::cur, ios::in); - if (offset != EOF) - { - offset += eGptr () - Gbase (); - for ( ; mark != NULL; mark = mark->_next) - mark->set_streampos (mark->_pos + offset); - } - else - { - for ( ; mark != NULL; mark = mark->_next) - mark->set_streampos (EOF); - } -#endif fp->_markers = 0; } @@ -1040,19 +961,6 @@ _IO_unsave_markers (FILE *fp) } libc_hidden_def (_IO_unsave_markers) -#if 0 -/* Seems not to be needed. --drepper */ -int -_IO_nobackup_pbackfail (FILE *fp, int c) -{ - if (fp->_IO_read_ptr > fp->_IO_read_base) - fp->_IO_read_ptr--; - if (c != EOF && *fp->_IO_read_ptr != c) - *fp->_IO_read_ptr = c; - return (unsigned char) c; -} -#endif - int _IO_default_pbackfail (FILE *fp, int c) { @@ -1200,24 +1108,4 @@ _IO_list_resetlock (void) } libc_hidden_def (_IO_list_resetlock) - -#ifdef TODO -#if defined(linux) -#define IO_CLEANUP ; -#endif - -#ifdef IO_CLEANUP - IO_CLEANUP -#else -struct __io_defs { - __io_defs() { } - ~__io_defs() { _IO_cleanup (); } -}; -__io_defs io_defs__; -#endif - -#endif /* TODO */ - -#ifdef text_set_element text_set_element(__libc_atexit, _IO_cleanup); -#endif |