From 631693d58d5f3f5c3474487b28a47b21acdcef1c Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sun, 30 Mar 2003 10:32:11 +0200 Subject: [PATCH] fstream.tcc (basic_filebuf::showmanyc, [...]): Fix test for synced buffer. 2003-03-30 Paolo Carlini * include/bits/fstream.tcc (basic_filebuf::showmanyc, _M_convert_to_external, _M_really_overflow, seekoff): Fix test for synced buffer. * include/std/std_fstream.h (sync): Likewise. * src/fstream.cc (basic_filebuf::_M_underflow_common, basic_filebuf::_M_underflow_common): Likewise. From-SVN: r65038 --- libstdc++-v3/ChangeLog | 9 +++++++++ libstdc++-v3/include/bits/fstream.tcc | 8 ++++---- libstdc++-v3/include/std/std_fstream.h | 2 +- libstdc++-v3/src/fstream.cc | 4 ++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 30a8b3ba689..09ef061d96f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2003-03-30 Paolo Carlini + + * include/bits/fstream.tcc (basic_filebuf::showmanyc, + _M_convert_to_external, _M_really_overflow, seekoff): Fix + test for synced buffer. + * include/std/std_fstream.h (sync): Likewise. + * src/fstream.cc (basic_filebuf::_M_underflow_common, + basic_filebuf::_M_underflow_common): Likewise. + 2003-03-28 Benjamin Kosnik * include/std/std_sstream.h (basic_istringstream): Adjust diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index b5529de35ef..f1b65a1a558 100644 --- a/libstdc++-v3/include/bits/fstream.tcc +++ b/libstdc++-v3/include/bits/fstream.tcc @@ -160,7 +160,7 @@ namespace std const locale __loc = this->getloc(); const __codecvt_type& __cvt = use_facet<__codecvt_type>(__loc); // Sync with stdio. - bool __sync = this->_M_buf_size == 1; + bool __sync = this->_M_buf_size <= 1; if (__testin && this->is_open()) { @@ -285,7 +285,7 @@ namespace std const locale __loc = this->getloc(); const __codecvt_type& __cvt = use_facet<__codecvt_type>(__loc); // Sync with stdio. - bool __sync = this->_M_buf_size == 1; + bool __sync = this->_M_buf_size <= 1; if (__cvt.always_noconv() && __ilen) { @@ -358,7 +358,7 @@ namespace std bool __testput = this->_M_out_cur && this->_M_out_beg < this->_M_out_lim; bool __testunbuffered = _M_file.is_open() && !this->_M_buf_size_opt; // Sync with stdio. - bool __sync = this->_M_buf_size == 1; + bool __sync = this->_M_buf_size <= 1; if (__testput || __testunbuffered) { @@ -448,7 +448,7 @@ namespace std bool __testin = (ios_base::in & this->_M_mode & __mode) != 0; bool __testout = (ios_base::out & this->_M_mode & __mode) != 0; // Sync with stdio. - bool __sync = this->_M_buf_size == 1; + bool __sync = this->_M_buf_size <= 1; // Should probably do has_facet checks here. int __width = use_facet<__codecvt_type>(this->_M_buf_locale).encoding(); diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h index 845a9147b8f..ecbaba4c510 100644 --- a/libstdc++-v3/include/std/std_fstream.h +++ b/libstdc++-v3/include/std/std_fstream.h @@ -315,7 +315,7 @@ namespace std bool __testput = this->_M_out_cur && this->_M_out_beg < this->_M_out_lim; // Sync with stdio. - bool __sync = this->_M_buf_size == 1; + bool __sync = this->_M_buf_size <= 1; // Make sure that the internal buffer resyncs its idea of // the file position with the external file. diff --git a/libstdc++-v3/src/fstream.cc b/libstdc++-v3/src/fstream.cc index 8280a662b70..0f9b2abd2c4 100644 --- a/libstdc++-v3/src/fstream.cc +++ b/libstdc++-v3/src/fstream.cc @@ -44,7 +44,7 @@ namespace std bool __testin = _M_mode & ios_base::in; bool __testout = _M_mode & ios_base::out; // Sync with stdio. - bool __sync = _M_buf_size == 1; + bool __sync = _M_buf_size <= 1; if (__testin) { @@ -126,7 +126,7 @@ namespace std bool __testin = _M_mode & ios_base::in; bool __testout = _M_mode & ios_base::out; // Sync with stdio. - bool __sync = _M_buf_size == 1; + bool __sync = _M_buf_size <= 1; if (__testin) {