diff options
author | Paolo Carlini <pcarlini@unitus.it> | 2003-04-21 20:11:51 +0200 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2003-04-21 18:11:51 +0000 |
commit | 9d3e38ec5905091e273f149c7b0c740ae95a3555 (patch) | |
tree | 2222e55ad42f4274905c073f232d639b36f99c7c | |
parent | 337f4314e6b3bd6dc10a36806aacaa62b1025ad3 (diff) | |
download | gcc-9d3e38ec5905091e273f149c7b0c740ae95a3555.zip gcc-9d3e38ec5905091e273f149c7b0c740ae95a3555.tar.gz gcc-9d3e38ec5905091e273f149c7b0c740ae95a3555.tar.bz2 |
std_streambuf.h (uflow()): It's used only by basic_stringbuf (i.e....
2003-04-21 Paolo Carlini <pcarlini@unitus.it>
* include/std/std_streambuf.h (uflow()): It's used only by
basic_stringbuf (i.e., basic_filebuf provide its own uflow()),
therefore do not consider the _M_buf_unified == true case.
* include/std/std_streambuf.h (sgetc()): Restore __ret variable.
From-SVN: r65891
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/std/std_streambuf.h | 14 |
2 files changed, 14 insertions, 8 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f82d67c..5b18668 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2003-04-21 Paolo Carlini <pcarlini@unitus.it> + + * include/std/std_streambuf.h (uflow()): It's used only by + basic_stringbuf (i.e., basic_filebuf provide its own uflow()), + therefore do not consider the _M_buf_unified == true case. + + * include/std/std_streambuf.h (sgetc()): Restore __ret variable. + 2003-04-20 Paolo Carlini <pcarlini@unitus.it> * docs/html/ext/howto.html ('LWG Issues'): diff --git a/libstdc++-v3/include/std/std_streambuf.h b/libstdc++-v3/include/std/std_streambuf.h index 658b02f4..ded94a4 100644 --- a/libstdc++-v3/include/std/std_streambuf.h +++ b/libstdc++-v3/include/std/std_streambuf.h @@ -234,8 +234,7 @@ namespace std * @if maint * Necessary bits for putback buffer management. Only used in * the basic_filebuf class, as necessary for the standard - * requirements. The only basic_streambuf member function that - * needs access to these data members is in_avail... + * requirements. * * @note pbacks of over one character are not currently supported. * @endif @@ -452,10 +451,12 @@ namespace std int_type sgetc() { + int_type __ret; if (_M_in_cur < _M_in_end) - return traits_type::to_int_type(*(this->gptr())); + __ret = traits_type::to_int_type(*(this->gptr())); else - return this->underflow(); + __ret = this->underflow(); + return __ret; } /** @@ -787,13 +788,10 @@ namespace std int_type __ret = traits_type::eof(); const bool __testeof = traits_type::eq_int_type(this->underflow(), __ret); - const bool __testpending = _M_in_cur < _M_in_end; - if (!__testeof && __testpending) + if (!__testeof && _M_in_cur < _M_in_end) { __ret = traits_type::to_int_type(*_M_in_cur); ++_M_in_cur; - if (_M_buf_unified && _M_mode & ios_base::out) - ++_M_out_cur; } return __ret; } |