|
1 --- stdcxx-4.2.1/include/rw/_bitmask.h 2008-04-24 20:23:43.000000000 -0400 |
|
2 +++ stdcxx-4.2.1/include/rw/_bitmask.h 2011-01-10 13:03:01.577695057 -0500 |
|
3 @@ -43,36 +43,55 @@ |
|
4 # define _RWSTD_DEFINE_BITMASK_OPERATORS(Bitmask) \ |
|
5 \ |
|
6 inline Bitmask& operator&= (Bitmask &__lhs, Bitmask __rhs) { \ |
|
7 - return __lhs = Bitmask (long (__lhs) & __rhs); \ |
|
8 + __lhs = \ |
|
9 + static_cast<Bitmask> ( \ |
|
10 + (static_cast<unsigned int> (__lhs) & \ |
|
11 + static_cast<unsigned int> (__rhs))); \ |
|
12 + return __lhs; \ |
|
13 } \ |
|
14 \ |
|
15 inline Bitmask& operator|= (Bitmask &__lhs, Bitmask __rhs) { \ |
|
16 - return __lhs = Bitmask (long (__lhs) | __rhs); \ |
|
17 + __lhs = \ |
|
18 + static_cast<Bitmask> ( \ |
|
19 + (static_cast<unsigned int> (__lhs) | \ |
|
20 + static_cast<unsigned int> (__rhs))); \ |
|
21 + return __lhs; \ |
|
22 } \ |
|
23 \ |
|
24 inline Bitmask& operator^= (Bitmask &__lhs, Bitmask __rhs) { \ |
|
25 - return __lhs = Bitmask (long (__lhs) ^ __rhs); \ |
|
26 + __lhs = \ |
|
27 + static_cast<Bitmask> ( \ |
|
28 + (static_cast<unsigned int> (__lhs) ^ \ |
|
29 + static_cast<unsigned int> (__rhs))); \ |
|
30 + return __lhs; \ |
|
31 } \ |
|
32 \ |
|
33 inline Bitmask operator& (Bitmask __lhs, Bitmask __rhs) { \ |
|
34 - return __lhs &= __rhs; \ |
|
35 + unsigned int __ret = static_cast<unsigned int> (__lhs); \ |
|
36 + __ret &= static_cast<unsigned int> (__rhs); \ |
|
37 + return static_cast<Bitmask> (__ret); \ |
|
38 } \ |
|
39 \ |
|
40 inline Bitmask operator| (Bitmask __lhs, Bitmask __rhs) { \ |
|
41 - return __lhs |= __rhs; \ |
|
42 + unsigned int __ret = static_cast<unsigned int> (__lhs); \ |
|
43 + __ret |= static_cast<unsigned int> (__rhs); \ |
|
44 + return static_cast<Bitmask> (__ret); \ |
|
45 } \ |
|
46 \ |
|
47 inline Bitmask operator^ (Bitmask __lhs, Bitmask __rhs) { \ |
|
48 - return __lhs ^= __rhs; \ |
|
49 + unsigned int __ret = static_cast<unsigned int> (__lhs); \ |
|
50 + __ret ^= static_cast<unsigned int> (__rhs); \ |
|
51 + return static_cast<Bitmask> (__ret); \ |
|
52 } \ |
|
53 \ |
|
54 inline Bitmask operator~ (Bitmask __rhs) { \ |
|
55 - return Bitmask (~long (__rhs)); \ |
|
56 + return static_cast<Bitmask> ( \ |
|
57 + (~static_cast<unsigned int> (__rhs))); \ |
|
58 } \ |
|
59 typedef void __rw_unused_typedef |
|
60 |
|
61 #else // if defined (_RWSTD_NO_STATIC_CONST_MEMBER_INIT) |
|
62 -# define _RWSTD_BITMASK_ENUM(ignore) int |
|
63 +# define _RWSTD_BITMASK_ENUM(ignore) unsigned int |
|
64 |
|
65 # define _RWSTD_DEFINE_BITMASK_OPERATORS(ignore) \ |
|
66 typedef void __rw_unused_typedef |
|
67 #===========================================================================# |
|
68 --- stdcxx-4.2.1/include/rw/_iosbase.h 2008-04-24 20:23:43.000000000 -0400 |
|
69 +++ stdcxx-4.2.1/include/rw/_iosbase.h 2011-02-02 11:02:12.120827674 -0500 |
|
70 @@ -51,8 +51,9 @@ |
|
71 _RWSTD_NAMESPACE (std) { |
|
72 |
|
73 |
|
74 -struct _RWSTD_EXPORT ios_base: _RW::__rw_synchronized |
|
75 +class _RWSTD_EXPORT ios_base : public _RW::__rw_synchronized |
|
76 { |
|
77 +public: |
|
78 // 27.4.2.1.1 |
|
79 typedef _RW::__rw_failure failure; |
|
80 |
|
81 @@ -218,7 +219,8 @@ |
|
82 #endif // _RWSTD_NO_DEPRECATED |
|
83 |
|
84 // 27.4.2.1.6 |
|
85 - struct _RWSTD_EXPORT Init { |
|
86 + class _RWSTD_EXPORT Init { |
|
87 + public: |
|
88 Init (); |
|
89 |
|
90 ~Init (); |
|
91 @@ -226,7 +228,7 @@ |
|
92 |
|
93 // 27.4.2.2, p1 |
|
94 fmtflags flags () const { |
|
95 - return fmtflags (_C_fmtfl); |
|
96 + return static_cast<fmtflags> (_C_fmtfl); |
|
97 } |
|
98 |
|
99 // 27.4.2.2, p2 |
|
100 @@ -239,12 +241,14 @@ |
|
101 |
|
102 // 27.4.2.2, p6 |
|
103 fmtflags setf (fmtflags __f, fmtflags __mask) { |
|
104 - return flags (flags () & ~__mask | __f & __mask); |
|
105 + fmtflags __ret = flags(); |
|
106 + (void) flags (flags () & ~__mask | __f & __mask); |
|
107 + return __ret; |
|
108 } |
|
109 |
|
110 // 27.4.2.2, p8 |
|
111 void unsetf (fmtflags __f) { |
|
112 - flags (flags () & ~__f); |
|
113 + _C_fmtfl &= ~(static_cast<unsigned int> (__f)); |
|
114 } |
|
115 |
|
116 // 27.4.2.2, p9 |
|
117 @@ -335,7 +339,7 @@ |
|
118 void *_C_rdbuf; // pointer to the associated stream buffer |
|
119 _RWSTD_STREAMSIZE _C_prec; // current precision |
|
120 _RWSTD_STREAMSIZE _C_wide; // current width |
|
121 - unsigned _C_fmtfl; // formatting flags |
|
122 + unsigned int _C_fmtfl; // formatting flags |
|
123 unsigned char _C_state; // stream state |
|
124 unsigned char _C_except; // active exceptions |
|
125 |
|
126 @@ -364,7 +368,7 @@ |
|
127 _C_usr_data *_C_usr; // user data (iword, pword, callbacks) |
|
128 locale _C_loc; // locale associated with stream |
|
129 |
|
130 - friend struct _RWSTD_EXPORT Init; |
|
131 + friend class _RWSTD_EXPORT Init; |
|
132 |
|
133 // working around an EDG eccp 3.2 and prior bug (see PR #29526) |
|
134 friend struct _C_usr_data; |
|
135 #===========================================================================# |
|
136 --- stdcxx-4.2.1/include/fstream 2008-04-24 20:23:57.000000000 -0400 |
|
137 +++ stdcxx-4.2.1/include/fstream 2011-01-10 12:06:08.239752260 -0500 |
|
138 @@ -121,7 +121,7 @@ |
|
139 private: |
|
140 |
|
141 // g++ 2.95 error: `std::ios_base::Init' does not declare a template type |
|
142 - friend struct ios_base::Init; |
|
143 + friend class ios_base::Init; |
|
144 |
|
145 #endif // _RWSTD_NO_EXT_FILEBUF && !_RWSTD_NO_STATIC_IOSTREAM_INIT |
|
146 |
|
147 #===========================================================================# |
|
148 --- stdcxx-4.2.1/include/iomanip 2008-04-24 20:23:57.000000000 -0400 |
|
149 +++ stdcxx-4.2.1/include/iomanip 2011-01-10 19:42:44.215940171 -0500 |
|
150 @@ -85,11 +85,12 @@ |
|
151 |
|
152 #endif // _RWSTD_NO_EXT_SETBASE |
|
153 |
|
154 - const unsigned __ifl = |
|
155 - __strm.flags () & ~_STD::ios_base::basefield |
|
156 - & ~( _RWSTD_STATIC_CAST (unsigned, _RWSTD_IOS_BASEMASK) |
|
157 - << _RWSTD_IOS_BASEOFF) |
|
158 - | __base << _RWSTD_IOS_BASEOFF; |
|
159 + unsigned int __ifl = __strm.flags (); |
|
160 + __ifl &= ~_STD::ios_base::basefield; |
|
161 + __ifl &= ~(_RWSTD_STATIC_CAST (unsigned int, |
|
162 + _RWSTD_IOS_BASEMASK << _RWSTD_IOS_BASEOFF)); |
|
163 + __ifl |= _RWSTD_STATIC_CAST (unsigned int, |
|
164 + __base << _RWSTD_IOS_BASEOFF); |
|
165 |
|
166 __strm.flags (_STD::ios_base::fmtflags (__ifl)); |
|
167 } |
|
168 #===========================================================================# |
|
169 --- stdcxx-4.2.1/src/ios.cpp 2011-01-09 21:37:11.214689576 -0500 |
|
170 +++ stdcxx-4.2.1/src/ios.cpp 2011-01-10 15:21:29.777939998 -0500 |
|
171 @@ -61,7 +61,14 @@ |
|
172 |
|
173 |
|
174 ios_base::ios_base () |
|
175 - : _C_usr (0) |
|
176 + : _C_rdbuf(0UL), |
|
177 + _C_prec(0U), |
|
178 + _C_wide(0U), |
|
179 + _C_fmtfl(0U), |
|
180 + _C_state('\0'), |
|
181 + _C_except('\0'), |
|
182 + _C_usr(0UL), |
|
183 + _C_loc(std::locale()) |
|
184 { |
|
185 // outlined to hide implementation details |
|
186 // no-op |
|
187 @@ -112,28 +119,28 @@ |
|
188 |
|
189 ios_base::fmtflags ios_base::flags (fmtflags fl) |
|
190 { |
|
191 - const unsigned mask = |
|
192 - ~(unsigned (_RWSTD_IOS_BASEMASK) << _RWSTD_IOS_BASEOFF); |
|
193 + unsigned int mask = |
|
194 + ~(static_cast<unsigned int> ((_RWSTD_IOS_BASEMASK << _RWSTD_IOS_BASEOFF))); |
|
195 |
|
196 - unsigned ifl = unsigned (fl); |
|
197 + unsigned int ifl = static_cast<unsigned int> (fl); |
|
198 |
|
199 - switch (fl & basefield) { |
|
200 + switch (static_cast<unsigned int> (fl & static_cast<unsigned int> (basefield))) { |
|
201 // if basefield is set, clear the base mask and set |
|
202 // the numeric base bits according to the basefield |
|
203 - case oct: |
|
204 - ifl = ifl & mask | 8U << _RWSTD_IOS_BASEOFF; |
|
205 + case static_cast<unsigned int> (ios_base::oct): |
|
206 + ifl = static_cast<unsigned int> ((ifl & mask) | (8U << _RWSTD_IOS_BASEOFF)); |
|
207 break; |
|
208 |
|
209 - case dec: |
|
210 - ifl = ifl & mask | 10U << _RWSTD_IOS_BASEOFF; |
|
211 + case static_cast<unsigned int> (ios_base::dec): |
|
212 + ifl = static_cast<unsigned int> ((ifl & mask) | (10U << _RWSTD_IOS_BASEOFF)); |
|
213 break; |
|
214 |
|
215 - case hex: |
|
216 - ifl = ifl & mask | 16U << _RWSTD_IOS_BASEOFF; |
|
217 + case static_cast<unsigned int> (ios_base::hex): |
|
218 + ifl = static_cast<unsigned int> ((ifl & mask) | (16U << _RWSTD_IOS_BASEOFF)); |
|
219 break; |
|
220 |
|
221 case _RWSTD_IOS_BIN: |
|
222 - ifl = ifl & mask | 2U << _RWSTD_IOS_BASEOFF; |
|
223 + ifl = static_cast<unsigned int> ((ifl & mask) | (2U << _RWSTD_IOS_BASEOFF)); |
|
224 break; |
|
225 |
|
226 case 0: |
|
227 @@ -141,20 +148,21 @@ |
|
228 // set the basefield accordingly, making sure that when |
|
229 // numeric base bits are set to 10, dec is left alone |
|
230 // (necessary for autodected parsing to work correctly) |
|
231 - switch (ifl >> _RWSTD_IOS_BASEOFF) { |
|
232 - case 0: ifl |= 10U << _RWSTD_IOS_BASEOFF; break; |
|
233 - case 2: ifl |= _RWSTD_IOS_BIN; break; |
|
234 - case 8: ifl |= oct; break; |
|
235 + switch (static_cast<unsigned int> (ifl >> _RWSTD_IOS_BASEOFF)) { |
|
236 + case 0: ifl |= static_cast<unsigned int> (10U << _RWSTD_IOS_BASEOFF); break; |
|
237 + case 2: ifl |= static_cast<unsigned int> (_RWSTD_IOS_BIN); break; |
|
238 + case 8: ifl |= static_cast<unsigned int> (oct); break; |
|
239 case 10: /* no-op */ break; |
|
240 - case 16: ifl |= hex; break; |
|
241 + case 16: ifl |= static_cast<unsigned int> (hex); break; |
|
242 } |
|
243 break; |
|
244 |
|
245 default: |
|
246 - ifl |= 10U << _RWSTD_IOS_BASEOFF; |
|
247 + ifl |= static_cast<unsigned int> (10U << _RWSTD_IOS_BASEOFF); |
|
248 } |
|
249 |
|
250 - return fmtflags (_RWSTD_ATOMIC_IO_SWAP (_C_fmtfl, ifl, _C_mutex)); |
|
251 + return static_cast<fmtflags> |
|
252 + (_RWSTD_ATOMIC_IO_SWAP (_C_fmtfl, ifl, _C_mutex)); |
|
253 } |
|
254 |