Commit f2ffecb1 by Mark Mitchell Committed by Mark Mitchell

c_locale.h: Include <cstdlib> and <cstring>.

	* config/locale/generic/c_locale.h: Include <cstdlib> and
	<cstring>.
	* include/bits/boost_concept_check.h: Add this-> to unqualified
	method calls.
	* include/bits/deque.tcc: Likewise.
	* include/bits/locale_facets.h : Likewise.
	* include/bits/ostream.tcc: Likewise.
	* include/bits/stl_algo.h: Likewise.
	* include/bits/stl_bvector.h: Likewise.
	* include/bits/stl_deque.h: Likewise.
	* include/bits/stl_list.h: Likewise.
	* include/bits/stl_tree.h: Likewise.
	* include/bits/stl_vector.h: Likewise.
	* include/bits/vector.tcc: Likewise.
	* include/ext/rope: Likewise.
	* include/ext/ropeimpl.h: Likewise.
	* include/ext/stdio_filebuf.h: Likewise.

From-SVN: r69315
parent 4fab535e
2003-07-13 Mark Mitchell <mark@codesourcery.com>
* config/locale/generic/c_locale.h: Include <cstdlib> and
<cstring>.
* include/bits/boost_concept_check.h: Add this-> to unqualified
method calls.
* include/bits/deque.tcc: Likewise.
* include/bits/locale_facets.h : Likewise.
* include/bits/ostream.tcc: Likewise.
* include/bits/stl_algo.h: Likewise.
* include/bits/stl_bvector.h: Likewise.
* include/bits/stl_deque.h: Likewise.
* include/bits/stl_list.h: Likewise.
* include/bits/stl_tree.h: Likewise.
* include/bits/stl_vector.h: Likewise.
* include/bits/vector.tcc: Likewise.
* include/ext/rope: Likewise.
* include/ext/ropeimpl.h: Likewise.
* include/ext/stdio_filebuf.h: Likewise.
2003-07-11 Jerry Quinn <jlquinn@optonline.net> 2003-07-11 Jerry Quinn <jlquinn@optonline.net>
* include/bits/basic_ios.h (copyfmt): Document. * include/bits/basic_ios.h (copyfmt): Document.
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#pragma GCC system_header #pragma GCC system_header
#include <clocale> #include <clocale>
#include <cstdlib>
#include <cstring>
#define _GLIBCXX_NUM_CATEGORIES 0 #define _GLIBCXX_NUM_CATEGORIES 0
......
...@@ -88,7 +88,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -88,7 +88,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp> template <class _Tp>
struct _IntegerConcept { struct _IntegerConcept {
void __constraints() { void __constraints() {
__error_type_must_be_an_integer_type(); this->__error_type_must_be_an_integer_type();
} }
}; };
template <> struct _IntegerConcept<short> { void __constraints() {} }; template <> struct _IntegerConcept<short> { void __constraints() {} };
...@@ -104,7 +104,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -104,7 +104,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp> template <class _Tp>
struct _SignedIntegerConcept { struct _SignedIntegerConcept {
void __constraints() { void __constraints() {
__error_type_must_be_a_signed_integer_type(); this->__error_type_must_be_a_signed_integer_type();
} }
}; };
template <> struct _SignedIntegerConcept<short> { void __constraints() {} }; template <> struct _SignedIntegerConcept<short> { void __constraints() {} };
...@@ -115,7 +115,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -115,7 +115,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
template <class _Tp> template <class _Tp>
struct _UnsignedIntegerConcept { struct _UnsignedIntegerConcept {
void __constraints() { void __constraints() {
__error_type_must_be_an_unsigned_integer_type(); this->__error_type_must_be_an_unsigned_integer_type();
} }
}; };
template <> struct _UnsignedIntegerConcept<unsigned short> template <> struct _UnsignedIntegerConcept<unsigned short>
......
...@@ -268,7 +268,7 @@ namespace std ...@@ -268,7 +268,7 @@ namespace std
_M_range_initialize(_InputIterator __first, _InputIterator __last, _M_range_initialize(_InputIterator __first, _InputIterator __last,
input_iterator_tag) input_iterator_tag)
{ {
_M_initialize_map(0); this->_M_initialize_map(0);
try try
{ {
for ( ; __first != __last; ++__first) for ( ; __first != __last; ++__first)
...@@ -289,7 +289,7 @@ namespace std ...@@ -289,7 +289,7 @@ namespace std
forward_iterator_tag) forward_iterator_tag)
{ {
size_type __n = std::distance(__first, __last); size_type __n = std::distance(__first, __last);
_M_initialize_map(__n); this->_M_initialize_map(__n);
_Map_pointer __cur_node; _Map_pointer __cur_node;
try try
...@@ -320,7 +320,7 @@ namespace std ...@@ -320,7 +320,7 @@ namespace std
{ {
value_type __t_copy = __t; value_type __t_copy = __t;
_M_reserve_map_at_back(); _M_reserve_map_at_back();
*(this->_M_finish._M_node + 1) = _M_allocate_node(); *(this->_M_finish._M_node + 1) = this->_M_allocate_node();
try try
{ {
std::_Construct(this->_M_finish._M_cur, __t_copy); std::_Construct(this->_M_finish._M_cur, __t_copy);
...@@ -342,7 +342,7 @@ namespace std ...@@ -342,7 +342,7 @@ namespace std
{ {
value_type __t_copy = __t; value_type __t_copy = __t;
_M_reserve_map_at_front(); _M_reserve_map_at_front();
*(this->_M_start._M_node - 1) = _M_allocate_node(); *(this->_M_start._M_node - 1) = this->_M_allocate_node();
try try
{ {
this->_M_start._M_set_node(this->_M_start._M_node - 1); this->_M_start._M_set_node(this->_M_start._M_node - 1);
...@@ -631,7 +631,7 @@ namespace std ...@@ -631,7 +631,7 @@ namespace std
try try
{ {
for (__i = 1; __i <= __new_nodes; ++__i) for (__i = 1; __i <= __new_nodes; ++__i)
*(this->_M_start._M_node - __i) = _M_allocate_node(); *(this->_M_start._M_node - __i) = this->_M_allocate_node();
} }
catch(...) catch(...)
{ {
...@@ -653,7 +653,7 @@ namespace std ...@@ -653,7 +653,7 @@ namespace std
try try
{ {
for (__i = 1; __i <= __new_nodes; ++__i) for (__i = 1; __i <= __new_nodes; ++__i)
*(this->_M_finish._M_node + __i) = _M_allocate_node(); *(this->_M_finish._M_node + __i) = this->_M_allocate_node();
} }
catch(...) catch(...)
{ {
...@@ -692,7 +692,7 @@ namespace std ...@@ -692,7 +692,7 @@ namespace std
size_type __new_map_size = size_type __new_map_size =
this->_M_map_size + std::max(this->_M_map_size, __nodes_to_add) + 2; this->_M_map_size + std::max(this->_M_map_size, __nodes_to_add) + 2;
_Map_pointer __new_map = _M_allocate_map(__new_map_size); _Map_pointer __new_map = this->_M_allocate_map(__new_map_size);
__new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2 __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
+ (__add_at_front ? __nodes_to_add : 0); + (__add_at_front ? __nodes_to_add : 0);
std::copy(this->_M_start._M_node, std::copy(this->_M_start._M_node,
......
...@@ -773,14 +773,14 @@ namespace std ...@@ -773,14 +773,14 @@ namespace std
numpunct_byname(const char* __s, size_t __refs = 0) numpunct_byname(const char* __s, size_t __refs = 0)
: numpunct<_CharT>(__refs) : numpunct<_CharT>(__refs)
{ {
_S_create_c_locale(_M_c_locale_numpunct, __s); this->_S_create_c_locale(_M_c_locale_numpunct, __s);
_M_initialize_numpunct(_M_c_locale_numpunct); this->_M_initialize_numpunct(_M_c_locale_numpunct);
} }
protected: protected:
virtual virtual
~numpunct_byname() ~numpunct_byname()
{ _S_destroy_c_locale(_M_c_locale_numpunct); } { this->_S_destroy_c_locale(_M_c_locale_numpunct); }
}; };
template<typename _CharT, typename _InIter> template<typename _CharT, typename _InIter>
...@@ -1134,8 +1134,8 @@ namespace std ...@@ -1134,8 +1134,8 @@ namespace std
collate_byname(const char* __s, size_t __refs = 0) collate_byname(const char* __s, size_t __refs = 0)
: collate<_CharT>(__refs) : collate<_CharT>(__refs)
{ {
_S_destroy_c_locale(this->_M_c_locale_collate); this->_S_destroy_c_locale(this->_M_c_locale_collate);
_S_create_c_locale(this->_M_c_locale_collate, __s); this->_S_create_c_locale(this->_M_c_locale_collate, __s);
} }
protected: protected:
...@@ -1717,14 +1717,14 @@ namespace std ...@@ -1717,14 +1717,14 @@ namespace std
moneypunct_byname(const char* __s, size_t __refs = 0) moneypunct_byname(const char* __s, size_t __refs = 0)
: moneypunct<_CharT, _Intl>(__refs) : moneypunct<_CharT, _Intl>(__refs)
{ {
_S_create_c_locale(_M_c_locale_moneypunct, __s); this->_S_create_c_locale(_M_c_locale_moneypunct, __s);
_M_initialize_moneypunct(_M_c_locale_moneypunct); this->_M_initialize_moneypunct(_M_c_locale_moneypunct);
} }
protected: protected:
virtual virtual
~moneypunct_byname() ~moneypunct_byname()
{ _S_destroy_c_locale(_M_c_locale_moneypunct); } { this->_S_destroy_c_locale(_M_c_locale_moneypunct); }
}; };
template<typename _CharT, bool _Intl> template<typename _CharT, bool _Intl>
......
...@@ -387,7 +387,7 @@ namespace std ...@@ -387,7 +387,7 @@ namespace std
sentry __cerb(*this); sentry __cerb(*this);
if (__cerb) if (__cerb)
{ {
int_type __put = rdbuf()->sputc(__c); int_type __put = this->rdbuf()->sputc(__c);
if (traits_type::eq_int_type(__put, traits_type::eof())) if (traits_type::eq_int_type(__put, traits_type::eof()))
this->setstate(ios_base::badbit); this->setstate(ios_base::badbit);
} }
......
...@@ -946,7 +946,7 @@ namespace std ...@@ -946,7 +946,7 @@ namespace std
// concept requirements // concept requirements
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
// "the type returned by a _Generator" // "the type returned by a _Generator"
__typeof__(gen())>) __typeof__(__gen())>)
for ( ; __n > 0; --__n, ++__first) for ( ; __n > 0; --__n, ++__first)
*__first = __gen(); *__first = __gen();
......
...@@ -373,7 +373,7 @@ template <typename _Alloc> ...@@ -373,7 +373,7 @@ template <typename _Alloc>
protected: protected:
void _M_initialize(size_type __n) { void _M_initialize(size_type __n) {
_Bit_type * __q = _M_bit_alloc(__n); _Bit_type * __q = this->_M_bit_alloc(__n);
this->_M_end_of_storage = __q + (__n + _S_word_bit - 1)/_S_word_bit; this->_M_end_of_storage = __q + (__n + _S_word_bit - 1)/_S_word_bit;
this->_M_start = iterator(__q, 0); this->_M_start = iterator(__q, 0);
this->_M_finish = this->_M_start + difference_type(__n); this->_M_finish = this->_M_start + difference_type(__n);
...@@ -387,11 +387,11 @@ template <typename _Alloc> ...@@ -387,11 +387,11 @@ template <typename _Alloc>
else { else {
size_type __len = size() size_type __len = size()
? 2 * size() : static_cast<size_type>(_S_word_bit); ? 2 * size() : static_cast<size_type>(_S_word_bit);
_Bit_type * __q = _M_bit_alloc(__len); _Bit_type * __q = this->_M_bit_alloc(__len);
iterator __i = std::copy(begin(), __position, iterator(__q, 0)); iterator __i = std::copy(begin(), __position, iterator(__q, 0));
*__i++ = __x; *__i++ = __x;
this->_M_finish = std::copy(__position, end(), __i); this->_M_finish = std::copy(__position, end(), __i);
_M_deallocate(); this->_M_deallocate();
this->_M_end_of_storage = __q + (__len + _S_word_bit - 1)/_S_word_bit; this->_M_end_of_storage = __q + (__len + _S_word_bit - 1)/_S_word_bit;
this->_M_start = iterator(__q, 0); this->_M_start = iterator(__q, 0);
} }
...@@ -439,11 +439,11 @@ template <typename _Alloc> ...@@ -439,11 +439,11 @@ template <typename _Alloc>
} }
else { else {
size_type __len = size() + std::max(size(), __n); size_type __len = size() + std::max(size(), __n);
_Bit_type * __q = _M_bit_alloc(__len); _Bit_type * __q = this->_M_bit_alloc(__len);
iterator __i = std::copy(begin(), __position, iterator(__q, 0)); iterator __i = std::copy(begin(), __position, iterator(__q, 0));
__i = std::copy(__first, __last, __i); __i = std::copy(__first, __last, __i);
this->_M_finish = std::copy(__position, end(), __i); this->_M_finish = std::copy(__position, end(), __i);
_M_deallocate(); this->_M_deallocate();
this->_M_end_of_storage this->_M_end_of_storage
= __q + (__len + _S_word_bit - 1)/_S_word_bit; = __q + (__len + _S_word_bit - 1)/_S_word_bit;
this->_M_start = iterator(__q, 0); this->_M_start = iterator(__q, 0);
...@@ -539,7 +539,7 @@ template <typename _Alloc> ...@@ -539,7 +539,7 @@ template <typename _Alloc>
vector& operator=(const vector& __x) { vector& operator=(const vector& __x) {
if (&__x == this) return *this; if (&__x == this) return *this;
if (__x.size() > capacity()) { if (__x.size() > capacity()) {
_M_deallocate(); this->_M_deallocate();
_M_initialize(__x.size()); _M_initialize(__x.size());
} }
std::copy(__x.begin(), __x.end(), begin()); std::copy(__x.begin(), __x.end(), begin());
...@@ -609,9 +609,9 @@ template <typename _Alloc> ...@@ -609,9 +609,9 @@ template <typename _Alloc>
if (__n > this->max_size()) if (__n > this->max_size())
__throw_length_error(__N("vector::reserve")); __throw_length_error(__N("vector::reserve"));
if (this->capacity() < __n) { if (this->capacity() < __n) {
_Bit_type * __q = _M_bit_alloc(__n); _Bit_type * __q = this->_M_bit_alloc(__n);
this->_M_finish = std::copy(begin(), end(), iterator(__q, 0)); this->_M_finish = std::copy(begin(), end(), iterator(__q, 0));
_M_deallocate(); this->_M_deallocate();
this->_M_start = iterator(__q, 0); this->_M_start = iterator(__q, 0);
this->_M_end_of_storage = __q + (__n + _S_word_bit - 1)/_S_word_bit; this->_M_end_of_storage = __q + (__n + _S_word_bit - 1)/_S_word_bit;
} }
...@@ -682,11 +682,11 @@ template <typename _Alloc> ...@@ -682,11 +682,11 @@ template <typename _Alloc>
} }
else { else {
size_type __len = size() + std::max(size(), __n); size_type __len = size() + std::max(size(), __n);
_Bit_type * __q = _M_bit_alloc(__len); _Bit_type * __q = this->_M_bit_alloc(__len);
iterator __i = std::copy(begin(), __position, iterator(__q, 0)); iterator __i = std::copy(begin(), __position, iterator(__q, 0));
std::fill_n(__i, __n, __x); std::fill_n(__i, __n, __x);
this->_M_finish = std::copy(__position, end(), __i + difference_type(__n)); this->_M_finish = std::copy(__position, end(), __i + difference_type(__n));
_M_deallocate(); this->_M_deallocate();
this->_M_end_of_storage = __q + (__len + _S_word_bit - 1)/_S_word_bit; this->_M_end_of_storage = __q + (__len + _S_word_bit - 1)/_S_word_bit;
this->_M_start = iterator(__q, 0); this->_M_start = iterator(__q, 0);
} }
......
...@@ -532,7 +532,7 @@ namespace std ...@@ -532,7 +532,7 @@ namespace std
try try
{ {
for (__cur = __nstart; __cur < __nfinish; ++__cur) for (__cur = __nstart; __cur < __nfinish; ++__cur)
*__cur = _M_allocate_node(); *__cur = this->_M_allocate_node();
} }
catch(...) catch(...)
{ {
......
...@@ -406,7 +406,7 @@ namespace std ...@@ -406,7 +406,7 @@ namespace std
_Node* _Node*
_M_create_node(const value_type& __x) _M_create_node(const value_type& __x)
{ {
_Node* __p = _M_get_node(); _Node* __p = this->_M_get_node();
try { try {
std::_Construct(&__p->_M_data, __x); std::_Construct(&__p->_M_data, __x);
} }
...@@ -427,7 +427,7 @@ namespace std ...@@ -427,7 +427,7 @@ namespace std
_Node* _Node*
_M_create_node() _M_create_node()
{ {
_Node* __p = _M_get_node(); _Node* __p = this->_M_get_node();
try { try {
std::_Construct(&__p->_M_data); std::_Construct(&__p->_M_data);
} }
......
...@@ -336,7 +336,7 @@ namespace std ...@@ -336,7 +336,7 @@ namespace std
_Link_type _Link_type
_M_create_node(const value_type& __x) _M_create_node(const value_type& __x)
{ {
_Link_type __tmp = _M_get_node(); _Link_type __tmp = this->_M_get_node();
try try
{ std::_Construct(&__tmp->_M_value_field, __x); } { std::_Construct(&__tmp->_M_value_field, __x); }
catch(...) catch(...)
......
...@@ -153,7 +153,7 @@ namespace std ...@@ -153,7 +153,7 @@ namespace std
_Vector_base(size_t __n, const allocator_type& __a) _Vector_base(size_t __n, const allocator_type& __a)
: _Base(__a) : _Base(__a)
{ {
this->_M_start = _M_allocate(__n); this->_M_start = this->_M_allocate(__n);
this->_M_finish = this->_M_start; this->_M_finish = this->_M_start;
this->_M_end_of_storage = this->_M_start + __n; this->_M_end_of_storage = this->_M_start + __n;
} }
...@@ -753,7 +753,7 @@ namespace std ...@@ -753,7 +753,7 @@ namespace std
_M_allocate_and_copy(size_type __n, _M_allocate_and_copy(size_type __n,
_ForwardIterator __first, _ForwardIterator __last) _ForwardIterator __first, _ForwardIterator __last)
{ {
pointer __result = _M_allocate(__n); pointer __result = this->_M_allocate(__n);
try try
{ {
std::uninitialized_copy(__first, __last, __result); std::uninitialized_copy(__first, __last, __result);
...@@ -807,7 +807,7 @@ namespace std ...@@ -807,7 +807,7 @@ namespace std
_ForwardIterator __last, forward_iterator_tag) _ForwardIterator __last, forward_iterator_tag)
{ {
size_type __n = std::distance(__first, __last); size_type __n = std::distance(__first, __last);
this->_M_start = _M_allocate(__n); this->_M_start = this->_M_allocate(__n);
this->_M_end_of_storage = this->_M_start + __n; this->_M_end_of_storage = this->_M_start + __n;
this->_M_finish = std::uninitialized_copy(__first, __last, this->_M_finish = std::uninitialized_copy(__first, __last,
this->_M_start); this->_M_start);
......
...@@ -241,7 +241,7 @@ namespace std ...@@ -241,7 +241,7 @@ namespace std
{ {
const size_type __old_size = size(); const size_type __old_size = size();
const size_type __len = __old_size != 0 ? 2 * __old_size : 1; const size_type __len = __old_size != 0 ? 2 * __old_size : 1;
iterator __new_start(_M_allocate(__len)); iterator __new_start(this->_M_allocate(__len));
iterator __new_finish(__new_start); iterator __new_finish(__new_start);
try try
{ {
...@@ -349,7 +349,7 @@ namespace std ...@@ -349,7 +349,7 @@ namespace std
{ {
const size_type __old_size = size(); const size_type __old_size = size();
const size_type __len = __old_size + std::max(__old_size, __n); const size_type __len = __old_size + std::max(__old_size, __n);
iterator __new_start(_M_allocate(__len)); iterator __new_start(this->_M_allocate(__len));
iterator __new_finish(__new_start); iterator __new_finish(__new_start);
try try
{ {
...@@ -426,7 +426,7 @@ namespace std ...@@ -426,7 +426,7 @@ namespace std
{ {
const size_type __old_size = size(); const size_type __old_size = size();
const size_type __len = __old_size + std::max(__old_size, __n); const size_type __len = __old_size + std::max(__old_size, __n);
iterator __new_start(_M_allocate(__len)); iterator __new_start(this->_M_allocate(__len));
iterator __new_finish(__new_start); iterator __new_finish(__new_start);
try try
{ {
......
...@@ -606,9 +606,9 @@ struct _Rope_RopeLeaf : public _Rope_RopeRep<_CharT,_Alloc> { ...@@ -606,9 +606,9 @@ struct _Rope_RopeLeaf : public _Rope_RopeRep<_CharT,_Alloc> {
# ifndef __GC # ifndef __GC
~_Rope_RopeLeaf() { ~_Rope_RopeLeaf() {
if (_M_data != this->_M_c_string) { if (_M_data != this->_M_c_string) {
_M_free_c_string(); this->_M_free_c_string();
} }
__STL_FREE_STRING(_M_data, this->_M_size, get_allocator()); __STL_FREE_STRING(_M_data, this->_M_size, this->get_allocator());
} }
# endif # endif
}; };
...@@ -632,9 +632,9 @@ struct _Rope_RopeConcatenation : public _Rope_RopeRep<_CharT,_Alloc> { ...@@ -632,9 +632,9 @@ struct _Rope_RopeConcatenation : public _Rope_RopeRep<_CharT,_Alloc> {
{} {}
# ifndef __GC # ifndef __GC
~_Rope_RopeConcatenation() { ~_Rope_RopeConcatenation() {
_M_free_c_string(); this->_M_free_c_string();
_M_left->_M_unref_nonnil(); _M_left->_M_unref_nonnil();
_M_right->_M_unref_nonnil(); _M_right->_M_unref_nonnil();
} }
# endif # endif
}; };
...@@ -678,7 +678,7 @@ struct _Rope_RopeFunction : public _Rope_RopeRep<_CharT,_Alloc> { ...@@ -678,7 +678,7 @@ struct _Rope_RopeFunction : public _Rope_RopeRep<_CharT,_Alloc> {
} }
# ifndef __GC # ifndef __GC
~_Rope_RopeFunction() { ~_Rope_RopeFunction() {
_M_free_c_string(); this->_M_free_c_string();
if (_M_delete_when_done) { if (_M_delete_when_done) {
delete _M_fn; delete _M_fn;
} }
...@@ -979,33 +979,33 @@ class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> { ...@@ -979,33 +979,33 @@ class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
this->_M_buf_ptr = __next; this->_M_buf_ptr = __next;
++this->_M_current_pos; ++this->_M_current_pos;
} else { } else {
_M_incr(1); this->_M_incr(1);
} }
return *this; return *this;
} }
_Rope_const_iterator& operator+=(ptrdiff_t __n) { _Rope_const_iterator& operator+=(ptrdiff_t __n) {
if (__n >= 0) { if (__n >= 0) {
_M_incr(__n); this->_M_incr(__n);
} else { } else {
_M_decr(-__n); this->_M_decr(-__n);
} }
return *this; return *this;
} }
_Rope_const_iterator& operator--() { _Rope_const_iterator& operator--() {
_M_decr(1); this->_M_decr(1);
return *this; return *this;
} }
_Rope_const_iterator& operator-=(ptrdiff_t __n) { _Rope_const_iterator& operator-=(ptrdiff_t __n) {
if (__n >= 0) { if (__n >= 0) {
_M_decr(__n); this->_M_decr(__n);
} else { } else {
_M_incr(-__n); this->_M_incr(-__n);
} }
return *this; return *this;
} }
_Rope_const_iterator operator++(int) { _Rope_const_iterator operator++(int) {
size_t __old_pos = this->_M_current_pos; size_t __old_pos = this->_M_current_pos;
_M_incr(1); this->_M_incr(1);
return _Rope_const_iterator<_CharT,_Alloc>(this->_M_root, __old_pos); return _Rope_const_iterator<_CharT,_Alloc>(this->_M_root, __old_pos);
// This makes a subsequent dereference expensive. // This makes a subsequent dereference expensive.
// Perhaps we should instead copy the iterator // Perhaps we should instead copy the iterator
...@@ -1013,7 +1013,7 @@ class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> { ...@@ -1013,7 +1013,7 @@ class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
} }
_Rope_const_iterator operator--(int) { _Rope_const_iterator operator--(int) {
size_t __old_pos = this->_M_current_pos; size_t __old_pos = this->_M_current_pos;
_M_decr(1); this->_M_decr(1);
return _Rope_const_iterator<_CharT,_Alloc>(this->_M_root, __old_pos); return _Rope_const_iterator<_CharT,_Alloc>(this->_M_root, __old_pos);
} }
template<class _CharT2, class _Alloc2> template<class _CharT2, class _Alloc2>
...@@ -1112,37 +1112,37 @@ class _Rope_iterator : public _Rope_iterator_base<_CharT,_Alloc> { ...@@ -1112,37 +1112,37 @@ class _Rope_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
} }
} }
_Rope_iterator& operator++() { _Rope_iterator& operator++() {
_M_incr(1); this->_M_incr(1);
return *this; return *this;
} }
_Rope_iterator& operator+=(ptrdiff_t __n) { _Rope_iterator& operator+=(ptrdiff_t __n) {
if (__n >= 0) { if (__n >= 0) {
_M_incr(__n); this->_M_incr(__n);
} else { } else {
_M_decr(-__n); this->_M_decr(-__n);
} }
return *this; return *this;
} }
_Rope_iterator& operator--() { _Rope_iterator& operator--() {
_M_decr(1); this->_M_decr(1);
return *this; return *this;
} }
_Rope_iterator& operator-=(ptrdiff_t __n) { _Rope_iterator& operator-=(ptrdiff_t __n) {
if (__n >= 0) { if (__n >= 0) {
_M_decr(__n); this->_M_decr(__n);
} else { } else {
_M_incr(-__n); this->_M_incr(-__n);
} }
return *this; return *this;
} }
_Rope_iterator operator++(int) { _Rope_iterator operator++(int) {
size_t __old_pos = this->_M_current_pos; size_t __old_pos = this->_M_current_pos;
_M_incr(1); this->_M_incr(1);
return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos); return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos);
} }
_Rope_iterator operator--(int) { _Rope_iterator operator--(int) {
size_t __old_pos = this->_M_current_pos; size_t __old_pos = this->_M_current_pos;
_M_decr(1); this->_M_decr(1);
return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos); return _Rope_iterator<_CharT,_Alloc>(_M_root_rope, __old_pos);
} }
reference operator[](ptrdiff_t __n) { reference operator[](ptrdiff_t __n) {
...@@ -1650,7 +1650,7 @@ class rope : public _Rope_base<_CharT,_Alloc> { ...@@ -1650,7 +1650,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
{ {
_RopeRep* __old = this->_M_tree_ptr; _RopeRep* __old = this->_M_tree_ptr;
_RopeRep* __left = _RopeRep* __left =
__STL_ROPE_FROM_UNOWNED_CHAR_PTR(&__x, 1, get_allocator()); __STL_ROPE_FROM_UNOWNED_CHAR_PTR(&__x, 1, this->get_allocator());
try { try {
this->_M_tree_ptr = _S_concat(__left, this->_M_tree_ptr); this->_M_tree_ptr = _S_concat(__left, this->_M_tree_ptr);
_S_unref(__old); _S_unref(__old);
......
...@@ -1455,7 +1455,7 @@ const _CharT* rope<_CharT,_Alloc>::c_str() const { ...@@ -1455,7 +1455,7 @@ const _CharT* rope<_CharT,_Alloc>::c_str() const {
if (0 == __result) if (0 == __result)
{ {
size_t __s = size(); size_t __s = size();
__result = _Data_allocate(__s + 1); __result = this->_Data_allocate(__s + 1);
_S_flatten(this->_M_tree_ptr, __result); _S_flatten(this->_M_tree_ptr, __result);
__result[__s] = _S_eos((_CharT*)0); __result[__s] = _S_eos((_CharT*)0);
this->_M_tree_ptr->_M_c_string = __result; this->_M_tree_ptr->_M_c_string = __result;
...@@ -1480,7 +1480,7 @@ const _CharT* rope<_CharT,_Alloc>::replace_with_c_str() { ...@@ -1480,7 +1480,7 @@ const _CharT* rope<_CharT,_Alloc>::replace_with_c_str() {
_S_flatten(this->_M_tree_ptr, __result); _S_flatten(this->_M_tree_ptr, __result);
__result[__s] = _S_eos((_CharT*)0); __result[__s] = _S_eos((_CharT*)0);
this->_M_tree_ptr->_M_unref_nonnil(); this->_M_tree_ptr->_M_unref_nonnil();
this->_M_tree_ptr = _S_new_RopeLeaf(__result, __s, get_allocator()); this->_M_tree_ptr = _S_new_RopeLeaf(__result, __s, this->get_allocator());
return(__result); return(__result);
} }
......
...@@ -126,10 +126,10 @@ namespace __gnu_cxx ...@@ -126,10 +126,10 @@ namespace __gnu_cxx
{ {
this->_M_mode = __mode; this->_M_mode = __mode;
this->_M_buf_size = __size; this->_M_buf_size = __size;
_M_allocate_internal_buffer(); this->_M_allocate_internal_buffer();
this->_M_reading = false; this->_M_reading = false;
this->_M_writing = false; this->_M_writing = false;
_M_set_buffer(-1); this->_M_set_buffer(-1);
} }
} }
...@@ -143,10 +143,10 @@ namespace __gnu_cxx ...@@ -143,10 +143,10 @@ namespace __gnu_cxx
{ {
this->_M_mode = __mode; this->_M_mode = __mode;
this->_M_buf_size = __size; this->_M_buf_size = __size;
_M_allocate_internal_buffer(); this->_M_allocate_internal_buffer();
this->_M_reading = false; this->_M_reading = false;
this->_M_writing = false; this->_M_writing = false;
_M_set_buffer(-1); this->_M_set_buffer(-1);
} }
} }
} // namespace __gnu_cxx } // namespace __gnu_cxx
......
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