]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2000-06-28 Greg McGary <greg@mcgary.org>
authorGreg McGary <greg@mcgary.org>
Thu, 29 Jun 2000 07:16:42 +0000 (07:16 +0000)
committerGreg McGary <greg@mcgary.org>
Thu, 29 Jun 2000 07:16:42 +0000 (07:16 +0000)
* libio/libio.h (struct _IO_cookie_file): Move struct type defintion out.
(_IO_FILE): Declare chain as (struct _IO_FILE_plus *).
* libio/libioP.h (struct _IO_cookie_file): Move struct type defintion in.
(_IO_JUMPS): Don't cast THIS--expect arg to be a (struct _IO_FILE_plus *).
(_IO_JUMPS_FUNC): Express in terms of _IO_JUMPS, and add cast to
THIS, since _IO_JUMPS no longer does it implicitly.
(_IO_file_init, _IO_old_file_init, _IO_new_file_init): Declare
arg type as (struct _IO_FILE_plus *).
(_IO_str_init_static, _IO_str_init_readonly): Declare 1st
arg as (_IO_strfile *).
* libio/strops.c (_IO_str_init_static, _IO_str_init_readonly):
Declare 1st arg as (_IO_strfile *).
* libio/fileops.c (_IO_new_file_init): Declare
arg type as (struct _IO_FILE_plus *).
* libio/oldfileops.c (_IO_old_file_init): Likewise.
* libio/genops.c (_IO_link_in, _IO_un_link): Likewise.
(_IO_flush_all, _IO_flush_all_linebuffered, _IO_unbuffer_write):
Declare iteration pointer as (struct _IO_FILE_plus *).
(_IO_iter_next, _IO_iter_file): _IO_ITER is now (struct _IO_FILE_plus *).
* libio/stdfiles.c (_IO_list_all): Declare as (struct _IO_FILE_plus *).
* libio/oldstdfiles.c (_IO_list_all): Likewise.
(_IO_check_libio): Set user-visible handles to (struct _IO_FILE_plus *).
* libio/stdio.c (stdin, stdout, stderr): Set user-visible handles
to (struct _IO_FILE_plus *).

* libio/iofdopen.c (_IO_new_fdopen): Pass FILE handle pointer
whose high bound includes vtable to all functions that will use
vtable.  For streambufs, pass pointer whose bounds include struct
_IO_strfile.
* libio/wgenops.c (_IO_wdefault_finish): Likewise.
* libio/oldiofdopen.c (_IO_old_fdopen): Likewise.
* libio/iofopen.c (_IO_new_fopen): Likewise.
* libio/oldiofopen.c (_IO_old_fopen): Likewise.
* libio/iofopen64.c (_IO_fopen64): Likewise.
* libio/iopopen.c (_IO_new_popen): Likewise.
* libio/oldiopopen.c (_IO_old_popen): Likewise.
* libio/memstream.c (open_memstream): Likewise.
* libio/iovsscanf.c (_IO_vsscanf): Likewise.
* libio/iovsprintf.c (_IO_vsprintf): Likewise.
* libio/iovdprintf.c (_IO_vdprintf): Likewise.
* libio/iofopncook.c (_IO_cookie_init): Likewise.
* libio/obprintf.c (_IO_obstack_vprintf): Likewise.
* libio/vasprintf.c (_IO_vasprintf): Likewise.
* libio/vsnprintf.c (_IO_vsnprintf): Likewise.
* libio/stdfiles.c (_IO_stdout_, _IO_stderr_): Likewise.
* libio/oldstdfiles.c (_IO_stdout_, _IO_stderr_): Likewise.
* stdlib/strfmon.c (__strfmon_l): Likewise.
* stdio-common/vfprintf.c (buffered_vfprintf): Likewise.
(vfprintf): Qualify computed-goto targets as unbounded.
2000-06-28  Greg McGary  <greg@mcgary.org>

* libio/libio.h (struct _IO_cookie_file): Move struct type defintion out.
(_IO_FILE): Declare chain as (struct _IO_FILE_plus *).
* libio/libioP.h (struct _IO_cookie_file): Move struct type defintion in.
(_IO_JUMPS): Don't cast THIS--expect arg to be a (struct _IO_FILE_plus *).
(_IO_JUMPS_FUNC): Express in terms of _IO_JUMPS, and add cast to
THIS, since _IO_JUMPS no longer does it implicitly.
(_IO_file_init, _IO_old_file_init, _IO_new_file_init): Declare
arg type as (struct _IO_FILE_plus *).
(_IO_str_init_static, _IO_str_init_readonly): Declare 1st
arg as (_IO_strfile *).
* libio/strops.c (_IO_str_init_static, _IO_str_init_readonly):
Declare 1st arg as (_IO_strfile *).
* libio/fileops.c (_IO_new_file_init): Declare
arg type as (struct _IO_FILE_plus *).
* libio/oldfileops.c (_IO_old_file_init): Likewise.
* libio/genops.c (_IO_link_in, _IO_un_link): Likewise.
(_IO_flush_all, _IO_flush_all_linebuffered, _IO_unbuffer_write):
Declare iteration pointer as (struct _IO_FILE_plus *).
(_IO_iter_next, _IO_iter_file): _IO_ITER is now (struct _IO_FILE_plus *).
* libio/stdfiles.c (_IO_list_all): Declare as (struct _IO_FILE_plus *).
* libio/oldstdfiles.c (_IO_list_all): Likewise.
(_IO_check_libio): Set user-visible handles to (struct _IO_FILE_plus *).
* libio/stdio.c (stdin, stdout, stderr): Set user-visible handles
to (struct _IO_FILE_plus *).

* libio/iofdopen.c (_IO_new_fdopen): Pass FILE handle pointer
whose high bound includes vtable to all functions that will use
vtable.  For streambufs, pass pointer whose bounds include struct
_IO_strfile.
* libio/wgenops.c (_IO_wdefault_finish): Likewise.
* libio/oldiofdopen.c (_IO_old_fdopen): Likewise.
* libio/iofopen.c (_IO_new_fopen): Likewise.
* libio/oldiofopen.c (_IO_old_fopen): Likewise.
* libio/iofopen64.c (_IO_fopen64): Likewise.
* libio/iopopen.c (_IO_new_popen): Likewise.
* libio/oldiopopen.c (_IO_old_popen): Likewise.
* libio/memstream.c (open_memstream): Likewise.
* libio/iovsscanf.c (_IO_vsscanf): Likewise.
* libio/iovsprintf.c (_IO_vsprintf): Likewise.
* libio/iovdprintf.c (_IO_vdprintf): Likewise.
* libio/iofopncook.c (_IO_cookie_init): Likewise.
* libio/obprintf.c (_IO_obstack_vprintf): Likewise.
* libio/vasprintf.c (_IO_vasprintf): Likewise.
* libio/vsnprintf.c (_IO_vsnprintf): Likewise.
* libio/stdfiles.c (_IO_stdout_, _IO_stderr_): Likewise.
* libio/oldstdfiles.c (_IO_stdout_, _IO_stderr_): Likewise.
* stdlib/strfmon.c (__strfmon_l): Likewise.
* stdio-common/vfprintf.c (buffered_vfprintf): Likewise.
(vfprintf): Qualify computed-goto targets as unbounded.

28 files changed:
ChangeLog
libio/fileops.c
libio/genops.c
libio/iofdopen.c
libio/iofopen.c
libio/iofopen64.c
libio/iofopncook.c
libio/iopopen.c
libio/iovdprintf.c
libio/iovsprintf.c
libio/iovsscanf.c
libio/libio.h
libio/libioP.h
libio/memstream.c
libio/obprintf.c
libio/oldfileops.c
libio/oldiofdopen.c
libio/oldiofopen.c
libio/oldiopopen.c
libio/oldstdfiles.c
libio/stdfiles.c
libio/stdio.c
libio/strops.c
libio/vasprintf.c
libio/vsnprintf.c
libio/wgenops.c
stdio-common/vfprintf.c
stdlib/strfmon.c

index db513b7c9eb9e3b0d3ffed90eb04db33978eb3c7..f953e8e42b3a5373c3ba0e91c0ae8d9cce6875c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,55 @@
+2000-06-28  Greg McGary  <greg@mcgary.org>
+
+       * libio/libio.h (struct _IO_cookie_file): Move struct type defintion out.
+       (_IO_FILE): Declare chain as (struct _IO_FILE_plus *).
+       * libio/libioP.h (struct _IO_cookie_file): Move struct type defintion in.
+       (_IO_JUMPS): Don't cast THIS--expect arg to be a (struct _IO_FILE_plus *).
+       (_IO_JUMPS_FUNC): Express in terms of _IO_JUMPS, and add cast to
+       THIS, since _IO_JUMPS no longer does it implicitly.
+       (_IO_file_init, _IO_old_file_init, _IO_new_file_init): Declare
+       arg type as (struct _IO_FILE_plus *).
+       (_IO_str_init_static, _IO_str_init_readonly): Declare 1st
+       arg as (_IO_strfile *).
+       * libio/strops.c (_IO_str_init_static, _IO_str_init_readonly):
+       Declare 1st arg as (_IO_strfile *).
+       * libio/fileops.c (_IO_new_file_init): Declare
+       arg type as (struct _IO_FILE_plus *).
+       * libio/oldfileops.c (_IO_old_file_init): Likewise.
+       * libio/genops.c (_IO_link_in, _IO_un_link): Likewise.
+       (_IO_flush_all, _IO_flush_all_linebuffered, _IO_unbuffer_write):
+       Declare iteration pointer as (struct _IO_FILE_plus *).
+       (_IO_iter_next, _IO_iter_file): _IO_ITER is now (struct _IO_FILE_plus *).
+       * libio/stdfiles.c (_IO_list_all): Declare as (struct _IO_FILE_plus *).
+       * libio/oldstdfiles.c (_IO_list_all): Likewise.
+       (_IO_check_libio): Set user-visible handles to (struct _IO_FILE_plus *).
+       * libio/stdio.c (stdin, stdout, stderr): Set user-visible handles
+       to (struct _IO_FILE_plus *).
+
+       * libio/iofdopen.c (_IO_new_fdopen): Pass FILE handle pointer
+       whose high bound includes vtable to all functions that will use
+       vtable.  For streambufs, pass pointer whose bounds include struct
+       _IO_strfile.
+       * libio/wgenops.c (_IO_wdefault_finish): Likewise.
+       * libio/oldiofdopen.c (_IO_old_fdopen): Likewise.
+       * libio/iofopen.c (_IO_new_fopen): Likewise.
+       * libio/oldiofopen.c (_IO_old_fopen): Likewise.
+       * libio/iofopen64.c (_IO_fopen64): Likewise.
+       * libio/iopopen.c (_IO_new_popen): Likewise.
+       * libio/oldiopopen.c (_IO_old_popen): Likewise.
+       * libio/memstream.c (open_memstream): Likewise.
+       * libio/iovsscanf.c (_IO_vsscanf): Likewise.
+       * libio/iovsprintf.c (_IO_vsprintf): Likewise.
+       * libio/iovdprintf.c (_IO_vdprintf): Likewise.
+       * libio/iofopncook.c (_IO_cookie_init): Likewise.
+       * libio/obprintf.c (_IO_obstack_vprintf): Likewise.
+       * libio/vasprintf.c (_IO_vasprintf): Likewise.
+       * libio/vsnprintf.c (_IO_vsnprintf): Likewise.
+       * libio/stdfiles.c (_IO_stdout_, _IO_stderr_): Likewise.
+       * libio/oldstdfiles.c (_IO_stdout_, _IO_stderr_): Likewise.
+       * stdlib/strfmon.c (__strfmon_l): Likewise.
+       * stdio-common/vfprintf.c (buffered_vfprintf): Likewise.
+       (vfprintf): Qualify computed-goto targets as unbounded.
+
 2000-06-28  Ulrich Drepper  <drepper@redhat.com>
 
        * stdio-common/vfscanf.c: Finally handle multibyte decimal point and
index 81dece080ff83495e55a75e8b79fed0447cdd0b7..7cc8b7c7e26945ed7d56137277185cdb0d08c131 100644 (file)
@@ -113,16 +113,16 @@ extern int errno;
 
 void
 _IO_new_file_init (fp)
-     _IO_FILE *fp;
+     struct _IO_FILE_plus *fp;
 {
   /* POSIX.1 allows another file handle to be used to change the position
      of our file descriptor.  Hence we actually don't know the actual
      position before we do the first fseek (and until a following fflush). */
-  fp->_offset = _IO_pos_BAD;
-  fp->_IO_file_flags |= CLOSED_FILEBUF_FLAGS;
+  fp->file._offset = _IO_pos_BAD;
+  fp->file._IO_file_flags |= CLOSED_FILEBUF_FLAGS;
 
-  _IO_link_in(fp);
-  fp->_fileno = -1;
+  _IO_link_in (fp);
+  fp->file._fileno = -1;
 }
 
 int
@@ -153,7 +153,7 @@ _IO_new_file_close_it (fp)
       _IO_wsetp (fp, NULL, NULL);
     }
 
-  _IO_un_link (fp);
+  _IO_un_link ((struct _IO_FILE_plus *) fp);
   fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS;
   fp->_fileno = -1;
   fp->_offset = _IO_pos_BAD;
@@ -203,7 +203,7 @@ _IO_file_open (fp, filename, posix_mode, prot, read_write, is32not64)
     if (_IO_SEEKOFF (fp, (_IO_off64_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
        == _IO_pos_BAD && errno != ESPIPE)
       return NULL;
-  _IO_link_in (fp);
+  _IO_link_in ((struct _IO_FILE_plus *) fp);
   return fp;
 }
 
index bdbde0ce4b11ff2de271c25feef59ccf62c84d68..bffc355fa56258ab1f5c2735a57910ca1bbc59d4 100644 (file)
@@ -37,40 +37,40 @@ static _IO_lock_t list_all_lock = _IO_lock_initializer;
 
 void
 _IO_un_link (fp)
-     _IO_FILE *fp;
+     struct _IO_FILE_plus *fp;
 {
-  if (fp->_flags & _IO_LINKED)
+  if (fp->file._flags & _IO_LINKED)
     {
-      _IO_FILE **f;
+      struct _IO_FILE_plus **f;
 #ifdef _IO_MTSAFE_IO
       _IO_lock_lock (list_all_lock);
 #endif
-      for (f = &_IO_list_all; *f != NULL; f = &(*f)->_chain)
+      for (f = &_IO_list_all; *f != NULL; f = &(*f)->file._chain)
        {
          if (*f == fp)
            {
-             *f = fp->_chain;
+             *f = fp->file._chain;
              break;
            }
        }
 #ifdef _IO_MTSAFE_IO
       _IO_lock_unlock (list_all_lock);
 #endif
-      fp->_flags &= ~_IO_LINKED;
+      fp->file._flags &= ~_IO_LINKED;
     }
 }
 
 void
 _IO_link_in (fp)
-     _IO_FILE *fp;
+     struct _IO_FILE_plus *fp;
 {
-    if ((fp->_flags & _IO_LINKED) == 0)
+    if ((fp->file._flags & _IO_LINKED) == 0)
       {
-       fp->_flags |= _IO_LINKED;
+       fp->file._flags |= _IO_LINKED;
 #ifdef _IO_MTSAFE_IO
        _IO_lock_lock (list_all_lock);
 #endif
-       fp->_chain = _IO_list_all;
+       fp->file._chain = _IO_list_all;
        _IO_list_all = fp;
 #ifdef _IO_MTSAFE_IO
        _IO_lock_unlock (list_all_lock);
@@ -627,7 +627,7 @@ _IO_default_finish (fp, dummy)
   _IO_lock_fini (*fp->_lock);
 #endif
 
-  _IO_un_link (fp);
+  _IO_un_link ((struct _IO_FILE_plus *) fp);
 }
 
 _IO_off64_t
@@ -739,13 +739,13 @@ int
 _IO_flush_all ()
 {
   int result = 0;
-  _IO_FILE *fp;
-  for (fp = _IO_list_all; fp != NULL; 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)
+  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)
       result = EOF;
   return result;
 }
@@ -753,10 +753,10 @@ _IO_flush_all ()
 void
 _IO_flush_all_linebuffered ()
 {
-  _IO_FILE *fp;
-  for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
-    if ((fp->_flags & _IO_NO_WRITES) == 0 && fp->_flags & _IO_LINE_BUF)
-      _IO_OVERFLOW (fp, EOF);
+  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);
 }
 
 static void _IO_unbuffer_write __P ((void));
@@ -764,12 +764,12 @@ static void _IO_unbuffer_write __P ((void));
 static void
 _IO_unbuffer_write ()
 {
-  _IO_FILE *fp;
-  for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
-    if (! (fp->_flags & _IO_UNBUFFERED)
-       && (! (fp->_flags & _IO_NO_WRITES)
-           || (fp->_flags & _IO_IS_APPENDING)))
-      _IO_SETBUF (fp, NULL, 0);
+  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);
 }
 
 int
@@ -1037,21 +1037,21 @@ _IO_iter_begin()
 _IO_ITER
 _IO_iter_end()
 {
-       return NULL;
+  return NULL;
 }
 
 _IO_ITER
 _IO_iter_next(iter)
     _IO_ITER iter;
 {
-  return iter->_chain;
+  return iter->file._chain;
 }
 
 _IO_FILE *
 _IO_iter_file(iter)
     _IO_ITER iter;
 {
-  return iter;
+  return (_IO_FILE *) iter;
 }
 
 void
index 0cbbee90515aa3c14bdeb7c47c24937e7becdb97..dc8957646097cb4e35f5abfee03d64e3445e18de 100644 (file)
@@ -124,13 +124,13 @@ _IO_new_fdopen (fd, mode)
 #endif
   _IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd, &_IO_wfile_jumps);
   _IO_JUMPS (&new_f->fp) = &_IO_file_jumps;
-  _IO_file_init (&new_f->fp.file);
+  _IO_file_init (&new_f->fp);
 #if  !_IO_UNIFIED_JUMPTABLES
   new_f->fp.vtable = NULL;
 #endif
   if (_IO_file_attach (&new_f->fp.file, fd) == NULL)
     {
-      _IO_un_link (&new_f->fp.file);
+      _IO_un_link (&new_f->fp);
       free (new_f);
       return NULL;
     }
@@ -140,7 +140,7 @@ _IO_new_fdopen (fd, mode)
     _IO_mask_flags (&new_f->fp.file, read_write,
                    _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
 
-  return &new_f->fp.file;
+  return (_IO_FILE *) &new_f->fp;
 }
 
 strong_alias (_IO_new_fdopen, __new_fdopen)
index 05e047929d5f71bfb3927cb9b385ae9fada92e26..e44423be6dd2d63b43a7338ff7a88e9ed9da5993 100644 (file)
@@ -50,13 +50,13 @@ _IO_new_fopen (filename, mode)
 #endif
   _IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd, &_IO_wfile_jumps);
   _IO_JUMPS (&new_f->fp) = &_IO_file_jumps;
-  _IO_file_init (&new_f->fp.file);
+  _IO_file_init (&new_f->fp);
 #if  !_IO_UNIFIED_JUMPTABLES
   new_f->fp.vtable = NULL;
 #endif
-  if (_IO_file_fopen (&new_f->fp.file, filename, mode, 1) != NULL)
+  if (_IO_file_fopen ((_IO_FILE *) new_f, filename, mode, 1) != NULL)
     return (_IO_FILE *) &new_f->fp;
-  _IO_un_link (&new_f->fp.file);
+  _IO_un_link (&new_f->fp);
   free (new_f);
   return NULL;
 }
index 0dc19b2e1b33a5f3108a28d5390f22c0c2ac24fb..dccc4c3bda30dfae0f615f0ceb056f8d05701af3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -50,13 +50,13 @@ _IO_fopen64 (filename, mode)
 #endif
   _IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd, &_IO_wfile_jumps);
   _IO_JUMPS (&new_f->fp) = &_IO_file_jumps;
-  _IO_file_init (&new_f->fp.file);
+  _IO_file_init (&new_f->fp);
 #if  !_IO_UNIFIED_JUMPTABLES
   new_f->fp.vtable = NULL;
 #endif
-  if (_IO_file_fopen (&new_f->fp.file, filename, mode, 0) != NULL)
-    return &new_f->fp.file;
-  _IO_un_link (&new_f->fp.file);
+  if (_IO_file_fopen ((_IO_FILE *) new_f, filename, mode, 0) != NULL)
+    return (_IO_FILE *) &new_f->fp;
+  _IO_un_link (&new_f->fp);
   free (new_f);
   return NULL;
 #else
index 852a483a49c8033e78fa81851d2532d3a8aa79f0..c016cfb1d5dda2604dd263a287988fc3ac34aeb5 100644 (file)
@@ -121,22 +121,22 @@ void
 _IO_cookie_init (struct _IO_cookie_file *cfile, int read_write,
                 void *cookie, _IO_cookie_io_functions_t io_functions)
 {
-  _IO_init (&cfile->__file, 0);
-  _IO_JUMPS (&cfile->__file) = &_IO_cookie_jumps;
+  _IO_init (&cfile->__fp.file, 0);
+  _IO_JUMPS (&cfile->__fp) = &_IO_cookie_jumps;
 
   cfile->__cookie = cookie;
   cfile->__io_functions = io_functions;
 
-  _IO_file_init(&cfile->__file);
+  _IO_file_init(&cfile->__fp);
 
-  cfile->__file._IO_file_flags =
-    _IO_mask_flags (&cfile->__file, read_write,
+  cfile->__fp.file._IO_file_flags =
+    _IO_mask_flags (&cfile->__fp.file, read_write,
                    _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
 
   /* We use a negative number different from -1 for _fileno to mark that
      this special stream is not associated with a real file, but still has
      to be treated as such.  */
-  cfile->__file._fileno = -2;
+  cfile->__fp.file._fileno = -2;
 }
 
 
@@ -176,12 +176,12 @@ _IO_fopencookie (cookie, mode, io_functions)
   if (new_f == NULL)
     return NULL;
 #ifdef _IO_MTSAFE_IO
-  new_f->cfile.__file._lock = &new_f->lock;
+  new_f->cfile.__fp.file._lock = &new_f->lock;
 #endif
 
   _IO_cookie_init (&new_f->cfile, read_write, cookie, io_functions);
 
-  return &new_f->cfile.__file;
+  return (_IO_FILE *) &new_f->cfile.__fp;
 }
 
 versioned_symbol (libc, _IO_fopencookie, fopencookie, GLIBC_2_2);
@@ -245,7 +245,7 @@ _IO_old_fopencookie (cookie, mode, io_functions)
 
   ret = _IO_fopencookie (cookie, mode, io_functions);
   if (ret != NULL)
-    _IO_JUMPS (ret) = &_IO_old_cookie_jumps;
+    _IO_JUMPS ((struct _IO_FILE_plus *) ret) = &_IO_old_cookie_jumps;
 
   return ret;
 }
index 3edbba4bf7b58791e3ad5719bb7ac381ea538d35..9abd429d7c7281d1419e67a09eac323e0d2363ee 100644 (file)
@@ -203,14 +203,14 @@ _IO_new_popen (command, mode)
 #endif
   fp = &new_f->fpx.file.file;
   _IO_no_init (fp, 0, 0, &new_f->wd, &_IO_wproc_jumps);
-  _IO_JUMPS (fp) = &_IO_proc_jumps;
-  _IO_new_file_init (fp);
+  _IO_JUMPS (&new_f->fpx.file) = &_IO_proc_jumps;
+  _IO_new_file_init (&new_f->fpx.file);
 #if  !_IO_UNIFIED_JUMPTABLES
   new_f->fpx.file.vtable = NULL;
 #endif
   if (_IO_new_proc_open (fp, command, mode) != NULL)
-    return fp;
-  _IO_un_link (fp);
+    return (_IO_FILE *) &new_f->fpx.file;
+  _IO_un_link (&new_f->fpx.file);
   free (new_f);
   return NULL;
 }
index b951006975650fc33c6e2c8bb9f2197c4e5aba37..f7d6433d0d1436087f10bfbe32336634c9bff59d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -43,14 +43,14 @@ _IO_vdprintf (d, format, arg)
   tmpfil.file._lock = &lock;
 #endif
   _IO_no_init (&tmpfil.file, 0, 0, &wd, &_IO_wfile_jumps);
-  _IO_JUMPS (&tmpfil.file) = &_IO_file_jumps;
-  _IO_file_init (&tmpfil.file);
+  _IO_JUMPS (&tmpfil) = &_IO_file_jumps;
+  _IO_file_init (&tmpfil);
 #if  !_IO_UNIFIED_JUMPTABLES
   tmpfil.vtable = NULL;
 #endif
   if (_IO_file_attach (&tmpfil.file, d) == NULL)
     {
-      _IO_un_link (&tmpfil.file);
+      _IO_un_link (&tmpfil);
       return EOF;
     }
   tmpfil.file._IO_file_flags =
@@ -58,9 +58,9 @@ _IO_vdprintf (d, format, arg)
                     _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING)
      | _IO_DELETE_DONT_CLOSE);
 
-  done = _IO_vfprintf (&tmpfil.file, format, arg);
+  done = _IO_vfprintf ((_IO_FILE *) &tmpfil, format, arg);
 
-  _IO_FINISH (&tmpfil.file);
+  _IO_FINISH ((_IO_FILE *) &tmpfil);
 
   return done;
 }
index 84c24d8d5972c0407835537ec574e9aa9aacc95c..7f0d3ec42b53cbba1f4a05fb693e6d48aabf7cc7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -42,10 +42,10 @@ _IO_vsprintf (string, format, args)
   sf._sbf._f._lock = &lock;
 #endif
   _IO_no_init (&sf._sbf._f, 0, -1, NULL, NULL);
-  _IO_JUMPS (&sf._sbf._f) = &_IO_str_jumps;
-  _IO_str_init_static (&sf._sbf._f, string, -1, string);
-  ret = _IO_vfprintf (&sf._sbf._f, format, args);
-  _IO_putc_unlocked ('\0', &sf._sbf._f);
+  _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
+  _IO_str_init_static (&sf, string, -1, string);
+  ret = _IO_vfprintf ((_IO_FILE *) &sf._sbf, format, args);
+  _IO_putc_unlocked ('\0', (_IO_FILE *) &sf._sbf);
   return ret;
 }
 
index 2b1e44dfd8545e81f5e95655a2a0b1664634e46f..a95f0eaac1da425551a7746723426ae1dff975d5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -39,9 +39,9 @@ _IO_vsscanf (string, format, args)
   sf._sbf._f._lock = &lock;
 #endif
   _IO_no_init (&sf._sbf._f, 0, -1, NULL, NULL);
-  _IO_JUMPS (&sf._sbf._f) = &_IO_str_jumps;
-  _IO_str_init_static (&sf._sbf._f, (char*)string, 0, NULL);
-  ret = _IO_vfscanf (&sf._sbf._f, format, args, NULL);
+  _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
+  _IO_str_init_static (&sf, (char*)string, 0, NULL);
+  ret = _IO_vfscanf ((_IO_FILE *) &sf._sbf, format, args, NULL);
   return ret;
 }
 
index 8fdc55a8909c65f8b36bbdabe6b37d3b46a2885c..6d32eedf7f0f220798dcf63e9c7abd9a892dc36a 100644 (file)
@@ -252,6 +252,8 @@ struct _IO_wide_data
   struct _IO_jump_t *_wide_vtable;
 };
 
+struct _IO_FILE_plus;
+
 struct _IO_FILE {
   int _flags;          /* High-order word is _IO_MAGIC; rest is flags. */
 #define _IO_file_flags _flags
@@ -273,7 +275,7 @@ struct _IO_FILE {
 
   struct _IO_marker *_markers;
 
-  struct _IO_FILE *_chain;
+  struct _IO_FILE_plus *_chain;
 
   int _fileno;
   int _blksize;
@@ -310,7 +312,6 @@ struct _IO_FILE_complete
 typedef struct _IO_FILE _IO_FILE;
 #endif
 
-struct _IO_FILE_plus;
 extern struct _IO_FILE_plus _IO_2_1_stdin_;
 extern struct _IO_FILE_plus _IO_2_1_stdout_;
 extern struct _IO_FILE_plus _IO_2_1_stderr_;
@@ -369,14 +370,7 @@ typedef struct
 } _IO_cookie_io_functions_t;
 typedef _IO_cookie_io_functions_t cookie_io_functions_t;
 
-/* Special file type for fopencookie function.  */
-struct _IO_cookie_file
-{
-  struct _IO_FILE __file;
-  const void *__vtable;
-  void *__cookie;
-  _IO_cookie_io_functions_t __io_functions;
-};
+struct _IO_cookie_file;
 
 /* Initialize one of those.  */
 extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
index 090f98a02d54733929de151f223f69de7d0259be..9fb418869c83df906bd742555177bec1a4c8016a 100644 (file)
@@ -69,16 +69,16 @@ extern "C" {
 # define _IO_JUMPS_OFFSET 1
 #endif
 
-#define _IO_JUMPS(THIS) ((struct _IO_FILE_plus *) (THIS))->vtable
+#define _IO_JUMPS(THIS) (THIS)->vtable
 #define _IO_WIDE_JUMPS(THIS) ((struct _IO_FILE *) (THIS))->_wide_data->_wide_vtable
 #define _IO_CHECK_WIDE(THIS) (((struct _IO_FILE *) (THIS))->_wide_data != NULL)
 
 #if _IO_JUMPS_OFFSET
 # define _IO_JUMPS_FUNC(THIS) \
- (*(struct _IO_jump_t **) ((void *) &((struct _IO_FILE_plus *) (THIS))->vtable\
+ (*(struct _IO_jump_t **) ((void *) &_IO_JUMPS ((struct _IO_FILE_plus *) (THIS)) \
                           + (THIS)->_vtable_offset))
 #else
-# define _IO_JUMPS_FUNC(THIS) _IO_JUMPS(THIS)
+# define _IO_JUMPS_FUNC(THIS) _IO_JUMPS ((struct _IO_FILE_plus *) (THIS))
 #endif
 #define _IO_WIDE_JUMPS_FUNC(THIS) _IO_WIDE_JUMPS(THIS)
 #ifdef _G_USING_THUNKS
@@ -313,9 +313,17 @@ struct _IO_FILE_plus
   const struct _IO_jump_t *vtable;
 };
 
+/* Special file type for fopencookie function.  */
+struct _IO_cookie_file
+{
+  struct _IO_FILE_plus __fp;
+  void *__cookie;
+  _IO_cookie_io_functions_t __io_functions;
+};
+
 /* Iterator type for walking global linked list of _IO_FILE objects. */
 
-typedef _IO_FILE *_IO_ITER;
+typedef struct _IO_FILE_plus *_IO_ITER;
 
 /* Generic functions */
 
@@ -325,8 +333,8 @@ extern int _IO_switch_to_get_mode __P ((_IO_FILE *));
 extern void _IO_init __P ((_IO_FILE *, int));
 extern int _IO_sputbackc __P ((_IO_FILE *, int));
 extern int _IO_sungetc __P ((_IO_FILE *));
-extern void _IO_un_link __P ((_IO_FILE *));
-extern void _IO_link_in __P ((_IO_FILE *));
+extern void _IO_un_link __P ((struct _IO_FILE_plus *));
+extern void _IO_link_in __P ((struct _IO_FILE_plus *));
 extern void _IO_doallocbuf __P ((_IO_FILE *));
 extern void _IO_unsave_markers __P ((_IO_FILE *));
 extern void _IO_setb __P ((_IO_FILE *, char *, char *, int));
@@ -470,7 +478,7 @@ extern int _IO_file_close __P ((_IO_FILE *));
 extern int _IO_file_underflow __P ((_IO_FILE *));
 extern int _IO_file_overflow __P ((_IO_FILE *, int));
 #define _IO_file_is_open(__fp) ((__fp)->_fileno != -1)
-extern void _IO_file_init __P ((_IO_FILE *));
+extern void _IO_file_init __P ((struct _IO_FILE_plus *));
 extern _IO_FILE* _IO_file_attach __P ((_IO_FILE *, int));
 extern _IO_FILE* _IO_file_open __P ((_IO_FILE *, const char *, int, int,
                                     int, int));
@@ -491,7 +499,7 @@ extern _IO_FILE* _IO_new_file_fopen __P ((_IO_FILE *, const char *, const char *
                                          int));
 extern void _IO_no_init __P ((_IO_FILE *, int, int, struct _IO_wide_data *,
                              struct _IO_jump_t *));
-extern void _IO_new_file_init __P ((_IO_FILE *));
+extern void _IO_new_file_init __P ((struct _IO_FILE_plus *));
 extern _IO_FILE* _IO_new_file_setbuf __P ((_IO_FILE *, char *, _IO_ssize_t));
 extern int _IO_new_file_sync __P ((_IO_FILE *));
 extern int _IO_new_file_underflow __P ((_IO_FILE *));
@@ -508,7 +516,7 @@ extern _IO_size_t _IO_old_file_xsputn __P ((_IO_FILE *, const void *,
                                            _IO_size_t));
 extern int _IO_old_file_underflow __P ((_IO_FILE *));
 extern int _IO_old_file_overflow __P ((_IO_FILE *, int));
-extern void _IO_old_file_init __P ((_IO_FILE *));
+extern void _IO_old_file_init __P ((struct _IO_FILE_plus *));
 extern _IO_FILE* _IO_old_file_attach __P ((_IO_FILE *, int));
 extern _IO_FILE* _IO_old_file_fopen __P ((_IO_FILE *, const char *,
                                          const char *));
@@ -543,8 +551,9 @@ extern _IO_off64_t _IO_str_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
 extern void _IO_str_finish __P ((_IO_FILE *, int));
 
 /* Other strfile functions */
-extern void _IO_str_init_static __P ((_IO_FILE *, char *, int, char *));
-extern void _IO_str_init_readonly __P ((_IO_FILE *, const char *, int));
+struct _IO_strfile_;
+extern void _IO_str_init_static __P ((struct _IO_strfile_ *, char *, int, char *));
+extern void _IO_str_init_readonly __P ((struct _IO_strfile_ *, const char *, int));
 extern _IO_ssize_t _IO_str_count __P ((_IO_FILE *));
 
 /* And the wide character versions.  */
@@ -579,7 +588,7 @@ extern int _IO_outfloat __P ((double __value, _IO_FILE *__sb, int __type,
                              int __width, int __precision, int __flags,
                              int __sign_mode, int __fill));
 
-extern _IO_FILE *_IO_list_all;
+extern struct _IO_FILE_plus *_IO_list_all;
 extern void (*_IO_cleanup_registration_needed) __PMT ((void));
 
 #ifndef EOF
index 840d0e6968cd3d70490b3b7e9808738f9c40bb29..ceda7c76f23a35a25bef0810b336a0722c23241b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1999, 2000 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
@@ -113,8 +113,8 @@ open_memstream (bufloc, sizeloc)
   if (buf == NULL)
     return NULL;
   _IO_no_init (&new_f->fp._sf._sbf._f, 0, 0, &new_f->wd, &_IO_wmem_jumps);
-  _IO_JUMPS (&new_f->fp._sf._sbf._f) = &_IO_mem_jumps;
-  _IO_str_init_static (&new_f->fp._sf._sbf._f, buf, _IO_BUFSIZ, buf);
+  _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fp._sf._sbf) = &_IO_mem_jumps;
+  _IO_str_init_static (&new_f->fp._sf, buf, _IO_BUFSIZ, buf);
   new_f->fp._sf._sbf._f._flags &= ~_IO_USER_BUF;
   new_f->fp._sf._s._allocate_buffer = (_IO_alloc_type) malloc;
   new_f->fp._sf._s._free_buffer = (_IO_free_type) free;
@@ -122,7 +122,7 @@ open_memstream (bufloc, sizeloc)
   new_f->fp.bufloc = bufloc;
   new_f->fp.sizeloc = sizeloc;
 
-  return &new_f->fp._sf._sbf._f;
+  return (_IO_FILE *) &new_f->fp._sf._sbf;
 }
 
 
index 448b4f7d5ff7e853225ee6aa2fd93b5d03889e55..396bb279a0a2d527b13fc167a94e85cafa69d303 100644 (file)
@@ -155,7 +155,7 @@ _IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args)
       assert (size != 0);
     }
 
-  _IO_str_init_static (&new_f.ofile.file.file, obstack_base (obstack),
+  _IO_str_init_static ((struct _IO_strfile_ *) &new_f.ofile, obstack_base (obstack),
                       size, obstack_next_free (obstack));
   /* Now allocate the rest of the current chunk.  */
   assert (size == (new_f.ofile.file.file._IO_write_end
@@ -167,7 +167,7 @@ _IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args)
 
   new_f.ofile.obstack = obstack;
 
-  result = _IO_vfprintf (&new_f.ofile.file.file, format, args);
+  result = _IO_vfprintf ((_IO_FILE *) &new_f.ofile.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
index f26f9f12d22cf6573619b9b6d4e93815ee378a6d..0ade247a1aa0505957586619342dd46c7b8bd24d 100644 (file)
@@ -114,18 +114,18 @@ extern int errno;
 
 void
 _IO_old_file_init (fp)
-     _IO_FILE *fp;
+     struct _IO_FILE_plus *fp;
 {
   /* POSIX.1 allows another file handle to be used to change the position
      of our file descriptor.  Hence we actually don't know the actual
      position before we do the first fseek (and until a following fflush). */
-  fp->_old_offset = _IO_pos_BAD;
-  fp->_IO_file_flags |= CLOSED_FILEBUF_FLAGS;
+  fp->file._old_offset = _IO_pos_BAD;
+  fp->file._IO_file_flags |= CLOSED_FILEBUF_FLAGS;
 
-  _IO_link_in(fp);
-  fp->_vtable_offset = ((int) sizeof (struct _IO_FILE)
-                       - (int) sizeof (struct _IO_FILE_complete));
-  fp->_fileno = -1;
+  _IO_link_in (fp);
+  fp->file._vtable_offset = ((int) sizeof (struct _IO_FILE)
+                            - (int) sizeof (struct _IO_FILE_complete));
+  fp->file._fileno = -1;
 }
 
 int
@@ -147,7 +147,7 @@ _IO_old_file_close_it (fp)
   _IO_setg (fp, NULL, NULL, NULL);
   _IO_setp (fp, NULL, NULL);
 
-  _IO_un_link (fp);
+  _IO_un_link ((struct _IO_FILE_plus *) fp);
   fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS;
   fp->_fileno = -1;
   fp->_old_offset = _IO_pos_BAD;
@@ -214,7 +214,7 @@ _IO_old_file_fopen (fp, filename, mode)
     if (_IO_SEEKOFF (fp, (_IO_off_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
        == _IO_pos_BAD && errno != ESPIPE)
       return NULL;
-  _IO_link_in (fp);
+  _IO_link_in ((struct _IO_FILE_plus *) fp);
   return fp;
 }
 
index ed3a220e41e0e7dbff6ea8617d1170b938f2e5d5..bf90c83f3d48e57ad4d37aa5cb0f838094d3addf 100644 (file)
@@ -114,13 +114,13 @@ _IO_old_fdopen (fd, mode)
 #endif
   _IO_init (&new_f->fp.file, 0);
   _IO_JUMPS (&new_f->fp) = &_IO_old_file_jumps;
-  _IO_old_file_init (&new_f->fp.file);
+  _IO_old_file_init (&new_f->fp);
 #if  !_IO_UNIFIED_JUMPTABLES
   new_f->fp.vtable = NULL;
 #endif
   if (_IO_old_file_attach (&new_f->fp.file, fd) == NULL)
     {
-      _IO_un_link (&new_f->fp.file);
+      _IO_un_link (&new_f->fp);
       free (new_f);
       return NULL;
     }
@@ -130,7 +130,7 @@ _IO_old_fdopen (fd, mode)
     _IO_mask_flags (&new_f->fp.file, read_write,
                    _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
 
-  return &new_f->fp.file;
+  return (_IO_FILE *) &new_f->fp;
 }
 
 strong_alias (_IO_old_fdopen, __old_fdopen)
index 18e4b99a8ffa4a7102726877a2d9a229d05bd182..5f91aaca1d0cd64e760272df107c5d4eb13c1e65 100644 (file)
@@ -52,14 +52,14 @@ _IO_old_fopen (filename, mode)
   new_f->fp.file._lock = &new_f->lock;
 #endif
   _IO_init (&new_f->fp.file, 0);
-  _IO_JUMPS (&new_f->fp.file) = &_IO_old_file_jumps;
-  _IO_old_file_init (&new_f->fp.file);
+  _IO_JUMPS (&new_f->fp) = &_IO_old_file_jumps;
+  _IO_old_file_init (&new_f->fp);
 #if  !_IO_UNIFIED_JUMPTABLES
   new_f->fp.vtable = NULL;
 #endif
-  if (_IO_old_file_fopen (&new_f->fp.file, filename, mode) != NULL)
-        return &new_f->fp.file;
-  _IO_un_link (&new_f->fp.file);
+  if (_IO_old_file_fopen ((_IO_FILE *) &new_f->fp, filename, mode) != NULL)
+    return (_IO_FILE *) &new_f->fp;
+  _IO_un_link (&new_f->fp);
   free (new_f);
   return NULL;
 }
index 1e6f13358f1e4e761448f37d9a1458578f901246..0424b507e30b9665ea8aa92398a15b866afd3727 100644 (file)
@@ -203,14 +203,14 @@ _IO_old_popen (command, mode)
 #endif
   fp = &new_f->fpx.file.file;
   _IO_init (fp, 0);
-  _IO_JUMPS (fp) = &_IO_old_proc_jumps;
-  _IO_old_file_init (fp);
+  _IO_JUMPS (&new_f->fpx.file) = &_IO_old_proc_jumps;
+  _IO_old_file_init (&new_f->fpx.file);
 #if  !_IO_UNIFIED_JUMPTABLES
   new_f->fpx.file.vtable = NULL;
 #endif
   if (_IO_old_proc_open (fp, command, mode) != NULL)
     return fp;
-  _IO_un_link (fp);
+  _IO_un_link (&new_f->fpx.file);
   free (new_f);
   return NULL;
 }
index 0d5f763840a0d257d505e1157fe935527125462a..f9c1befd7bcfdb5ee85daaf6790f1dd8c662d846 100644 (file)
@@ -48,9 +48,8 @@
 #endif
 
 DEF_STDFILE(_IO_stdin_, 0, 0, _IO_NO_WRITES);
-DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_.file, _IO_NO_READS);
-DEF_STDFILE(_IO_stderr_, 2, &_IO_stdout_.file,
-           _IO_NO_READS+_IO_UNBUFFERED);
+DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_, _IO_NO_READS);
+DEF_STDFILE(_IO_stderr_, 2, &_IO_stdout_, _IO_NO_READS+_IO_UNBUFFERED);
 
 #if defined __GNUC__ && __GNUC__ >= 2
 
@@ -67,7 +66,7 @@ extern FILE *stdin;
 extern FILE *stdout;
 extern FILE *stderr;
 
-extern FILE *_IO_list_all;
+extern struct _IO_FILE_plus *_IO_list_all;
 
 static void _IO_check_libio __P ((void)) __attribute__ ((constructor));
 
@@ -81,9 +80,10 @@ _IO_check_libio ()
   if (&_IO_stdin_used == NULL)
     {
       /* We are using the old one. */
-      _IO_stdin = stdin = &_IO_stdin_.file;
-      _IO_stdout = stdout = &_IO_stdout_.file;
-      _IO_stderr = stderr = _IO_list_all = &_IO_stderr_.file;
+      _IO_stdin = stdin = (_IO_FILE *) &_IO_stdin_;
+      _IO_stdout = stdout = (_IO_FILE *) &_IO_stdout_;
+      _IO_stderr = stderr = (_IO_FILE *) &_IO_stderr_;
+      _IO_list_all = &_IO_stderr_;
       _IO_stdin->_vtable_offset = _IO_stdout->_vtable_offset =
        _IO_stderr->_vtable_offset = stdin->_vtable_offset =
        stdout->_vtable_offset = stderr->_vtable_offset =
index 6feff4d3924adb62f2da41589f94cb323fe39f18..866746d437e17d9aab48245aadf03df8ff7d090d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1994, 1996, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1994, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -50,8 +50,7 @@
 #endif
 
 DEF_STDFILE(_IO_2_1_stdin_, 0, 0, _IO_NO_WRITES);
-DEF_STDFILE(_IO_2_1_stdout_, 1, &_IO_2_1_stdin_.file, _IO_NO_READS);
-DEF_STDFILE(_IO_2_1_stderr_, 2, &_IO_2_1_stdout_.file,
-            _IO_NO_READS+_IO_UNBUFFERED);
+DEF_STDFILE(_IO_2_1_stdout_, 1, &_IO_2_1_stdin_, _IO_NO_READS);
+DEF_STDFILE(_IO_2_1_stderr_, 2, &_IO_2_1_stdout_, _IO_NO_READS+_IO_UNBUFFERED);
 
-_IO_FILE *_IO_list_all = &_IO_2_1_stderr_.file;
+struct _IO_FILE_plus *_IO_list_all = &_IO_2_1_stderr_;
index d4358c56d7794be136db3aa0dd3cfca0f31de1d5..79d605de05b75426a5b28e3f3ea584c19ad3a1b3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1994, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1994, 1996, 1997, 2000 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -29,9 +29,9 @@
 #undef stdin
 #undef stdout
 #undef stderr
-FILE *stdin = &_IO_2_1_stdin_.file;
-FILE *stdout = &_IO_2_1_stdout_.file;
-FILE *stderr = &_IO_2_1_stderr_.file;
+FILE *stdin = (FILE *) &_IO_2_1_stdin_;
+FILE *stdout = (FILE *) &_IO_2_1_stdout_;
+FILE *stderr = (FILE *) &_IO_2_1_stderr_;
 
 #undef _IO_stdin
 #undef _IO_stdout
index 83fd794251348906d0f251f984406013576706f9..7c49bd5d2c0a90488396c4121322120b9686c550 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
 #endif
 
 void
-_IO_str_init_static (fp, ptr, size, pstart)
-     _IO_FILE *fp;
+_IO_str_init_static (sf, ptr, size, pstart)
+     _IO_strfile *sf;
      char *ptr;
      int size;
      char *pstart;
 {
+  _IO_FILE *fp = &sf->_sbf._f;
+
   if (size == 0)
     size = strlen (ptr);
   else if (size < 0)
@@ -102,17 +104,17 @@ _IO_str_init_static (fp, ptr, size, pstart)
       fp->_IO_read_end = ptr+size;
     }
   /* A null _allocate_buffer function flags the strfile as being static. */
-  (((_IO_strfile *) fp)->_s._allocate_buffer) =  (_IO_alloc_type)0;
+  sf->_s._allocate_buffer = (_IO_alloc_type) 0;
 }
 
 void
-_IO_str_init_readonly (fp, ptr, size)
-     _IO_FILE *fp;
+_IO_str_init_readonly (sf, ptr, size)
+     _IO_strfile *sf;
      const char *ptr;
      int size;
 {
-  _IO_str_init_static (fp, (char *) ptr, size, NULL);
-  fp->_IO_file_flags |= _IO_NO_WRITES;
+  _IO_str_init_static (sf, (char *) ptr, size, NULL);
+  sf->_sbf._f._IO_file_flags |= _IO_NO_WRITES;
 }
 
 int
index fb3109e0a41c0ac234a256f64ce9fc7b9b17ab82..d1bf67132da9efde25898ae67ba65c1427f320fd 100644 (file)
@@ -52,9 +52,9 @@ _IO_vasprintf (result_ptr, format, args)
 #ifdef _IO_MTSAFE_IO
   sf._sbf._f._lock = &lock;
 #endif
-  _IO_no_init ((_IO_FILE *) &sf, 0, -1, NULL, NULL);
-  _IO_JUMPS ((_IO_FILE *) &sf) = &_IO_str_jumps;
-  _IO_str_init_static ((_IO_FILE *) &sf, string, init_string_size, string);
+  _IO_no_init ((_IO_FILE *) &sf._sbf, 0, -1, NULL, NULL);
+  _IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
+  _IO_str_init_static (&sf, string, init_string_size, string);
   sf._sbf._f._flags &= ~_IO_USER_BUF;
   sf._s._allocate_buffer = (_IO_alloc_type) malloc;
   sf._s._free_buffer = (_IO_free_type) free;
index 8cf21d31c36e96c4d280838fbdcb064993190761..6a45a3a1990e3947f23f8174473fd0f1a183f3cb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1997, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -123,9 +123,9 @@ _IO_vsnprintf (string, maxlen, format, args)
     }
 
   _IO_no_init (&sf.f._sbf._f, 0, -1, NULL, NULL);
-  _IO_JUMPS (&sf.f._sbf._f) = &_IO_strn_jumps;
+  _IO_JUMPS ((struct _IO_FILE_plus *) &sf.f._sbf) = &_IO_strn_jumps;
   string[0] = '\0';
-  _IO_str_init_static (&sf.f._sbf._f, string, maxlen - 1, string);
+  _IO_str_init_static (&sf.f, string, maxlen - 1, string);
   ret = _IO_vfprintf (&sf.f._sbf._f, format, args);
 
   if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
index 6144a1014e2f0295f1d598c7efde79d3440a51e9..f822c8d9870247045c35e86b0196ba77c58b70d9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
    Written by Ulrich Drepper <drepper@cygnus.com>.
    Based on the single byte version by Per Bothner <bothner@cygnus.com>.
@@ -207,7 +207,7 @@ _IO_wdefault_finish (fp, dummy)
   _IO_lock_fini (*fp->_lock);
 #endif
 
-  _IO_un_link (fp);
+  _IO_un_link ((struct _IO_FILE_plus *) fp);
 }
 
 
index c2cf1a24472c8cce82837f2bd6f83d080b95d6f8..0f35de664441f9573bcc702b2c263a67a3637559 100644 (file)
@@ -310,7 +310,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
       do                                                                     \
        {                                                                     \
          int offset;                                                         \
-         void *ptr;                                                          \
+         void *__unbounded ptr;                                              \
          spec = (ChExpr);                                                    \
          offset = NOT_IN_JUMP_RANGE (spec) ? REF (form_unknown)              \
            : table[CHAR_CLASS (spec)];                                       \
@@ -323,7 +323,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
 # define JUMP(ChExpr, table)                                                 \
       do                                                                     \
        {                                                                     \
-         const void *ptr;                                                    \
+         const void *__unbounded ptr;                                        \
          spec = (ChExpr);                                                    \
          ptr = NOT_IN_JUMP_RANGE (spec) ? REF (form_unknown)                 \
            : table[CHAR_CLASS (spec)];                                       \
@@ -1971,7 +1971,7 @@ buffered_vfprintf (register _IO_FILE *s, const CHAR_T *format,
 {
   CHAR_T buf[_IO_BUFSIZ];
   struct helper_file helper;
-  register _IO_FILE *hp = &helper._f.file;
+  register _IO_FILE *hp = (_IO_FILE *) &helper._f;
   int result, to_flush;
 
   /* Initialize helper.  */
@@ -1991,7 +1991,7 @@ buffered_vfprintf (register _IO_FILE *s, const CHAR_T *format,
   hp->_lock = &helper.lock;
   __libc_lock_init (*hp->_lock);
 #endif
-  _IO_JUMPS (hp) = (struct _IO_jump_t *) &_IO_helper_jumps;
+  _IO_JUMPS (&helper._f) = (struct _IO_jump_t *) &_IO_helper_jumps;
 
   /* Now print to helper instead.  */
   result = vfprintf (hp, format, args);
index 319736dc82adb99193e5be8e90baf8569e32fa81..50b87dff827ea99ea09b7886c783e8caf7a265fc 100644 (file)
@@ -511,8 +511,8 @@ __strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
       /* Print the number.  */
 #ifdef USE_IN_LIBIO
       _IO_init ((_IO_FILE *) &f, 0);
-      _IO_JUMPS ((_IO_FILE *) &f) = &_IO_str_jumps;
-      _IO_str_init_static ((_IO_FILE *) &f, dest, (s + maxsize) - dest, dest);
+      _IO_JUMPS ((struct _IO_FILE_plus *) &f) = &_IO_str_jumps;
+      _IO_str_init_static ((_IO_strfile *) &f, dest, (s + maxsize) - dest, dest);
 #else
       memset ((void *) &f, 0, sizeof (f));
       f.__magic = _IOMAGIC;