aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@unitus.it>2003-06-11 00:00:43 +0200
committerPaolo Carlini <paolo@gcc.gnu.org>2003-06-10 22:00:43 +0000
commit1f0ef6511785148cafa23846a26f9e331c7e4d6d (patch)
tree5b58dfe6d9667340a91ac1704b87da6a4ba7cb96
parent3b1b059cc3be458670373def6dbe5a3dedf0bb3b (diff)
downloadgcc-1f0ef6511785148cafa23846a26f9e331c7e4d6d.zip
gcc-1f0ef6511785148cafa23846a26f9e331c7e4d6d.tar.gz
gcc-1f0ef6511785148cafa23846a26f9e331c7e4d6d.tar.bz2
fstream.tcc (close): Clean up a bit.
2003-06-10 Paolo Carlini <pcarlini@unitus.it> * include/bits/fstream.tcc (close): Clean up a bit. * include/bits/streambuf.tcc (sbumpc): Clean up a bit. * include/std/std_fstream.h (_M_destroy_pback): _M_pback_cur_save - the saved _M_in_cur, that is - cannot be null. (sync): Constify a variable. * include/std/std_streambuf.h: Tweak a comment. (in_avail): Constify a variable. From-SVN: r67738
-rw-r--r--libstdc++-v3/ChangeLog13
-rw-r--r--libstdc++-v3/include/bits/fstream.tcc5
-rw-r--r--libstdc++-v3/include/bits/streambuf.tcc3
-rw-r--r--libstdc++-v3/include/std/std_fstream.h5
-rw-r--r--libstdc++-v3/include/std/std_streambuf.h4
5 files changed, 20 insertions, 10 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 62f3dc2..0c01a43 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,16 @@
+2003-06-10 Paolo Carlini <pcarlini@unitus.it>
+
+ * include/bits/fstream.tcc (close): Clean up a bit.
+
+ * include/bits/streambuf.tcc (sbumpc): Clean up a bit.
+
+ * include/std/std_fstream.h (_M_destroy_pback): _M_pback_cur_save
+ - the saved _M_in_cur, that is - cannot be null.
+ (sync): Constify a variable.
+
+ * include/std/std_streambuf.h: Tweak a comment.
+ (in_avail): Constify a variable.
+
2003-06-10 Phil Edwards <pme@gcc.gnu.org>
* docs/html/17_intro/BUGS: Update from 2.90.8 snapshot.
diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc
index 46dbdb21..908cc75 100644
--- a/libstdc++-v3/include/bits/fstream.tcc
+++ b/libstdc++-v3/include/bits/fstream.tcc
@@ -120,13 +120,12 @@ namespace std
bool __testfail = false;
try
{
- const int_type __eof = traits_type::eof();
const bool __testput = this->_M_out_beg < this->_M_out_lim;
if (__testput
- && traits_type::eq_int_type(this->overflow(), __eof))
+ && traits_type::eq_int_type(this->overflow(),
+ traits_type::eof()))
__testfail = true;
-
#if 0
// XXX not done
if (_M_last_overflowed)
diff --git a/libstdc++-v3/include/bits/streambuf.tcc b/libstdc++-v3/include/bits/streambuf.tcc
index 5b76c40..f6a96e8 100644
--- a/libstdc++-v3/include/bits/streambuf.tcc
+++ b/libstdc++-v3/include/bits/streambuf.tcc
@@ -47,9 +47,8 @@ namespace std
int_type __ret;
if (_M_in_cur < _M_in_end)
{
- char_type __c = *this->_M_in_cur;
+ __ret = traits_type::to_int_type(*this->_M_in_cur);
_M_move_in_cur(1);
- __ret = traits_type::to_int_type(__c);
}
else
__ret = this->uflow();
diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h
index fe72e9d..7cc0dbd 100644
--- a/libstdc++-v3/include/std/std_fstream.h
+++ b/libstdc++-v3/include/std/std_fstream.h
@@ -191,8 +191,7 @@ namespace std
if (_M_pback_init)
{
// Length _M_in_cur moved in the pback buffer.
- if (_M_pback_cur_save)
- _M_pback_cur_save += this->_M_in_cur != this->_M_in_beg;
+ _M_pback_cur_save += this->_M_in_cur != this->_M_in_beg;
this->setg(this->_M_buf, _M_pback_cur_save, _M_pback_end_save);
_M_pback_init = false;
}
@@ -373,7 +372,7 @@ namespace std
if (__testput)
{
// Need to restore current position after the write.
- off_type __off = this->_M_out_cur - this->_M_out_lim;
+ const off_type __off = this->_M_out_cur - this->_M_out_lim;
// _M_file.sync() will be called within.
if (traits_type::eq_int_type(this->overflow(), traits_type::eof()))
diff --git a/libstdc++-v3/include/std/std_streambuf.h b/libstdc++-v3/include/std/std_streambuf.h
index b39ff92..2092807 100644
--- a/libstdc++-v3/include/std/std_streambuf.h
+++ b/libstdc++-v3/include/std/std_streambuf.h
@@ -181,7 +181,7 @@ namespace std
* @if maint
* setp (and _M_set_buffer(0) in basic_filebuf) set it equal to
* _M_out_beg, then at each put operation it may be moved
- * forward (toward _M_out_end) by _M_out_cur_move.
+ * forward (toward _M_out_end) by _M_move_out_cur.
* @endif
*/
char_type* _M_out_lim; // End limit of used put area.
@@ -328,7 +328,7 @@ namespace std
streamsize
in_avail()
{
- streamsize __ret = _M_in_end - _M_in_cur;
+ const streamsize __ret = _M_in_end - _M_in_cur;
return __ret ? __ret : this->showmanyc();
}