diff options
author | Greg McGary <greg@mcgary.org> | 2000-07-04 00:49:25 +0000 |
---|---|---|
committer | Greg McGary <greg@mcgary.org> | 2000-07-04 00:49:25 +0000 |
commit | 73c115ed0b5d25e64b3495f12d1f092db7ce9715 (patch) | |
tree | 75d594857f65599d4dc43be9e00afee6b4f8120a /libio/genops.c | |
parent | a88b96f496c0214424db1219d21ce669fbc102a0 (diff) | |
download | glibc-73c115ed0b5d25e64b3495f12d1f092db7ce9715.tar.gz |
* libio/libio.h (_IO_FILE): Revert type of _chain to _IO_FILE*.
* libio/libioP.h (_IO_ITER): Revert to type _IO_FILE*.
(FILEBUF_LITERAL): Add cast for CHAIN init.
* libio/genops.c (_IO_un_link, _IO_link_in, _IO_iter_begin): Add casts.
(_IO_flush_all, _IO_flush_all_linebuffered, _IO_unbuffer_write):
Revert type of `fp' to _IO_FILE*.
(_IO_iter_file): Remove cast.
(_IO_iter_next): Elide intermediate member reference.
* libio/libio.h (_IO_FILE): Revert type of _chain to _IO_FILE*.
* libio/libioP.h (_IO_ITER): Revert to type _IO_FILE*.
(FILEBUF_LITERAL): Add cast for CHAIN init.
* libio/genops.c (_IO_un_link, _IO_link_in, _IO_iter_begin): Add casts.
(_IO_flush_all, _IO_flush_all_linebuffered, _IO_unbuffer_write):
Revert type of `fp' to _IO_FILE*.
(_IO_iter_file): Remove cast.
(_IO_iter_next): Elide intermediate member reference.
Diffstat (limited to 'libio/genops.c')
-rw-r--r-- | libio/genops.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/libio/genops.c b/libio/genops.c index 89a3dfc152..82c1c444b8 100644 --- a/libio/genops.c +++ b/libio/genops.c @@ -45,11 +45,11 @@ _IO_un_link (fp) #ifdef _IO_MTSAFE_IO _IO_lock_lock (list_all_lock); #endif - for (f = &_IO_list_all; *f != NULL; f = &(*f)->file._chain) + for (f = &_IO_list_all; *f; f = (struct _IO_FILE_plus **) &(*f)->file._chain) { if (*f == fp) { - *f = fp->file._chain; + *f = (struct _IO_FILE_plus *) fp->file._chain; break; } } @@ -70,7 +70,7 @@ _IO_link_in (fp) #ifdef _IO_MTSAFE_IO _IO_lock_lock (list_all_lock); #endif - fp->file._chain = _IO_list_all; + fp->file._chain = (_IO_FILE *) _IO_list_all; _IO_list_all = fp; #ifdef _IO_MTSAFE_IO _IO_lock_unlock (list_all_lock); @@ -746,13 +746,13 @@ int _IO_flush_all () { int result = 0; - struct _IO_FILE_plus *fp; - for (fp = _IO_list_all; fp != NULL; fp = fp->file._chain) - if (((fp->file._mode < 0 && fp->file._IO_write_ptr > fp->file._IO_write_base) - || (fp->file._vtable_offset == 0 - && fp->file._mode > 0 && (fp->file._wide_data->_IO_write_ptr - > fp->file._wide_data->_IO_write_base))) - && _IO_OVERFLOW (&fp->file, EOF) == EOF) + struct _IO_FILE *fp; + for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain) + if (((fp->_mode < 0 && fp->_IO_write_ptr > fp->_IO_write_base) + || (fp->_vtable_offset == 0 + && fp->_mode > 0 && (fp->_wide_data->_IO_write_ptr + > fp->_wide_data->_IO_write_base))) + && _IO_OVERFLOW (fp, EOF) == EOF) result = EOF; return result; } @@ -760,10 +760,10 @@ _IO_flush_all () void _IO_flush_all_linebuffered () { - struct _IO_FILE_plus *fp; - for (fp = _IO_list_all; fp != NULL; fp = fp->file._chain) - if ((fp->file._flags & _IO_NO_WRITES) == 0 && fp->file._flags & _IO_LINE_BUF) - _IO_OVERFLOW (&fp->file, EOF); + struct _IO_FILE *fp; + for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain) + if ((fp->_flags & _IO_NO_WRITES) == 0 && fp->_flags & _IO_LINE_BUF) + _IO_OVERFLOW (fp, EOF); } static void _IO_unbuffer_write __P ((void)); @@ -771,12 +771,12 @@ static void _IO_unbuffer_write __P ((void)); static void _IO_unbuffer_write () { - struct _IO_FILE_plus *fp; - for (fp = _IO_list_all; fp != NULL; fp = fp->file._chain) - if (! (fp->file._flags & _IO_UNBUFFERED) - && (! (fp->file._flags & _IO_NO_WRITES) - || (fp->file._flags & _IO_IS_APPENDING))) - _IO_SETBUF (&fp->file, NULL, 0); + struct _IO_FILE *fp; + for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain) + if (! (fp->_flags & _IO_UNBUFFERED) + && (! (fp->_flags & _IO_NO_WRITES) + || (fp->_flags & _IO_IS_APPENDING))) + _IO_SETBUF (fp, NULL, 0); } int @@ -1038,7 +1038,7 @@ _IO_default_imbue (fp, locale) _IO_ITER _IO_iter_begin() { - return _IO_list_all; + return (_IO_ITER) _IO_list_all; } _IO_ITER @@ -1051,14 +1051,14 @@ _IO_ITER _IO_iter_next(iter) _IO_ITER iter; { - return iter->file._chain; + return iter->_chain; } _IO_FILE * _IO_iter_file(iter) _IO_ITER iter; { - return (_IO_FILE *) iter; + return iter; } void |