fstream.tcc: Remove unnecessary qualifications for uglified data members of basic_filebuf...

2005-01-06  Benjamin Kosnik  <bkoz@redhat.com>

	* include/bits/fstream.tcc: Remove unnecessary qualifications for
	uglified data members of basic_filebuf, including _M_buf,
	_M_buf_size, _M_mode, _M_pback_init.
	* include/std/std_fstream.h: Same.

From-SVN: r93006
This commit is contained in:
Benjamin Kosnik 2005-01-06 20:40:25 +00:00 committed by Benjamin Kosnik
parent 0a57b6af88
commit a8e3a00f54
3 changed files with 41 additions and 34 deletions

View File

@ -1,3 +1,10 @@
2005-01-06 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/fstream.tcc: Remove unnecessary qualifications for
uglified data members of basic_filebuf, including _M_buf,
_M_buf_size, _M_mode, _M_pback_init.
* include/std/std_fstream.h: Same.
2005-01-05 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/testsuite_hooks.h:

View File

@ -1,6 +1,6 @@
// File based streams -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -51,9 +51,9 @@ namespace std
{
// Allocate internal buffer only if one doesn't already exist
// (either allocated or provided by the user via setbuf).
if (!_M_buf_allocated && !this->_M_buf)
if (!_M_buf_allocated && !_M_buf)
{
this->_M_buf = new char_type[this->_M_buf_size];
_M_buf = new char_type[_M_buf_size];
_M_buf_allocated = true;
}
}
@ -65,8 +65,8 @@ namespace std
{
if (_M_buf_allocated)
{
delete [] this->_M_buf;
this->_M_buf = NULL;
delete [] _M_buf;
_M_buf = NULL;
_M_buf_allocated = false;
}
delete [] _M_ext_buf;
@ -102,7 +102,7 @@ namespace std
if (this->is_open())
{
_M_allocate_internal_buffer();
this->_M_mode = __mode;
_M_mode = __mode;
// Setup initial buffer to 'uncommitted' mode.
_M_reading = false;
@ -142,8 +142,8 @@ namespace std
{ __testfail = true; }
// NB: Do this here so that re-opened filebufs will be cool...
this->_M_mode = ios_base::openmode(0);
this->_M_pback_init = false;
_M_mode = ios_base::openmode(0);
_M_pback_init = false;
_M_destroy_internal_buffer();
_M_reading = false;
_M_writing = false;
@ -165,7 +165,7 @@ namespace std
showmanyc()
{
streamsize __ret = -1;
const bool __testin = this->_M_mode & ios_base::in;
const bool __testin = _M_mode & ios_base::in;
if (__testin && this->is_open())
{
// For a stateful encoding (-1) the pending sequence might be just
@ -183,7 +183,7 @@ namespace std
underflow()
{
int_type __ret = traits_type::eof();
const bool __testin = this->_M_mode & ios_base::in;
const bool __testin = _M_mode & ios_base::in;
if (__testin && !_M_writing)
{
// Check for pback madness, and if so swich back to the
@ -195,8 +195,8 @@ namespace std
return traits_type::to_int_type(*this->gptr());
// Get and convert input sequence.
const size_t __buflen = this->_M_buf_size > 1
? this->_M_buf_size - 1 : 1;
const size_t __buflen = _M_buf_size > 1
? _M_buf_size - 1 : 1;
// Will be set to true if ::read() returns 0 indicating EOF.
bool __got_eof = false;
@ -333,12 +333,12 @@ namespace std
pbackfail(int_type __i)
{
int_type __ret = traits_type::eof();
const bool __testin = this->_M_mode & ios_base::in;
const bool __testin = _M_mode & ios_base::in;
if (__testin && !_M_writing)
{
// Remember whether the pback buffer is active, otherwise below
// we may try to store in it a second char (libstdc++/9761).
const bool __testpb = this->_M_pback_init;
const bool __testpb = _M_pback_init;
const bool __testeof = traits_type::eq_int_type(__i, __ret);
int_type __tmp;
if (this->eback() < this->gptr())
@ -386,7 +386,7 @@ namespace std
{
int_type __ret = traits_type::eof();
const bool __testeof = traits_type::eq_int_type(__c, __ret);
const bool __testout = this->_M_mode & ios_base::out;
const bool __testout = _M_mode & ios_base::out;
if (__testout && !_M_reading)
{
if (this->pbase() < this->pptr())
@ -407,7 +407,7 @@ namespace std
__ret = traits_type::not_eof(__c);
}
}
else if (this->_M_buf_size > 1)
else if (_M_buf_size > 1)
{
// Overflow in 'uncommitted' mode: set _M_writing, set
// the buffer to the initial 'write' mode, and put __c
@ -505,7 +505,7 @@ namespace std
{
// Clear out pback buffer before going on to the real deal...
streamsize __ret = 0;
if (this->_M_pback_init)
if (_M_pback_init)
{
if (__n > 0 && this->gptr() == this->eback())
{
@ -520,8 +520,8 @@ namespace std
// Optimization in the always_noconv() case, to be generalized in the
// future: when __n > __buflen we read directly instead of using the
// buffer repeatedly.
const bool __testin = this->_M_mode & ios_base::in;
const streamsize __buflen = this->_M_buf_size > 1 ? this->_M_buf_size - 1
const bool __testin = _M_mode & ios_base::in;
const streamsize __buflen = _M_buf_size > 1 ? _M_buf_size - 1
: 1;
if (__n > __buflen && __check_facet(_M_codecvt).always_noconv()
&& __testin && !_M_writing)
@ -575,7 +575,7 @@ namespace std
// future: when __n is sufficiently large we write directly instead of
// using the buffer.
streamsize __ret = 0;
const bool __testout = this->_M_mode & ios_base::out;
const bool __testout = _M_mode & ios_base::out;
if (__check_facet(_M_codecvt).always_noconv()
&& __testout && !_M_reading)
{
@ -584,8 +584,8 @@ namespace std
streamsize __bufavail = this->epptr() - this->pptr();
// Don't mistake 'uncommitted' mode buffered with unbuffered.
if (!_M_writing && this->_M_buf_size > 1)
__bufavail = this->_M_buf_size - 1;
if (!_M_writing && _M_buf_size > 1)
__bufavail = _M_buf_size - 1;
const streamsize __limit = std::min(__chunk, __bufavail);
if (__n >= __limit)
@ -620,7 +620,7 @@ namespace std
{
if (!this->is_open())
if (__s == 0 && __n == 0)
this->_M_buf_size = 1;
_M_buf_size = 1;
else if (__s && __n > 0)
{
// This is implementation-defined behavior, and assumes that
@ -631,8 +631,8 @@ namespace std
// position to host the overflow char of a full put area.
// When __n == 1, 1 position will be used for the get area
// and 0 for the put area, as in the unbuffered case above.
this->_M_buf = __s;
this->_M_buf_size = __n;
_M_buf = __s;
_M_buf_size = __n;
}
return this;
}
@ -831,7 +831,7 @@ namespace std
{
if (_M_codecvt_tmp
&& !__check_facet(_M_codecvt_tmp).always_noconv())
__testvalid = this->seekoff(0, ios_base::cur, this->_M_mode)
__testvalid = this->seekoff(0, ios_base::cur, _M_mode)
!= pos_type(off_type(-1));
}
else

View File

@ -1,6 +1,6 @@
// File based streams -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -217,7 +217,7 @@ namespace std
{
// Length _M_in_cur moved in the pback buffer.
_M_pback_cur_save += this->gptr() != this->eback();
this->setg(this->_M_buf, _M_pback_cur_save, _M_pback_end_save);
this->setg(_M_buf, _M_pback_cur_save, _M_pback_end_save);
_M_pback_init = false;
}
}
@ -374,16 +374,16 @@ namespace std
void
_M_set_buffer(streamsize __off)
{
const bool __testin = this->_M_mode & ios_base::in;
const bool __testout = this->_M_mode & ios_base::out;
const bool __testin = _M_mode & ios_base::in;
const bool __testout = _M_mode & ios_base::out;
if (__testin && __off > 0)
this->setg(this->_M_buf, this->_M_buf, this->_M_buf + __off);
this->setg(_M_buf, _M_buf, _M_buf + __off);
else
this->setg(this->_M_buf, this->_M_buf, this->_M_buf);
this->setg(_M_buf, _M_buf, _M_buf);
if (__testout && __off == 0 && this->_M_buf_size > 1 )
this->setp(this->_M_buf, this->_M_buf + this->_M_buf_size - 1);
if (__testout && __off == 0 && _M_buf_size > 1 )
this->setp(_M_buf, _M_buf + _M_buf_size - 1);
else
this->setp(NULL, NULL);
}