This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[Patch] Minor clean up of basic_stringbuf::pbackfail
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 02 Jun 2003 20:01:41 +0200
- Subject: [Patch] Minor clean up of basic_stringbuf::pbackfail
Hi,
no changes of behaviour here, only a minor clean up, consistent
with the current basic_filebuf counterpart.
Tested x86-linux, if nobody complains will commit soon.
Paolo.
////////
2003-06-02 Paolo Carlini <pcarlini@unitus.it>
* include/bits/sstream.tcc (pbackfail): Minor clean up and
reformatting, consistent with basic_filebuf::pbackfail.
diff -prN libstdc++-v3-orig/include/bits/sstream.tcc libstdc++-v3/include/bits/sstream.tcc
*** libstdc++-v3-orig/include/bits/sstream.tcc Fri May 30 22:20:42 2003
--- libstdc++-v3/include/bits/sstream.tcc Mon Jun 2 19:39:02 2003
*************** namespace std
*** 47,64 ****
pbackfail(int_type __c)
{
int_type __ret = traits_type::eof();
! const bool __testeof = traits_type::eq_int_type(__c,
! traits_type::eof());
! const bool __testpos = this->_M_in_beg < this->_M_in_cur;
! // Try to put back __c into input sequence in one of three ways.
! // Order these tests done in is unspecified by the standard.
! if (__testpos)
{
const bool __testeq = traits_type::eq(traits_type::to_char_type(__c),
this->_M_in_cur[-1]);
-
--this->_M_in_cur;
if (!__testeof && __testeq)
__ret = __c;
else if (__testeof)
--- 47,62 ----
pbackfail(int_type __c)
{
int_type __ret = traits_type::eof();
! const bool __testeof = traits_type::eq_int_type(__c, __ret);
! if (this->_M_in_beg < this->_M_in_cur)
{
const bool __testeq = traits_type::eq(traits_type::to_char_type(__c),
this->_M_in_cur[-1]);
--this->_M_in_cur;
+
+ // Try to put back __c into input sequence in one of three ways.
+ // Order these tests done in is unspecified by the standard.
if (!__testeof && __testeq)
__ret = __c;
else if (__testeof)