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
This commit is contained in:
Paolo Carlini 2003-11-27 13:13:19 +00:00 committed by Paolo Carlini
parent 81a5b587ef
commit fb8d463851
6 changed files with 42 additions and 35 deletions

View 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

View 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(...)

View 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(...)

View 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

View 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:
//@{

View 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