aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2003-11-27 13:13:19 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2003-11-27 13:13:19 +0000
commitfb8d46385113884eb18abef5bee948c955f298ae (patch)
treec4f7959860d4d931d25bdf463d4e76f43b1b39fa
parent81a5b587efda1d6462869fcbb78379fe99d35351 (diff)
downloadgcc-fb8d46385113884eb18abef5bee948c955f298ae.zip
gcc-fb8d46385113884eb18abef5bee948c955f298ae.tar.gz
gcc-fb8d46385113884eb18abef5bee948c955f298ae.tar.bz2
std_streambuf.h (__copy_streambufs): Remove the first, unused, basic_ios<> parameter.
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
-rw-r--r--libstdc++-v3/ChangeLog14
-rw-r--r--libstdc++-v3/include/bits/istream.tcc2
-rw-r--r--libstdc++-v3/include/bits/ostream.tcc2
-rw-r--r--libstdc++-v3/include/bits/streambuf.tcc48
-rw-r--r--libstdc++-v3/include/std/std_streambuf.h7
-rw-r--r--libstdc++-v3/src/streambuf-inst.cc4
6 files changed, 42 insertions, 35 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index fd4aaaf..8d8a4b1 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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
diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc
index 4055ca7..0d85cc1 100644
--- a/libstdc++-v3/include/bits/istream.tcc
+++ b/libstdc++-v3/include/bits/istream.tcc
@@ -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(...)
diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc
index fecaa93..c7da8c6 100644
--- a/libstdc++-v3/include/bits/ostream.tcc
+++ b/libstdc++-v3/include/bits/ostream.tcc
@@ -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(...)
diff --git a/libstdc++-v3/include/bits/streambuf.tcc b/libstdc++-v3/include/bits/streambuf.tcc
index 559c5b9..494b9f0 100644
--- a/libstdc++-v3/include/bits/streambuf.tcc
+++ b/libstdc++-v3/include/bits/streambuf.tcc
@@ -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
diff --git a/libstdc++-v3/include/std/std_streambuf.h b/libstdc++-v3/include/std/std_streambuf.h
index 23b9821..fe82b3b 100644
--- a/libstdc++-v3/include/std/std_streambuf.h
+++ b/libstdc++-v3/include/std/std_streambuf.h
@@ -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:
//@{
diff --git a/libstdc++-v3/src/streambuf-inst.cc b/libstdc++-v3/src/streambuf-inst.cc
index 49cb605..5d1879a 100644
--- a/libstdc++-v3/src/streambuf-inst.cc
+++ b/libstdc++-v3/src/streambuf-inst.cc
@@ -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