aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/ext/ropeimpl.h
diff options
context:
space:
mode:
authorBernardo Innocenti <bernie@develer.com>2003-12-09 05:31:53 +0100
committerBernardo Innocenti <bernie@gcc.gnu.org>2003-12-09 05:31:53 +0100
commitfa30fe72d1d6e281786d296333b18ceff3d8c089 (patch)
treee7baac8d46bd354909d55bcc6367f5ced6fd5f03 /libstdc++-v3/include/ext/ropeimpl.h
parent526da49cc7dea9f6022612320eb980535b91eecb (diff)
downloadgcc-fa30fe72d1d6e281786d296333b18ceff3d8c089.zip
gcc-fa30fe72d1d6e281786d296333b18ceff3d8c089.tar.gz
gcc-fa30fe72d1d6e281786d296333b18ceff3d8c089.tar.bz2
algorithm, [...]: Remove trailing whitespace.
* include/ext/algorithm, include/ext/debug_allocator.h, include/ext/enc_filebuf.h, include/ext/functional, include/ext/hash_fun.h, include/ext/hash_map, include/ext/hash_set, include/ext/hashtable.h, include/ext/iterator, include/ext/malloc_allocator.h, include/ext/memory, include/ext/mt_allocator.h, include/ext/numeric, include/ext/pod_char_traits.h, include/ext/pool_allocator.h, include/ext/rb_tree, include/ext/rope, include/ext/ropeimpl.h, include/ext/slist, include/ext/stdio_filebuf.h, include/ext/stdio_sync_filebuf.h: Remove trailing whitespace. From-SVN: r74464
Diffstat (limited to 'libstdc++-v3/include/ext/ropeimpl.h')
-rw-r--r--libstdc++-v3/include/ext/ropeimpl.h122
1 files changed, 61 insertions, 61 deletions
diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
index 6129084..b8357ee 100644
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -45,7 +45,7 @@
* You should not attempt to use it directly.
*/
-#include <cstdio>
+#include <cstdio>
#include <ostream>
#include <bits/functexcept.h>
@@ -57,7 +57,7 @@ namespace __gnu_cxx
{
using std::size_t;
using std::printf;
- using std::basic_ostream;
+ using std::basic_ostream;
using std::__throw_length_error;
using std::__alloc;
using std::_Destroy;
@@ -68,7 +68,7 @@ namespace __gnu_cxx
// Results in a valid buf_ptr if the iterator can be legitimately
// dereferenced.
template <class _CharT, class _Alloc>
-void _Rope_iterator_base<_CharT,_Alloc>::_S_setbuf(
+void _Rope_iterator_base<_CharT,_Alloc>::_S_setbuf(
_Rope_iterator_base<_CharT,_Alloc>& __x)
{
const _RopeRep* __leaf = __x._M_path_end[__x._M_leaf_index];
@@ -77,7 +77,7 @@ void _Rope_iterator_base<_CharT,_Alloc>::_S_setbuf(
switch(__leaf->_M_tag) {
case _RopeRep::_S_leaf:
- __x._M_buf_start =
+ __x._M_buf_start =
((_Rope_RopeLeaf<_CharT,_Alloc>*)__leaf)->_M_data;
__x._M_buf_ptr = __x._M_buf_start + (__pos - __leaf_pos);
__x._M_buf_end = __x._M_buf_start + __leaf->_M_size;
@@ -111,7 +111,7 @@ void _Rope_iterator_base<_CharT,_Alloc>::_S_setbuf(
}
}
-// Set path and buffer inside a rope iterator. We assume that
+// Set path and buffer inside a rope iterator. We assume that
// pos and root are already set.
template <class _CharT, class _Alloc>
void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache
@@ -154,7 +154,7 @@ void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache
(_Rope_RopeConcatenation<_CharT,_Alloc>*)__curr_rope;
_RopeRep* __left = __c->_M_left;
size_t __left_len = __left->_M_size;
-
+
__dirns <<= 1;
if (__pos >= __curr_start_pos + __left_len) {
__dirns |= 1;
@@ -203,7 +203,7 @@ void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache_for_incr
}
// node_start_pos is starting position of last_node.
while (--__current_index >= 0) {
- if (!(__dirns & 1) /* Path turned left */)
+ if (!(__dirns & 1) /* Path turned left */)
break;
__current_node = __x._M_path_end[__current_index];
__c = (_Rope_RopeConcatenation<_CharT,_Alloc>*)__current_node;
@@ -288,23 +288,23 @@ void _Rope_iterator<_CharT,_Alloc>::_M_check() {
}
template <class _CharT, class _Alloc>
-inline
+inline
_Rope_const_iterator<_CharT, _Alloc>::_Rope_const_iterator(
const _Rope_iterator<_CharT,_Alloc>& __x)
-: _Rope_iterator_base<_CharT,_Alloc>(__x)
+: _Rope_iterator_base<_CharT,_Alloc>(__x)
{ }
template <class _CharT, class _Alloc>
inline _Rope_iterator<_CharT,_Alloc>::_Rope_iterator(
rope<_CharT,_Alloc>& __r, size_t __pos)
-: _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos),
+: _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos),
_M_root_rope(&__r)
{
_RopeRep::_S_ref(this->_M_root);
}
template <class _CharT, class _Alloc>
-inline size_t
+inline size_t
rope<_CharT,_Alloc>::_S_char_ptr_len(const _CharT* __s)
{
const _CharT* __p = __s;
@@ -409,7 +409,7 @@ rope<_CharT,_Alloc>::_S_leaf_concat_char_iter
_CharT* __new_data = (_CharT*)
_Data_allocate(_S_rounded_up_size(__old_len + __len));
_RopeLeaf* __result;
-
+
uninitialized_copy_n(__r->_M_data, __old_len, __new_data);
uninitialized_copy_n(__iter, __len, __new_data + __old_len);
_S_cond_store_eos(__new_data[__old_len + __len]);
@@ -463,22 +463,22 @@ template <class _CharT, class _Alloc>
typename rope<_CharT,_Alloc>::_RopeRep*
rope<_CharT,_Alloc>::_S_tree_concat (_RopeRep* __left, _RopeRep* __right)
{
- _RopeConcatenation* __result = _S_new_RopeConcatenation(__left, __right,
+ _RopeConcatenation* __result = _S_new_RopeConcatenation(__left, __right,
__left->get_allocator());
size_t __depth = __result->_M_depth;
-
+
if (__depth > 20 && (__result->_M_size < 1000 ||
- __depth > _RopeRep::_S_max_rope_depth))
+ __depth > _RopeRep::_S_max_rope_depth))
{
_RopeRep* __balanced;
-
- try
+
+ try
{
__balanced = _S_balance(__result);
__result->_M_unref_nonnil();
}
catch(...)
- {
+ {
_C_deallocate(__result,1);
__throw_exception_again;
}
@@ -487,8 +487,8 @@ rope<_CharT,_Alloc>::_S_tree_concat (_RopeRep* __left, _RopeRep* __right)
// still owns its children. Thus unref is
// inappropriate.
return __balanced;
- }
- else
+ }
+ else
return __result;
}
@@ -505,18 +505,18 @@ rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter
if (0 == __r)
return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
__r->get_allocator());
- if (_RopeRep::_S_leaf == __r->_M_tag &&
+ if (_RopeRep::_S_leaf == __r->_M_tag &&
__r->_M_size + __slen <= _S_copy_max) {
__result = _S_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
return __result;
}
if (_RopeRep::_S_concat == __r->_M_tag
&& _RopeRep::_S_leaf == ((_RopeConcatenation*)__r)->_M_right->_M_tag) {
- _RopeLeaf* __right =
+ _RopeLeaf* __right =
(_RopeLeaf* )(((_RopeConcatenation* )__r)->_M_right);
if (__right->_M_size + __slen <= _S_copy_max) {
_RopeRep* __left = ((_RopeConcatenation*)__r)->_M_left;
- _RopeRep* __nright =
+ _RopeRep* __nright =
_S_leaf_concat_char_iter((_RopeLeaf*)__right, __s, __slen);
__left->_M_ref_nonnil();
try {
@@ -524,7 +524,7 @@ rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter
}
catch(...)
{
- _S_unref(__left);
+ _S_unref(__left);
_S_unref(__nright);
__throw_exception_again;
}
@@ -539,7 +539,7 @@ rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter
}
catch(...)
{
- _S_unref(__r);
+ _S_unref(__r);
_S_unref(__nright);
__throw_exception_again;
}
@@ -548,7 +548,7 @@ rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter
#ifndef __GC
template <class _CharT, class _Alloc>
-typename rope<_CharT,_Alloc>::_RopeRep*
+typename rope<_CharT,_Alloc>::_RopeRep*
rope<_CharT,_Alloc>::_S_destr_concat_char_iter(
_RopeRep* __r, const _CharT* __s, size_t __slen)
{
@@ -563,7 +563,7 @@ rope<_CharT,_Alloc>::_S_destr_concat_char_iter(
__r->_M_ref_count = 2; // One more than before
return __r;
}
- if (__orig_size + __slen <= _S_copy_max &&
+ if (__orig_size + __slen <= _S_copy_max &&
_RopeRep::_S_leaf == __r->_M_tag) {
__result = _S_destr_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
return __result;
@@ -572,11 +572,11 @@ rope<_CharT,_Alloc>::_S_destr_concat_char_iter(
_RopeLeaf* __right = (_RopeLeaf*)(((_RopeConcatenation*)__r)->_M_right);
if (_RopeRep::_S_leaf == __right->_M_tag
&& __right->_M_size + __slen <= _S_copy_max) {
- _RopeRep* __new_right =
+ _RopeRep* __new_right =
_S_destr_leaf_concat_char_iter(__right, __s, __slen);
- if (__right == __new_right)
+ if (__right == __new_right)
__new_right->_M_ref_count = 1;
- else
+ else
__right->_M_unref_nonnil();
__r->_M_ref_count = 2; // One more than before.
((_RopeConcatenation*)__r)->_M_right = __new_right;
@@ -596,7 +596,7 @@ rope<_CharT,_Alloc>::_S_destr_concat_char_iter(
}
catch(...)
{
- _S_unref(__r);
+ _S_unref(__r);
_S_unref(__right);
__throw_exception_again;
}
@@ -627,7 +627,7 @@ rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right)
&& _RopeRep::_S_leaf ==
((_RopeConcatenation*)__left)->_M_right->_M_tag) {
_RopeLeaf* __leftright =
- (_RopeLeaf*)(((_RopeConcatenation*)__left)->_M_right);
+ (_RopeLeaf*)(((_RopeConcatenation*)__left)->_M_right);
if (__leftright->_M_size + __right->_M_size <= _S_copy_max) {
_RopeRep* __leftleft = ((_RopeConcatenation*)__left)->_M_left;
_RopeRep* __rest = _S_leaf_concat_char_iter(__leftright,
@@ -639,7 +639,7 @@ rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right)
}
catch(...)
{
- _S_unref(__leftleft);
+ _S_unref(__leftleft);
_S_unref(__rest);
__throw_exception_again;
}
@@ -653,7 +653,7 @@ rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right)
}
catch(...)
{
- _S_unref(__left);
+ _S_unref(__left);
_S_unref(__right);
__throw_exception_again;
}
@@ -661,14 +661,14 @@ rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right)
template <class _CharT, class _Alloc>
typename rope<_CharT,_Alloc>::_RopeRep*
-rope<_CharT,_Alloc>::_S_substring(_RopeRep* __base,
+rope<_CharT,_Alloc>::_S_substring(_RopeRep* __base,
size_t __start, size_t __endp1)
{
if (0 == __base) return 0;
size_t __len = __base->_M_size;
size_t __adj_endp1;
const size_t __lazy_threshold = 128;
-
+
if (__endp1 >= __len) {
if (0 == __start) {
__base->_M_ref_nonnil();
@@ -788,14 +788,14 @@ class _Rope_flatten_char_consumer : public _Rope_char_consumer<_CharT> {
return true;
}
};
-
+
template<class _CharT>
class _Rope_find_char_char_consumer : public _Rope_char_consumer<_CharT> {
private:
_CharT _M_pattern;
public:
size_t _M_count; // Number of nonmatching characters
- _Rope_find_char_char_consumer(_CharT __p)
+ _Rope_find_char_char_consumer(_CharT __p)
: _M_pattern(__p), _M_count(0) {}
~_Rope_find_char_char_consumer() {}
bool operator() (const _CharT* __leaf, size_t __n) {
@@ -808,7 +808,7 @@ class _Rope_find_char_char_consumer : public _Rope_char_consumer<_CharT> {
_M_count += __n; return true;
}
};
-
+
template<class _CharT, class _Traits>
// Here _CharT is both the stream and rope character type.
class _Rope_insert_char_consumer : public _Rope_char_consumer<_CharT> {
@@ -816,14 +816,14 @@ class _Rope_insert_char_consumer : public _Rope_char_consumer<_CharT> {
typedef basic_ostream<_CharT,_Traits> _Insert_ostream;
_Insert_ostream& _M_o;
public:
- _Rope_insert_char_consumer(_Insert_ostream& __writer)
+ _Rope_insert_char_consumer(_Insert_ostream& __writer)
: _M_o(__writer) {};
~_Rope_insert_char_consumer() { };
// Caller is presumed to own the ostream
bool operator() (const _CharT* __leaf, size_t __n);
// Returns true to continue traversal.
};
-
+
template<class _CharT, class _Traits>
bool _Rope_insert_char_consumer<_CharT, _Traits>::operator()
(const _CharT* __leaf, size_t __n)
@@ -901,7 +901,7 @@ bool rope<_CharT, _Alloc>::_S_apply_to_pieces(
for (__i = 0; __i < __n; __i++) __o.put(__f);
}
-
+
template <class _CharT> inline bool _Rope_is_simple(_CharT*) { return false; }
inline bool _Rope_is_simple(char*) { return true; }
@@ -917,7 +917,7 @@ basic_ostream<_CharT, _Traits>& operator<< (basic_ostream<_CharT, _Traits>& __o,
size_t __rope_len = __r.size();
_Rope_insert_char_consumer<_CharT, _Traits> __c(__o);
bool __is_simple = _Rope_is_simple((_CharT*)0);
-
+
if (__rope_len < __w) {
__pad_len = __w - __rope_len;
} else {
@@ -937,7 +937,7 @@ basic_ostream<_CharT, _Traits>& operator<< (basic_ostream<_CharT, _Traits>& __o,
}
catch(...)
{
- if (!__is_simple)
+ if (!__is_simple)
__o.width(__w);
__throw_exception_again;
}
@@ -1058,8 +1058,8 @@ rope<_CharT,_Alloc>::_S_dump(_RopeRep* __r, int __indent)
bool __too_big = __r->_M_size > __prefix->_M_size;
_S_flatten(__prefix, __buffer);
- __buffer[__prefix->_M_size] = _S_eos((_CharT*)0);
- printf("%s%s\n",
+ __buffer[__prefix->_M_size] = _S_eos((_CharT*)0);
+ printf("%s%s\n",
(char*)__buffer, __too_big? "...\n" : "\n");
} else {
printf("\n");
@@ -1097,11 +1097,11 @@ rope<_CharT,_Alloc>::_S_balance(_RopeRep* __r)
// __forest[__i]._M_depth = __i
// References from forest are included in refcount.
- for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
+ for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
__forest[__i] = 0;
try {
_S_add_to_forest(__r, __forest);
- for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
+ for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
if (0 != __forest[__i]) {
# ifndef __GC
_Self_destruct_ptr __old(__result);
@@ -1148,9 +1148,9 @@ template <class _CharT, class _Alloc>
void
rope<_CharT,_Alloc>::_S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest)
{
- _RopeRep* __insertee; // included in refcount
- _RopeRep* __too_tiny = 0; // included in refcount
- int __i; // forest[0..__i-1] is empty
+ _RopeRep* __insertee; // included in refcount
+ _RopeRep* __too_tiny = 0; // included in refcount
+ int __i; // forest[0..__i-1] is empty
size_t __s = __r->_M_size;
for (__i = 0; __s >= _S_min_len[__i+1]/* not this bucket */; ++__i) {
@@ -1180,7 +1180,7 @@ rope<_CharT,_Alloc>::_S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest)
__forest[__i]->_M_unref_nonnil();
__forest[__i] = 0;
}
- if (__i == _RopeRep::_S_max_rope_depth ||
+ if (__i == _RopeRep::_S_max_rope_depth ||
__insertee->_M_size < _S_min_len[__i+1]) {
__forest[__i] = __insertee;
// refcount is OK since __insertee is now dead.
@@ -1195,7 +1195,7 @@ rope<_CharT,_Alloc>::_S_fetch(_RopeRep* __r, size_type __i)
{
__GC_CONST _CharT* __cstr = __r->_M_c_string;
- if (0 != __cstr) return __cstr[__i];
+ if (0 != __cstr) return __cstr[__i];
for(;;) {
switch(__r->_M_tag) {
case _RopeRep::_S_concat:
@@ -1285,7 +1285,7 @@ rope<_CharT,_Alloc>::_S_fetch_ptr(_RopeRep* __r, size_type __i)
// flat strings.
template <class _CharT, class _Alloc>
int
-rope<_CharT,_Alloc>::_S_compare (const _RopeRep* __left,
+rope<_CharT,_Alloc>::_S_compare (const _RopeRep* __left,
const _RopeRep* __right)
{
size_t __left_len;
@@ -1387,7 +1387,7 @@ rope<_CharT, _Alloc>::rope(size_t __n, _CharT __c,
if (0 == __n)
return;
-
+
__exponent = __n / __exponentiate_threshold;
__rest = __n % __exponentiate_threshold;
if (0 == __rest) {
@@ -1419,12 +1419,12 @@ rope<_CharT, _Alloc>::rope(size_t __n, _CharT __c,
}
catch(...)
{
- _RopeRep::__STL_FREE_STRING(__base_buffer,
+ _RopeRep::__STL_FREE_STRING(__base_buffer,
__exponentiate_threshold, __a);
__throw_exception_again;
}
__base_rope._M_tree_ptr = __base_leaf;
- if (1 == __exponent) {
+ if (1 == __exponent) {
__result = __base_rope;
} else {
__result = power(__base_rope, __exponent,
@@ -1494,14 +1494,14 @@ _Rope_rotate(_Rope_iterator __first,
{
typedef typename _Rope_iterator::value_type _CharT;
typedef typename _Rope_iterator::_allocator_type _Alloc;
-
+
rope<_CharT,_Alloc>& __r(__first.container());
rope<_CharT,_Alloc> __prefix = __r.substr(0, __first.index());
- rope<_CharT,_Alloc> __suffix =
+ rope<_CharT,_Alloc> __suffix =
__r.substr(__last.index(), __r.size() - __last.index());
- rope<_CharT,_Alloc> __part1 =
+ rope<_CharT,_Alloc> __part1 =
__r.substr(__middle.index(), __last.index() - __middle.index());
- rope<_CharT,_Alloc> __part2 =
+ rope<_CharT,_Alloc> __part2 =
__r.substr(__first.index(), __middle.index() - __first.index());
__r = __prefix;
__r += __part1;