This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/6] Mechanically remove _IO_ name aliases for types and constants.


On Feb 11 2018, Zack Weinberg <zackw@panix.com> wrote:

> 	* libio/libio.h (_IO_FILE): Delete; all uses changed to FILE.
> 	(_IO_fpos_t): Delete; all uses changed to __fpos_t.
> 	(_IO_fpos64_t): Delete; all uses changed to __fpos64_t.
> 	(_IO_size_t): Delete; all uses changed to size_t.
> 	(_IO_ssize_t): Delete; all uses changed to ssize_t or __ssize_t.
> 	(_IO_off_t): Delete; all uses changed to off_t.
> 	(_IO_off64_t): Delete; all uses changed to off64_t.
> 	(_IO_pid_t): Delete; all uses changed to pid_t.
> 	(_IO_uid_t): Delete; all uses changed to uid_t.
> 	(_IO_wint_t): Delete; all uses changed to wint_t.
> 	(_IO_va_list): Delete; all uses changed to va_list or __gnuc_va_list.
> 	(_IO_BUFSIZ): Delete; all uses changed to BUFSIZ.
> 	(_IO_cookie_io_functions_t): Delete; all uses changed to
> 	cookie_io_functions_t.
> 	(__io_read_fn): Delete; all uses changed to cookie_read_function_t.
> 	(__io_write_fn): Delete; all uses changed to cookie_write_function_t.
> 	(__io_seek_fn): Delete; all uses changed to cookie_seek_function_t.
> 	(__io_close_fn): Delete: all uses changed to cookie_close_function_t.
>
> 	* libio/iofopncook.c: Remove unnecessary forward declarations.
> 	* libio/iolibio.h: Correct outdated commentary.
> 	* malloc/malloc.c (__malloc_stats): Remove unnecessary casts.
> 	* stdio-common/fxprintf.c (__fxprintf_nocancel):
> 	Remove unnecessary casts.
> 	* stdio-common/getline.c: Use _IO_getdelim directly.
> 	Don't redefine ssize_t.
> 	* stdio-common/printf_fp.c, stdio_common/printf_fphex.c
> 	* stdio-common/printf_size.c: Don't redefine size_t or FILE.
> 	Remove outdated comments.
> 	* stdio-common/vfscanf.c: Don't redefine va_list.

Ok.

> @@ -1003,7 +1002,7 @@ _IO_new_file_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
>    if (fp->_offset != _IO_pos_BAD && fp->_IO_read_base != NULL
>        && !_IO_in_backup (fp))
>      {
> -      _IO_off64_t start_offset = (fp->_offset
> +      off64_t start_offset = (fp->_offset
>  				  - (fp->_IO_read_end - fp->_IO_buf_base));

Reindent.

> @@ -1191,13 +1190,13 @@ _IO_file_close (_IO_FILE *fp)
>  }
>  libc_hidden_def (_IO_file_close)
>  
> -_IO_ssize_t
> -_IO_new_file_write (_IO_FILE *f, const void *data, _IO_ssize_t n)
> +ssize_t
> +_IO_new_file_write (FILE *f, const void *data, ssize_t n)
>  {
> -  _IO_ssize_t to_do = n;
> +  ssize_t to_do = n;
>    while (to_do > 0)
>      {
> -      _IO_ssize_t count = (__builtin_expect (f->_flags2
> +      ssize_t count = (__builtin_expect (f->_flags2
>  					     & _IO_FLAGS2_NOTCANCEL, 0)

Reindent.

> @@ -54,7 +54,7 @@ _IO_getwline_info (_IO_FILE *fp, wchar_t *buf, _IO_size_t n, wint_t delim,
>      _IO_fwide (fp, 1);
>    while (n != 0)
>      {
> -      _IO_ssize_t len = (fp->_wide_data->_IO_read_end
> +      ssize_t len = (fp->_wide_data->_IO_read_end
>  			 - fp->_wide_data->_IO_read_ptr);

Reindent.

> @@ -512,7 +512,7 @@ _IO_old_file_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
>        && !_IO_in_backup (fp))
>      {
>        /* Offset relative to start of main get area. */
> -      _IO_off_t rel_offset = (offset - fp->_old_offset
> +      off_t rel_offset = (offset - fp->_old_offset
>  			      + (fp->_IO_read_end - fp->_IO_read_base));

Reindent.

> @@ -860,7 +860,7 @@ _IO_wfile_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode)
>    if (fp->_offset != _IO_pos_BAD && fp->_IO_read_base != NULL
>        && !_IO_in_backup (fp))
>      {
> -      _IO_off64_t start_offset = (fp->_offset
> +      off64_t start_offset = (fp->_offset
>  				  - (fp->_IO_read_end - fp->_IO_buf_base));

Reindent.

> @@ -280,21 +280,21 @@ __wunderflow (_IO_FILE *fp)
>  libc_hidden_def (__wunderflow)
>  
>  
> -_IO_size_t
> -_IO_wdefault_xsputn (_IO_FILE *f, const void *data, _IO_size_t n)
> +size_t
> +_IO_wdefault_xsputn (FILE *f, const void *data, size_t n)
>  {
>    const wchar_t *s = (const wchar_t *) data;
> -  _IO_size_t more = n;
> +  size_t more = n;
>    if (more <= 0)
>      return 0;
>    for (;;)
>      {
>        /* Space available. */
> -      _IO_ssize_t count = (f->_wide_data->_IO_write_end
> +      ssize_t count = (f->_wide_data->_IO_write_end
>  			   - f->_wide_data->_IO_write_ptr);

Reindent.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]