Commit 8544261c by Paolo Carlini Committed by Paolo Carlini

stdio_filebuf.h (stdio_filebuf(int, std::ios_base::openmode, bool, size_t),…

stdio_filebuf.h (stdio_filebuf(int, std::ios_base::openmode, bool, size_t), [...]): Shorten a bit (-10 lines) by factoring out some code.

2003-05-01  Paolo Carlini  <pcarlini@unitus.it>

	* include/ext/stdio_filebuf.h
	(stdio_filebuf(int, std::ios_base::openmode, bool, size_t),
	stdio_filebuf(std::__c_file*, std::ios_base::openmode, size_t)):
	Shorten a bit (-10 lines) by factoring out some code.

From-SVN: r66320
parent d1c4bfe8
2003-05-01 Paolo Carlini <pcarlini@unitus.it>
* include/ext/stdio_filebuf.h
(stdio_filebuf(int, std::ios_base::openmode, bool, size_t),
stdio_filebuf(std::__c_file*, std::ios_base::openmode, size_t)):
Shorten a bit (-10 lines) by factoring out some code.
2003-04-30 Phil Edwards <pme@gcc.gnu.org> 2003-04-30 Phil Edwards <pme@gcc.gnu.org>
* acinclude.m4: Add bit missing from previous patch. * acinclude.m4: Add bit missing from previous patch.
......
...@@ -124,17 +124,12 @@ namespace __gnu_cxx ...@@ -124,17 +124,12 @@ namespace __gnu_cxx
if (this->is_open()) if (this->is_open())
{ {
this->_M_mode = __mode; this->_M_mode = __mode;
this->_M_buf_size = __size;
if (__size > 0 && __size < 4) if (__size > 0 && __size < 4)
{ // Specify not to use an allocated buffer.
// Specify not to use an allocated buffer. this->_M_buf = _M_unbuf;
this->_M_buf = _M_unbuf;
this->_M_buf_size = __size;
}
else else
{ _M_allocate_internal_buffer();
this->_M_buf_size = __size;
_M_allocate_internal_buffer();
}
_M_set_indeterminate(); _M_set_indeterminate();
} }
} }
...@@ -148,17 +143,12 @@ namespace __gnu_cxx ...@@ -148,17 +143,12 @@ namespace __gnu_cxx
if (this->is_open()) if (this->is_open())
{ {
this->_M_mode = __mode; this->_M_mode = __mode;
this->_M_buf_size = __size;
if (__size > 0 && __size < 4) if (__size > 0 && __size < 4)
{ // Specify not to use an allocated buffer.
// Specify not to use an allocated buffer. this->_M_buf = _M_unbuf;
this->_M_buf = _M_unbuf;
this->_M_buf_size = __size;
}
else else
{ _M_allocate_internal_buffer();
this->_M_buf_size = __size;
_M_allocate_internal_buffer();
}
_M_set_indeterminate(); _M_set_indeterminate();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment