]>
Commit | Line | Data |
---|---|---|
d405059b | 1 | # DP: 1999-11-10 Benjamin Kosnik <bkoz@haight.constant.com> |
2 | # DP: Matthias Klose <doko@cs.tu-berlin.de> | |
3 | # DP: | |
4 | # DP: * stl_rope.h: Fix initialization order. | |
5 | # DP: * stl_deque.h: Use static_casts<size_type>(signed_type). | |
6 | ||
7 | ||
8 | 1999-11-10 Benjamin Kosnik <bkoz@haight.constant.com> | |
9 | Matthias Klose <doko@cs.tu-berlin.de> | |
10 | ||
11 | * stl_rope.h: Fix initialization order. | |
12 | * stl_deque.h: Use static_casts<size_type>(signed_type). | |
13 | ||
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 | |
16 | @@ -815,7 +815,7 @@ | |
17 | iterator __next = __pos; | |
18 | ++__next; | |
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); | |
23 | pop_front(); | |
24 | } | |
25 | @@ -1048,7 +1048,7 @@ | |
26 | else { | |
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); | |
34 | @@ -1282,7 +1282,7 @@ | |
35 | { | |
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) { | |
40 | push_front(front()); | |
41 | iterator __front1 = _M_start; | |
42 | ++__front1; | |
43 | @@ -1311,7 +1311,7 @@ | |
44 | deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos) | |
45 | { | |
46 | difference_type __index = __pos - _M_start; | |
47 | - if (__index < size() / 2) { | |
48 | + if (static_cast<size_type>(__index) < size() / 2) { | |
49 | push_front(front()); | |
50 | iterator __front1 = _M_start; | |
51 | ++__front1; | |
52 | @@ -1344,7 +1344,7 @@ | |
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; | |
61 | @@ -1403,7 +1403,7 @@ | |
62 | { | |
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 | |
72 | @@ -386,8 +386,8 @@ | |
73 | typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type; | |
74 | _Rope_RopeRep(_Tag __t, int __d, bool __b, size_t __size, | |
75 | allocator_type __a) | |
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) | |
80 | { | |
81 | # ifndef __GC | |
82 | _M_refcount = 1; | |
83 | @@ -562,8 +562,8 @@ | |
84 | /* doesn't matter. */ | |
85 | typedef _Rope_rep_base<_CharT,_Alloc>::allocator_type allocator_type; | |
86 | _Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size, allocator_type __a) | |
87 | - : _M_data(__d) | |
88 | - , _Rope_RopeRep<_CharT,_Alloc>(_S_leaf, 0, true, __size, __a) | |
89 | + : _Rope_RopeRep<_CharT,_Alloc>(_S_leaf, 0, true, __size, __a), | |
90 | + _M_data(__d) | |
91 | { | |
92 | __stl_assert(__size > 0); | |
93 | if (_S_is_basic_char_type((_CharT *)0)) { | |
94 | @@ -593,10 +593,10 @@ | |
95 | _Rope_RopeConcatenation(_Rope_RopeRep<_CharT,_Alloc>* __l, | |
96 | _Rope_RopeRep<_CharT,_Alloc>* __r, | |
97 | allocator_type __a) | |
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) | |
105 | {} | |
106 | # ifndef __GC | |
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) | |
112 | - : _M_fn(__f) | |
113 | + :_Rope_RopeRep<_CharT,_Alloc>(_S_function, 0, true, __size, __a), | |
114 | + _M_fn(__f) | |
115 | # ifndef __GC | |
116 | , _M_delete_when_done(__d) | |
117 | # endif | |
118 | - , _Rope_RopeRep<_CharT,_Alloc>(_S_function, 0, true, __size, __a) { | |
119 | + { | |
120 | __stl_assert(__size > 0); | |
121 | # ifdef __GC | |
122 | if (__d) { | |
123 | @@ -693,9 +694,8 @@ | |
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) | |
127 | - : _M_base(__b) | |
128 | + : _Rope_RopeFunction<_CharT,_Alloc>(this, __l, false, __a), _M_base(__b) | |
129 | , _M_start(__s) | |
130 | - , _Rope_RopeFunction<_CharT,_Alloc>(this, __l, false, __a) | |
131 | { | |
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. | |
136 | public: | |
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, | |
148 | _CharT __c) : | |
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; |