std_streambuf.h (__copy_streambufs): Remove the first, unused, basic_ios<> parameter.
authorPaolo Carlini <pcarlini@suse.de>
Thu, 27 Nov 2003 13:13:19 +0000 (13:13 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 27 Nov 2003 13:13:19 +0000 (13:13 +0000)
2003-11-27  Paolo Carlini  <pcarlini@suse.de>

* include/std/std_streambuf.h (__copy_streambufs): Remove
the first, unused, basic_ios<> parameter.
* src/streambuf-inst.cc: Likewise.
* include/bits/streambuf.tcc: Likewise.
* include/bits/istream.tcc (operator>>(__streambuf_type*)):
Tweak accordingly the call.
* include/bits/ostream.tcc (operator<<(__streambuf_type*)):
Likewise.

* include/bits/streambuf.tcc (__copy_streambufs): Remove
redundant try/catch.

From-SVN: r73992

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/istream.tcc
libstdc++-v3/include/bits/ostream.tcc
libstdc++-v3/include/bits/streambuf.tcc
libstdc++-v3/include/std/std_streambuf.h
libstdc++-v3/src/streambuf-inst.cc

index fd4aaaf3d1ebf173e89139ded9c32717375b5364..8d8a4b15a4ecd8175c1c8d9ede6ba5930b528535 100644 (file)
@@ -1,3 +1,17 @@
+2003-11-27  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/std/std_streambuf.h (__copy_streambufs): Remove
+       the first, unused, basic_ios<> parameter.
+       * src/streambuf-inst.cc: Likewise.
+       * include/bits/streambuf.tcc: Likewise.
+       * include/bits/istream.tcc (operator>>(__streambuf_type*)):
+       Tweak accordingly the call.
+       * include/bits/ostream.tcc (operator<<(__streambuf_type*)):
+       Likewise.
+
+       * include/bits/streambuf.tcc (__copy_streambufs): Remove
+       redundant try/catch.
+
 2003-11-26  Benjamin Kosnik  <bkoz@redhat.com>
 
        PR libstdc++/9371
index 4055ca793086549b4f583e46c5e5fc645af714f5..0d85cc1bda1593f683ce15910c95619980102901 100644 (file)
@@ -409,7 +409,7 @@ namespace std
        {
          try
            {
-             if (!__copy_streambufs(*this, this->rdbuf(), __sbout))
+             if (!__copy_streambufs(this->rdbuf(), __sbout))
                __err |= ios_base::failbit;
            }
          catch(...)
index fecaa93eeeb53b49e4553facae6b3d25a82d02c0..c7da8c66011987e414907243274e6d03c6a08754 100644 (file)
@@ -304,7 +304,7 @@ namespace std
        {
          try
            {
-             if (!__copy_streambufs(*this, __sbin, this->rdbuf()))
+             if (!__copy_streambufs(__sbin, this->rdbuf()))
                __err |= ios_base::failbit;
            }
          catch(...)
index 559c5b9874fd6782a98e122618e05ae128e85141..494b9f0056df35d028c66532e5f89a16ebfcea43 100644 (file)
@@ -113,38 +113,32 @@ namespace std
   // necessary.
   template<typename _CharT, typename _Traits>
     streamsize
-    __copy_streambufs(basic_ios<_CharT, _Traits>& __ios,
-                     basic_streambuf<_CharT, _Traits>* __sbin,
+    __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
                      basic_streambuf<_CharT, _Traits>* __sbout) 
     {
       streamsize __ret = 0;
-      try 
+      typename _Traits::int_type __c = __sbin->sgetc();
+      while (!_Traits::eq_int_type(__c, _Traits::eof()))
        {
-         typename _Traits::int_type __c = __sbin->sgetc();
-         while (!_Traits::eq_int_type(__c, _Traits::eof()))
+         const size_t __n = __sbin->egptr() - __sbin->gptr();
+         if (__n > 1)
            {
-             const size_t __n = __sbin->egptr() - __sbin->gptr();
-             if (__n > 1)
-               {
-                 const size_t __wrote = __sbout->sputn(__sbin->gptr(), __n);
-                 __sbin->gbump(__wrote);
-                 __ret += __wrote;
-                 if (__wrote < __n)
-                   break;
-                 __c = __sbin->underflow();
-               }
-             else 
-               {
-                 __c = __sbout->sputc(_Traits::to_char_type(__c));
-                 if (_Traits::eq_int_type(__c, _Traits::eof()))
-                   break;
-                 ++__ret;
-                 __c = __sbin->snextc();
-               }
+             const size_t __wrote = __sbout->sputn(__sbin->gptr(), __n);
+             __sbin->gbump(__wrote);
+             __ret += __wrote;
+             if (__wrote < __n)
+               break;
+             __c = __sbin->underflow();
+           }
+         else 
+           {
+             __c = __sbout->sputc(_Traits::to_char_type(__c));
+             if (_Traits::eq_int_type(__c, _Traits::eof()))
+               break;
+             ++__ret;
+             __c = __sbin->snextc();
            }
        }
-      catch(...)
-       { __throw_exception_again; }
       return __ret;
     }
 
@@ -155,14 +149,14 @@ namespace std
   extern template class basic_streambuf<char>;
   extern template
     streamsize
-    __copy_streambufs(basic_ios<char>&, basic_streambuf<char>*,
+    __copy_streambufs(basic_streambuf<char>*,
                      basic_streambuf<char>*); 
 
 #ifdef _GLIBCXX_USE_WCHAR_T
   extern template class basic_streambuf<wchar_t>;
   extern template
     streamsize
-    __copy_streambufs(basic_ios<wchar_t>&, basic_streambuf<wchar_t>*,
+    __copy_streambufs(basic_streambuf<wchar_t>*,
                      basic_streambuf<wchar_t>*); 
 #endif
 #endif
index 23b982193def105da805cb6955f22703b23d8da0..fe82b3bcda043330d79bed9a17c3fdb00f8281a1 100644 (file)
@@ -56,8 +56,7 @@ namespace std
   */
   template<typename _CharT, typename _Traits>
     streamsize
-    __copy_streambufs(basic_ios<_CharT, _Traits>& _ios,
-                     basic_streambuf<_CharT, _Traits>* __sbin,
+    __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
                      basic_streambuf<_CharT, _Traits>* __sbout);
   
   /**
@@ -153,8 +152,8 @@ namespace std
       friend class ostreambuf_iterator<char_type, traits_type>;
 
       friend streamsize
-      __copy_streambufs<>(basic_ios<char_type, traits_type>& __ios,
-                         __streambuf_type* __sbin,__streambuf_type* __sbout);
+      __copy_streambufs<>(__streambuf_type* __sbin,
+                         __streambuf_type* __sbout);
       
     protected:
       //@{
index 49cb6052560bffc44fd81ad2abf0a602bd16b5a2..5d1879a6fae8bf6d630d93b20ddd1e54c3fb6985 100644 (file)
@@ -45,12 +45,12 @@ namespace std
 
   template
     streamsize
-    __copy_streambufs(basic_ios<char>&, basic_streambuf<char>*,
+    __copy_streambufs(basic_streambuf<char>*,
                      basic_streambuf<char>*); 
 #ifdef _GLIBCXX_USE_WCHAR_T
   template
     streamsize
-    __copy_streambufs(basic_ios<wchar_t>&, basic_streambuf<wchar_t>*,
+    __copy_streambufs(basic_streambuf<wchar_t>*,
                      basic_streambuf<wchar_t>*); 
 #endif
 } //std