summaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-07 12:48:58 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-07 12:48:58 +0000
commit27be8969a5993493a05cee0560474afca1bab06b (patch)
treed5347de6279f2d770da10bdb7d098bea9e9da6de /libstdc++-v3/src
parent784b199ffefab1ba6d200faa753305a2d3029cf5 (diff)
downloadgcc-27be8969a5993493a05cee0560474afca1bab06b.tar.gz
2003-05-07 Paolo Carlini <pcarlini@unitus.it>
* include/std/std_fstream.h (_M_is_indeterminate): Remove. * src/fstream.cc (basic_filebuf<char/wchar_t>::_M_underflow): Simplify: either there is no buffer or __testget == !__testinit. * src/fstream.cc (basic_filebuf<char/wchar_t>::_M_underflow): _M_set_determinate() automatically sets, if appropriate, _M_out_cur == _M_in_cur. * include/std/std_fstream.h (_M_destroy_pback): Don't set unnecessarily _M_pback_cur_save and _M_pback_end_save. * include/std/std_fstream.h (_M_set_determinate): Minor tweak. * include/std/std_sstream.h (_M_sync): Minor tweak. * include/bits/fstream.tcc (close): No need to call _M_destroy_pback, setting _M_pback_init to false suffices to clean up. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66557 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/fstream.cc10
1 files changed, 2 insertions, 8 deletions
diff --git a/libstdc++-v3/src/fstream.cc b/libstdc++-v3/src/fstream.cc
index 1f2a0001868..41ca7702233 100644
--- a/libstdc++-v3/src/fstream.cc
+++ b/libstdc++-v3/src/fstream.cc
@@ -64,7 +64,6 @@ namespace std
// Sync internal and external buffers.
// NB: __testget -> __testput as _M_buf_unified here.
const bool __testget = _M_in_beg < _M_in_cur;
- const bool __testinit = _M_is_indeterminate();
if (__testget)
{
if (__testout)
@@ -74,7 +73,7 @@ namespace std
ios_base::cur, __testsync, ios_base::in);
}
- if (__testinit || __testget)
+ if (_M_buf_size)
{
streamsize __elen = 0;
streamsize __ilen = 0;
@@ -86,8 +85,6 @@ namespace std
if (0 < __ilen)
{
_M_set_determinate(__ilen);
- if (__testout)
- _M_out_cur = _M_in_cur;
__ret = traits_type::to_int_type(*_M_in_cur);
if (__bump)
_M_move_in_cur(1);
@@ -145,7 +142,6 @@ namespace std
// Sync internal and external buffers.
// NB: __testget -> __testput as _M_buf_unified here.
const bool __testget = _M_in_beg < _M_in_cur;
- const bool __testinit = _M_is_indeterminate();
if (__testget)
{
if (__testout)
@@ -155,7 +151,7 @@ namespace std
ios_base::cur, __testsync, ios_base::in);
}
- if (__testinit || __testget)
+ if (_M_buf_size)
{
streamsize __elen = 0;
streamsize __ilen = 0;
@@ -191,8 +187,6 @@ namespace std
if (0 < __ilen)
{
_M_set_determinate(__ilen);
- if (__testout)
- _M_out_cur = _M_in_cur;
__ret = traits_type::to_int_type(*_M_in_cur);
if (__bump)
_M_move_in_cur(1);