Commit 07c2b60d by Paolo Carlini Committed by Paolo Carlini

Consistently use _M_in_beg instead of eback(), _M_in_cur instead of gptr(), and so on.

2003-04-21  Paolo Carlini  <pcarlini@unitus.it>

	Consistently use _M_in_beg instead of eback(), _M_in_cur
	instead of gptr(), and so on.
	* include/bits/fstream.tcc (pbackfail, imbue): Here.
	* include/bits/sstream.tcc (pbackfail, seekoff, seekpos): Ditto.
	* include/bits/streambuf.tcc (sbumpc, sputbackc,
	__copy_streambufs): Ditto.
	* include/std/std_streambuf.h (sgetc): Ditto.

From-SVN: r65909
parent 63f60ecb
2003-04-21 Paolo Carlini <pcarlini@unitus.it> 2003-04-21 Paolo Carlini <pcarlini@unitus.it>
Consistently use _M_in_beg instead of eback(), _M_in_cur
instead of gptr(), and so on.
* include/bits/fstream.tcc (pbackfail, imbue): Here.
* include/bits/sstream.tcc (pbackfail, seekoff, seekpos): Ditto.
* include/bits/streambuf.tcc (sbumpc, sputbackc,
__copy_streambufs): Ditto.
* include/std/std_streambuf.h (sgetc): Ditto.
2003-04-21 Paolo Carlini <pcarlini@unitus.it>
* include/bits/sstream.tcc (pbackfail, overflow): * include/bits/sstream.tcc (pbackfail, overflow):
Formatting fixes. Formatting fixes.
......
...@@ -189,7 +189,7 @@ namespace std ...@@ -189,7 +189,7 @@ namespace std
if (__testpb) if (__testpb)
{ {
const bool __testout = this->_M_mode & ios_base::out; const bool __testout = this->_M_mode & ios_base::out;
const bool __testeq = traits_type::eq(__c, this->gptr()[-1]); const bool __testeq = traits_type::eq(__c, this->_M_in_cur[-1]);
// Try to put back __c into input sequence in one of three ways. // Try to put back __c into input sequence in one of three ways.
// Order these tests done in is unspecified by the standard. // Order these tests done in is unspecified by the standard.
...@@ -520,7 +520,8 @@ namespace std ...@@ -520,7 +520,8 @@ namespace std
basic_filebuf<_CharT, _Traits>:: basic_filebuf<_CharT, _Traits>::
imbue(const locale& __loc) imbue(const locale& __loc)
{ {
const bool __testbeg = gptr() == eback() && pptr() == pbase(); const bool __testbeg = this->_M_in_cur == this->_M_in_beg
&& this->_M_out_cur == this->_M_out_beg;
if (__testbeg && this->_M_buf_locale != __loc) if (__testbeg && this->_M_buf_locale != __loc)
this->_M_buf_locale = __loc; this->_M_buf_locale = __loc;
......
...@@ -55,7 +55,8 @@ namespace std ...@@ -55,7 +55,8 @@ namespace std
// Order these tests done in is unspecified by the standard. // Order these tests done in is unspecified by the standard.
if (__testpos) if (__testpos)
{ {
if (traits_type::eq(traits_type::to_char_type(__c), this->gptr()[-1]) if (traits_type::eq(traits_type::to_char_type(__c),
this->_M_in_cur[-1])
&& !__testeof) && !__testeof)
{ {
--this->_M_in_cur; --this->_M_in_cur;
...@@ -139,14 +140,14 @@ namespace std ...@@ -139,14 +140,14 @@ namespace std
if (__testin || __testboth) if (__testin || __testboth)
{ {
__curi = this->gptr(); __curi = this->_M_in_cur;
__endi = this->egptr(); __endi = this->_M_in_end;
} }
if (__testout || __testboth) if (__testout || __testboth)
{ {
__curo = this->pptr(); __curo = this->_M_out_cur;
// Due to the resolution of DR169, ios_base::end // Due to the resolution of DR169, ios_base::end
// is this->_M_out_lim, not epptr(). // is this->_M_out_lim, not _M_out_end.
__endo = this->_M_out_lim; __endo = this->_M_out_lim;
} }
...@@ -199,15 +200,15 @@ namespace std ...@@ -199,15 +200,15 @@ namespace std
bool __testposo = false; bool __testposo = false;
if (__testin) if (__testin)
{ {
__beg = this->eback(); __beg = this->_M_in_beg;
__end = this->egptr(); __end = this->_M_in_end;
if (0 <= __pos && __pos <= __end - __beg) if (0 <= __pos && __pos <= __end - __beg)
__testposi = true; __testposi = true;
} }
if (__testout) if (__testout)
{ {
__beg = this->pbase(); __beg = this->_M_out_beg;
__end = this->epptr(); __end = this->_M_out_end;
if (0 <= __pos && __pos <= __end - __beg) if (0 <= __pos && __pos <= __end - __beg)
__testposo = true; __testposo = true;
} }
......
...@@ -51,7 +51,7 @@ namespace std ...@@ -51,7 +51,7 @@ namespace std
int_type __ret; int_type __ret;
if (_M_in_cur < _M_in_end) if (_M_in_cur < _M_in_end)
{ {
char_type __c = *(this->gptr()); char_type __c = *this->_M_in_cur;
_M_in_cur_move(1); _M_in_cur_move(1);
__ret = traits_type::to_int_type(__c); __ret = traits_type::to_int_type(__c);
} }
...@@ -67,12 +67,12 @@ namespace std ...@@ -67,12 +67,12 @@ namespace std
{ {
int_type __ret; int_type __ret;
const bool __testpos = _M_in_beg < _M_in_cur; const bool __testpos = _M_in_beg < _M_in_cur;
if (!__testpos || !traits_type::eq(__c, this->gptr()[-1])) if (!__testpos || !traits_type::eq(__c, this->_M_in_cur[-1]))
__ret = this->pbackfail(traits_type::to_int_type(__c)); __ret = this->pbackfail(traits_type::to_int_type(__c));
else else
{ {
_M_in_cur_move(-1); _M_in_cur_move(-1);
__ret = traits_type::to_int_type(*this->gptr()); __ret = traits_type::to_int_type(*this->_M_in_cur);
} }
return __ret; return __ret;
} }
...@@ -201,10 +201,10 @@ namespace std ...@@ -201,10 +201,10 @@ namespace std
{ {
while (__in_avail != -1) while (__in_avail != -1)
{ {
if (__in_avail != 0 && __sbin->gptr() if (__in_avail != 0 && __sbin->_M_in_cur
&& __sbin->gptr() + __in_avail <= __sbin->egptr()) && __sbin->_M_in_cur + __in_avail <= __sbin->_M_in_end)
{ {
__xtrct = __sbout->sputn(__sbin->gptr(), __in_avail); __xtrct = __sbout->sputn(__sbin->_M_in_cur, __in_avail);
__ret += __xtrct; __ret += __xtrct;
__sbin->_M_in_cur_move(__xtrct); __sbin->_M_in_cur_move(__xtrct);
if (__xtrct != __in_avail) if (__xtrct != __in_avail)
......
...@@ -453,7 +453,7 @@ namespace std ...@@ -453,7 +453,7 @@ namespace std
{ {
int_type __ret; int_type __ret;
if (_M_in_cur < _M_in_end) if (_M_in_cur < _M_in_end)
__ret = traits_type::to_int_type(*(this->gptr())); __ret = traits_type::to_int_type(*this->_M_in_cur);
else else
__ret = this->underflow(); __ret = this->underflow();
return __ret; return __ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment