1 # DP: 1999-11-10 Benjamin Kosnik <bkoz@haight.constant.com>
2 # DP: Matthias Klose <doko@cs.tu-berlin.de>
4 # DP: * stl_rope.h: Fix initialization order.
5 # DP: * stl_deque.h: Use static_casts<size_type>(signed_type).
8 1999-11-10 Benjamin Kosnik <bkoz@haight.constant.com>
9 Matthias Klose <doko@cs.tu-berlin.de>
11 * stl_rope.h: Fix initialization order.
12 * stl_deque.h: Use static_casts<size_type>(signed_type).
14 --- libstdc++/stl/stl_deque.h~ Wed Sep 2 19:24:47 1998
15 +++ libstdc++/stl/stl_deque.h Wed Nov 10 23:10:27 1999
17 iterator __next = __pos;
19 difference_type __index = __pos - _M_start;
20 - if (__index < (size() >> 1)) {
21 + if (static_cast<size_type>(__index) < (size() >> 1)) {
22 copy_backward(_M_start, __pos, __next);
27 difference_type __n = __last - __first;
28 difference_type __elems_before = __first - _M_start;
29 - if (__elems_before < (size() - __n) / 2) {
30 + if (static_cast<size_type>(__elems_before) < (size() - __n) / 2) {
31 copy_backward(_M_start, __first, __last);
32 iterator __new_start = _M_start + __n;
33 destroy(_M_start, __new_start);
36 difference_type __index = __pos - _M_start;
37 value_type __x_copy = __x;
38 - if (__index < size() / 2) {
39 + if (static_cast<size_type>(__index) < size() / 2) {
41 iterator __front1 = _M_start;
44 deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos)
46 difference_type __index = __pos - _M_start;
47 - if (__index < size() / 2) {
48 + if (static_cast<size_type>(__index) < size() / 2) {
50 iterator __front1 = _M_start;
53 const difference_type __elems_before = __pos - _M_start;
54 size_type __length = size();
55 value_type __x_copy = __x;
56 - if (__elems_before < __length / 2) {
57 + if (static_cast<size_type>(__elems_before) < __length / 2) {
58 iterator __new_start = _M_reserve_elements_at_front(__n);
59 iterator __old_start = _M_start;
60 __pos = _M_start + __elems_before;
63 const difference_type __elemsbefore = __pos - _M_start;
64 size_type __length = size();
65 - if (__elemsbefore < __length / 2) {
66 + if (static_cast<size_type>(__elemsbefore) < __length / 2) {
67 iterator __new_start = _M_reserve_elements_at_front(__n);
68 iterator __old_start = _M_start;
69 __pos = _M_start + __elemsbefore;
70 --- libstdc++/stl/stl_rope.h.old Wed Sep 2 19:25:05 1998
71 +++ libstdc++/stl/stl_rope.h Wed Nov 10 23:25:36 1999
73 typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type;
74 _Rope_RopeRep(_Tag __t, int __d, bool __b, size_t __size,
76 - : _M_tag(__t), _M_depth(__d), _M_is_balanced(__b), _M_c_string(0),
77 - _Rope_rep_base<_CharT,_Alloc>(__size, __a)
78 + : _Rope_rep_base<_CharT,_Alloc>(__size, __a),
79 + _M_tag(__t), _M_depth(__d), _M_is_balanced(__b), _M_c_string(0)
85 typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type;
86 _Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size, allocator_type __a)
88 - , _Rope_RopeRep<_CharT,_Alloc>(_S_leaf, 0, true, __size, __a)
89 + : _Rope_RopeRep<_CharT,_Alloc>(_S_leaf, 0, true, __size, __a),
92 __stl_assert(__size > 0);
93 if (_S_is_basic_char_type((_CharT *)0)) {
95 _Rope_RopeConcatenation(_Rope_RopeRep<_CharT,_Alloc>* __l,
96 _Rope_RopeRep<_CharT,_Alloc>* __r,
98 - : _M_left(__l), _M_right(__r)
99 - , _Rope_RopeRep<_CharT,_Alloc>(
100 + : _Rope_RopeRep<_CharT,_Alloc>(
101 _S_concat, max(__l->_M_depth, __r->_M_depth) + 1, false,
102 - __l->_M_size + __r->_M_size, __a)
103 + __l->_M_size + __r->_M_size, __a),
104 + _M_left(__l), _M_right(__r)
107 ~_Rope_RopeConcatenation() {
108 @@ -629,11 +629,12 @@
109 typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type;
110 _Rope_RopeFunction(char_producer<_CharT>* __f, size_t __size,
111 bool __d, allocator_type __a)
113 + :_Rope_RopeRep<_CharT,_Alloc>(_S_function, 0, true, __size, __a),
116 , _M_delete_when_done(__d)
118 - , _Rope_RopeRep<_CharT,_Alloc>(_S_function, 0, true, __size, __a) {
120 __stl_assert(__size > 0);
124 typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type;
125 _Rope_RopeSubstring(_Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s,
126 size_t __l, allocator_type __a)
128 + : _Rope_RopeFunction<_CharT,_Alloc>(this, __l, false, __a), _M_base(__b)
130 - , _Rope_RopeFunction<_CharT,_Alloc>(this, __l, false, __a)
132 __stl_assert(__l > 0);
133 __stl_assert(__s + __l <= __b->_M_size);
134 @@ -766,16 +766,16 @@
135 _My_rope* _M_root; // The whole rope.
137 _Rope_char_ref_proxy(_My_rope* __r, size_t __p) :
138 - _M_pos(__p), _M_root(__r), _M_current_valid(false) {}
139 + _M_pos(__p), _M_current_valid(false), _M_root(__r) {}
140 _Rope_char_ref_proxy(const _Rope_char_ref_proxy& __x) :
141 - _M_pos(__x._M_pos), _M_root(__x._M_root), _M_current_valid(false) {}
142 + _M_pos(__x._M_pos), _M_current_valid(false), _M_root(__x._M_root) {}
143 // Don't preserve cache if the reference can outlive the
144 // expression. We claim that's not possible without calling
145 // a copy constructor or generating reference to a proxy
146 // reference. We declare the latter to have undefined semantics.
147 _Rope_char_ref_proxy(_My_rope* __r, size_t __p,
149 - _M_pos(__p), _M_root(__r), _M_current(__c), _M_current_valid(true) {}
150 + _M_pos(__p), _M_current(__c), _M_current_valid(true), _M_root(__r) {}
151 inline operator _CharT () const;
152 _Rope_char_ref_proxy& operator= (_CharT __c);
153 _Rope_char_ptr_proxy<_CharT,_Alloc> operator& () const;