Merge lp:~zorba-coders/zorba/bug1100471 into lp:zorba
- bug1100471
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Rodolfo Ochoa | ||||
Approved revision: | 11375 | ||||
Merged at revision: | 11405 | ||||
Proposed branch: | lp:~zorba-coders/zorba/bug1100471 | ||||
Merge into: | lp:zorba | ||||
Diff against target: |
846 lines (+133/-86) 35 files modified
src/api/base64_streambuf.cpp (+9/-7) src/api/module_info_impl.cpp (+1/-0) src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp (+1/-1) src/runtime/base64/base64_impl.cpp (+1/-1) src/runtime/datetime/datetime_impl.cpp (+4/-4) src/runtime/full_text/ft_module_impl.cpp (+4/-2) src/runtime/numerics/format_integer.cpp (+1/-1) src/runtime/parsing_and_serializing/parse_fragment_impl.cpp (+2/-2) src/runtime/sequences/sequences_impl.cpp (+2/-2) src/runtime/uris/uris_impl.cpp (+1/-1) src/store/naive/atomic_items.cpp (+2/-2) src/store/naive/json_items.cpp (+10/-7) src/store/naive/loader_dtd.cpp (+4/-3) src/store/naive/node_iterators.cpp (+3/-3) src/store/naive/simple_collection.cpp (+3/-2) src/store/naive/simple_index_value.cpp (+2/-1) src/store/naive/simple_item_factory.cpp (+1/-1) src/store/naive/simple_lazy_temp_seq.cpp (+3/-2) src/store/naive/simple_temp_seq.cpp (+3/-3) src/types/schema/schema.cpp (+1/-1) src/unit_tests/test_base64_streambuf.cpp (+3/-1) src/unit_tests/test_hashmaps.cpp (+2/-2) src/unit_tests/test_icu_streambuf.cpp (+3/-1) src/unit_tests/test_utf8_streambuf.cpp (+3/-3) src/util/base64_util.cpp (+18/-7) src/util/base64_util.h (+4/-2) src/util/hexbinary_util.cpp (+17/-7) src/util/hexbinary_util.h (+4/-2) src/util/icu_streambuf.cpp (+4/-2) src/util/mem_streambuf.cpp (+2/-2) src/util/stream_util.cpp (+3/-1) src/util/utf8_util.cpp (+5/-3) src/zorbaserialization/bin_archiver.cpp (+2/-2) src/zorbatypes/datetime/datetimetype.cpp (+2/-2) src/zorbatypes/datetime/duration.cpp (+3/-3) |
||||
To merge this branch: | bzr merge lp:~zorba-coders/zorba/bug1100471 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Rodolfo Ochoa | Approve | ||
Paul J. Lucas | Approve | ||
Review via email: mp+159239@code.launchpad.net |
Commit message
Solving windows warnings
Description of the change
Solving windows warnings
Rodolfo Ochoa (rodolfo-ochoa) wrote : | # |
Paul J. Lucas (paul-lucas) wrote : | # |
You don't hack the parser.cpp or lexer.cpp files directly. Please revert ALL changes to those files and modify the .y or .l files ONLY. If the warnings still persist in those files due to generated code, it's simply too bad.
In general, you don't need to fully qualify casts, e.g., you can do static_
I've fixed several formatting things (to put the code back to my style) and also a few other things. You should also seek approval from whoever else's code you touch.
- 11373. By Rodolfo Ochoa
-
Merge from Paul's changes
- 11374. By Rodolfo Ochoa
-
Merge from trunk
- 11375. By Rodolfo Ochoa
-
Reverting parser & lexer changes
Paul J. Lucas (paul-lucas) wrote : | # |
Line 73 in the diff is not a logically equivalent change. You should seek approval from whoever's code that is. I'll approve if that person approves.
Paul J. Lucas (paul-lucas) : | # |
Rodolfo Ochoa (rodolfo-ochoa) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug1100471-2013-04-
All tests succeeded!
Preview Diff
1 | === modified file 'src/api/base64_streambuf.cpp' | |||
2 | --- src/api/base64_streambuf.cpp 2013-02-07 17:24:36 +0000 | |||
3 | +++ src/api/base64_streambuf.cpp 2013-04-17 18:46:27 +0000 | |||
4 | @@ -156,8 +156,8 @@ | |||
5 | 156 | // Get any chunk fragment pending the the get buffer first. | 156 | // Get any chunk fragment pending the the get buffer first. |
6 | 157 | // | 157 | // |
7 | 158 | streamsize const n = min( gsize, size ); | 158 | streamsize const n = min( gsize, size ); |
10 | 159 | traits_type::copy( to, gptr(), n ); | 159 | traits_type::copy( to, gptr(), static_cast<size_t>( n ) ); |
11 | 160 | gbump( n ); | 160 | gbump( static_cast<int>( n ) ); |
12 | 161 | to += n; | 161 | to += n; |
13 | 162 | size -= n, return_size += n; | 162 | size -= n, return_size += n; |
14 | 163 | } | 163 | } |
15 | @@ -165,13 +165,14 @@ | |||
16 | 165 | // | 165 | // |
17 | 166 | // Must get bytes in terms of encoded size. | 166 | // Must get bytes in terms of encoded size. |
18 | 167 | // | 167 | // |
20 | 168 | size = base64::encoded_size( size ); | 168 | size = base64::encoded_size( static_cast<size_type>( size ) ); |
21 | 169 | 169 | ||
22 | 170 | while ( size ) { | 170 | while ( size ) { |
23 | 171 | char ebuf[ Large_External_Buf_Size ]; | 171 | char ebuf[ Large_External_Buf_Size ]; |
24 | 172 | streamsize const get = min( (streamsize)(sizeof ebuf), size ); | 172 | streamsize const get = min( (streamsize)(sizeof ebuf), size ); |
25 | 173 | if ( streamsize got = orig_buf_->sgetn( ebuf, get ) ) { | 173 | if ( streamsize got = orig_buf_->sgetn( ebuf, get ) ) { |
27 | 174 | streamsize const decoded = base64::decode( ebuf, got, to ); | 174 | streamsize const decoded = |
28 | 175 | base64::decode( ebuf, static_cast<size_type>( got ), to ); | ||
29 | 175 | to += decoded; | 176 | to += decoded; |
30 | 176 | size -= got, return_size += decoded; | 177 | size -= got, return_size += decoded; |
31 | 177 | } else | 178 | } else |
32 | @@ -198,7 +199,8 @@ | |||
33 | 198 | while ( size >= 3 ) { | 199 | while ( size >= 3 ) { |
34 | 199 | char ebuf[ Large_External_Buf_Size ]; | 200 | char ebuf[ Large_External_Buf_Size ]; |
35 | 200 | streamsize const put = min( (streamsize)(sizeof ebuf), size ); | 201 | streamsize const put = min( (streamsize)(sizeof ebuf), size ); |
37 | 201 | streamsize const encoded = base64::encode( from, put, ebuf ); | 202 | streamsize const encoded = |
38 | 203 | base64::encode( from, static_cast<size_type>( put ), ebuf ); | ||
39 | 202 | orig_buf_->sputn( ebuf, encoded ); | 204 | orig_buf_->sputn( ebuf, encoded ); |
40 | 203 | from += put, size -= put, return_size += put; | 205 | from += put, size -= put, return_size += put; |
41 | 204 | } | 206 | } |
42 | @@ -207,8 +209,8 @@ | |||
43 | 207 | // Put any remaining chunk fragment into the put buffer. | 209 | // Put any remaining chunk fragment into the put buffer. |
44 | 208 | // | 210 | // |
45 | 209 | if ( size ) { | 211 | if ( size ) { |
48 | 210 | traits_type::copy( pbuf_, from, size ); | 212 | traits_type::copy( pbuf_, from, static_cast<size_t>( size ) ); |
49 | 211 | plen_ = size; | 213 | plen_ = static_cast<int>( size ); |
50 | 212 | } | 214 | } |
51 | 213 | 215 | ||
52 | 214 | return return_size; | 216 | return return_size; |
53 | 215 | 217 | ||
54 | === modified file 'src/api/module_info_impl.cpp' | |||
55 | --- src/api/module_info_impl.cpp 2013-02-15 06:02:54 +0000 | |||
56 | +++ src/api/module_info_impl.cpp 2013-04-17 18:46:27 +0000 | |||
57 | @@ -13,6 +13,7 @@ | |||
58 | 13 | * See the License for the specific language governing permissions and | 13 | * See the License for the specific language governing permissions and |
59 | 14 | * limitations under the License. | 14 | * limitations under the License. |
60 | 15 | */ | 15 | */ |
61 | 16 | #include "stdafx.h" | ||
62 | 16 | #include "api/module_info_impl.h" | 17 | #include "api/module_info_impl.h" |
63 | 17 | #include <zorba/zorba_string.h> | 18 | #include <zorba/zorba_string.h> |
64 | 18 | #include "zorbatypes/zstring.h" | 19 | #include "zorbatypes/zstring.h" |
65 | 19 | 20 | ||
66 | === modified file 'src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp' | |||
67 | --- src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2013-04-08 00:44:26 +0000 | |||
68 | +++ src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2013-04-17 18:46:27 +0000 | |||
69 | @@ -1208,7 +1208,7 @@ | |||
70 | 1208 | 1208 | ||
71 | 1209 | void end_visit(const CollectionDecl& n, void*) | 1209 | void end_visit(const CollectionDecl& n, void*) |
72 | 1210 | { | 1210 | { |
74 | 1211 | if ((!theOptions & xqdoc_component_collections)) | 1211 | if (!(theOptions & xqdoc_component_collections)) |
75 | 1212 | return; | 1212 | return; |
76 | 1213 | 1213 | ||
77 | 1214 | store::Item_t lCollectionQName, lNameQName, lTypeQName; | 1214 | store::Item_t lCollectionQName, lNameQName, lTypeQName; |
78 | 1215 | 1215 | ||
79 | === modified file 'src/runtime/base64/base64_impl.cpp' | |||
80 | --- src/runtime/base64/base64_impl.cpp 2013-02-07 17:24:36 +0000 | |||
81 | +++ src/runtime/base64/base64_impl.cpp 2013-04-17 18:46:27 +0000 | |||
82 | @@ -113,7 +113,7 @@ | |||
83 | 113 | while (lTranscoder.good()) | 113 | while (lTranscoder.good()) |
84 | 114 | { | 114 | { |
85 | 115 | lTranscoder.read(buf, 1024); | 115 | lTranscoder.read(buf, 1024); |
87 | 116 | lTranscodedString.append(buf, lTranscoder.gcount()); | 116 | lTranscodedString.append(buf, static_cast<zstring::size_type>(lTranscoder.gcount())); |
88 | 117 | } | 117 | } |
89 | 118 | GENV_ITEMFACTORY->createString(result, lTranscodedString); | 118 | GENV_ITEMFACTORY->createString(result, lTranscodedString); |
90 | 119 | } | 119 | } |
91 | 120 | 120 | ||
92 | === modified file 'src/runtime/datetime/datetime_impl.cpp' | |||
93 | --- src/runtime/datetime/datetime_impl.cpp 2013-03-12 16:51:44 +0000 | |||
94 | +++ src/runtime/datetime/datetime_impl.cpp 2013-04-17 18:46:27 +0000 | |||
95 | @@ -49,10 +49,10 @@ | |||
96 | 49 | ::memset( tm, 0, sizeof( *tm ) ); | 49 | ::memset( tm, 0, sizeof( *tm ) ); |
97 | 50 | time::parse( buf, fmt, lang, country, tm, &set_fields ); | 50 | time::parse( buf, fmt, lang, country, tm, &set_fields ); |
98 | 51 | 51 | ||
103 | 52 | bool set_mday = set_fields & time::set_mday; | 52 | bool set_mday = !!(set_fields & time::set_mday); |
104 | 53 | bool set_mon = set_fields & time::set_mon; | 53 | bool set_mon = !!(set_fields & time::set_mon); |
105 | 54 | bool const set_yday = set_fields & time::set_yday; | 54 | bool const set_yday = !!(set_fields & time::set_yday); |
106 | 55 | bool const set_year = set_fields & time::set_year; | 55 | bool const set_year = !!(set_fields & time::set_year); |
107 | 56 | 56 | ||
108 | 57 | if ( set_yday && set_year && (!set_mday || !set_mon) ) { | 57 | if ( set_yday && set_year && (!set_mday || !set_mon) ) { |
109 | 58 | // | 58 | // |
110 | 59 | 59 | ||
111 | === modified file 'src/runtime/full_text/ft_module_impl.cpp' | |||
112 | --- src/runtime/full_text/ft_module_impl.cpp 2013-02-26 04:12:43 +0000 | |||
113 | +++ src/runtime/full_text/ft_module_impl.cpp 2013-04-17 18:46:27 +0000 | |||
114 | @@ -345,7 +345,8 @@ | |||
115 | 345 | 345 | ||
116 | 346 | consumeNext( item, theChildren[0], plan_state ); | 346 | consumeNext( item, theChildren[0], plan_state ); |
117 | 347 | try { | 347 | try { |
119 | 348 | is_supported = ft_stop_words_set::get_default( get_lang_from( item, loc ) ); | 348 | is_supported = |
120 | 349 | !!ft_stop_words_set::get_default( get_lang_from( item, loc ) ); | ||
121 | 349 | } | 350 | } |
122 | 350 | catch ( ZorbaException const &e ) { | 351 | catch ( ZorbaException const &e ) { |
123 | 351 | if ( e.diagnostic() != err::FTST0009 /* lang not supported */ ) | 352 | if ( e.diagnostic() != err::FTST0009 /* lang not supported */ ) |
124 | @@ -606,6 +607,7 @@ | |||
125 | 606 | ZORBA_ASSERT( state->tresult_.get() ); | 607 | ZORBA_ASSERT( state->tresult_.get() ); |
126 | 607 | } | 608 | } |
127 | 608 | 609 | ||
128 | 610 | #ifndef WIN32 | ||
129 | 609 | #ifdef GCC_PRAGMA_DIAGNOSTIC_PUSH | 611 | #ifdef GCC_PRAGMA_DIAGNOSTIC_PUSH |
130 | 610 | # pragma GCC diagnostic pop | 612 | # pragma GCC diagnostic pop |
131 | 611 | #else | 613 | #else |
132 | @@ -613,7 +615,7 @@ | |||
133 | 613 | # pragma GCC diagnostic warning "-Wunknown-pragmas" | 615 | # pragma GCC diagnostic warning "-Wunknown-pragmas" |
134 | 614 | # pragma GCC diagnostic warning "-Wpragmas" | 616 | # pragma GCC diagnostic warning "-Wpragmas" |
135 | 615 | #endif /* GCC_PRAGMA_DIAGNOSTIC_PUSH */ | 617 | #endif /* GCC_PRAGMA_DIAGNOSTIC_PUSH */ |
137 | 616 | 618 | #endif /* WIN32 */ | |
138 | 617 | /////////////////////////////////////////////////////////////////////////////// | 619 | /////////////////////////////////////////////////////////////////////////////// |
139 | 618 | 620 | ||
140 | 619 | bool TokenizeNodeIterator::nextImpl( store::Item_t &result, | 621 | bool TokenizeNodeIterator::nextImpl( store::Item_t &result, |
141 | 620 | 622 | ||
142 | === modified file 'src/runtime/numerics/format_integer.cpp' | |||
143 | --- src/runtime/numerics/format_integer.cpp 2013-04-09 23:59:24 +0000 | |||
144 | +++ src/runtime/numerics/format_integer.cpp 2013-04-17 18:46:27 +0000 | |||
145 | @@ -317,7 +317,7 @@ | |||
146 | 317 | ostringstream oss; | 317 | ostringstream oss; |
147 | 318 | if ( pic.primary.type == picture::ROMAN ) | 318 | if ( pic.primary.type == picture::ROMAN ) |
148 | 319 | oss << uppercase; | 319 | oss << uppercase; |
150 | 320 | oss << roman( n ); | 320 | oss << roman( static_cast<unsigned>( n ) ); |
151 | 321 | *dest += oss.str(); | 321 | *dest += oss.str(); |
152 | 322 | } | 322 | } |
153 | 323 | catch ( range_error const& ) { | 323 | catch ( range_error const& ) { |
154 | 324 | 324 | ||
155 | === modified file 'src/runtime/parsing_and_serializing/parse_fragment_impl.cpp' | |||
156 | --- src/runtime/parsing_and_serializing/parse_fragment_impl.cpp 2013-03-05 22:57:42 +0000 | |||
157 | +++ src/runtime/parsing_and_serializing/parse_fragment_impl.cpp 2013-04-17 18:46:27 +0000 | |||
158 | @@ -364,7 +364,7 @@ | |||
159 | 364 | while (lInstream->good()) | 364 | while (lInstream->good()) |
160 | 365 | { | 365 | { |
161 | 366 | lInstream->read(buf, 1024); | 366 | lInstream->read(buf, 1024); |
163 | 367 | lDocString.append(buf, lInstream->gcount()); | 367 | lDocString.append(buf, static_cast<zstring::size_type>(lInstream->gcount())); |
164 | 368 | } | 368 | } |
165 | 369 | } | 369 | } |
166 | 370 | else | 370 | else |
167 | @@ -385,7 +385,7 @@ | |||
168 | 385 | xmlFree(lResult); | 385 | xmlFree(lResult); |
169 | 386 | xmlFreeDoc(lDoc); | 386 | xmlFreeDoc(lDoc); |
170 | 387 | } | 387 | } |
172 | 388 | catch ( std::exception const& e) | 388 | catch ( std::exception const& ) |
173 | 389 | { | 389 | { |
174 | 390 | zstring lErrorMsg; | 390 | zstring lErrorMsg; |
175 | 391 | lErrorMsg = "\"" + lDocString + "\""; | 391 | lErrorMsg = "\"" + lDocString + "\""; |
176 | 392 | 392 | ||
177 | === modified file 'src/runtime/sequences/sequences_impl.cpp' | |||
178 | --- src/runtime/sequences/sequences_impl.cpp 2013-04-11 23:37:12 +0000 | |||
179 | +++ src/runtime/sequences/sequences_impl.cpp 2013-04-17 18:46:27 +0000 | |||
180 | @@ -1347,7 +1347,7 @@ | |||
181 | 1347 | 1347 | ||
182 | 1348 | theChildren[0]->count(result, planState); | 1348 | theChildren[0]->count(result, planState); |
183 | 1349 | 1349 | ||
185 | 1350 | STACK_PUSH(result, state); | 1350 | STACK_PUSH(!!result, state); |
186 | 1351 | 1351 | ||
187 | 1352 | STACK_END(state); | 1352 | STACK_END(state); |
188 | 1353 | } | 1353 | } |
189 | @@ -2143,7 +2143,7 @@ | |||
190 | 2143 | { | 2143 | { |
191 | 2144 | readDocument(uriString, encodingString, theSctx, planState, loc, unparsedText); | 2144 | readDocument(uriString, encodingString, theSctx, planState, loc, unparsedText); |
192 | 2145 | } | 2145 | } |
194 | 2146 | catch (XQueryException const& e) | 2146 | catch (XQueryException const&) |
195 | 2147 | { | 2147 | { |
196 | 2148 | unparsedText = NULL; | 2148 | unparsedText = NULL; |
197 | 2149 | } | 2149 | } |
198 | 2150 | 2150 | ||
199 | === modified file 'src/runtime/uris/uris_impl.cpp' | |||
200 | --- src/runtime/uris/uris_impl.cpp 2013-02-07 17:24:36 +0000 | |||
201 | +++ src/runtime/uris/uris_impl.cpp 2013-04-17 18:46:27 +0000 | |||
202 | @@ -84,7 +84,7 @@ | |||
203 | 84 | while (lTranscoder.good()) | 84 | while (lTranscoder.good()) |
204 | 85 | { | 85 | { |
205 | 86 | lTranscoder.read(buf, 1024); | 86 | lTranscoder.read(buf, 1024); |
207 | 87 | lDecodedString.append(buf, lTranscoder.gcount()); | 87 | lDecodedString.append(buf, static_cast<zstring::size_type>(lTranscoder.gcount())); |
208 | 88 | } | 88 | } |
209 | 89 | } | 89 | } |
210 | 90 | catch (ZorbaException& e) | 90 | catch (ZorbaException& e) |
211 | 91 | 91 | ||
212 | === modified file 'src/store/naive/atomic_items.cpp' | |||
213 | --- src/store/naive/atomic_items.cpp 2013-04-08 00:44:26 +0000 | |||
214 | +++ src/store/naive/atomic_items.cpp 2013-04-17 18:46:27 +0000 | |||
215 | @@ -3892,7 +3892,7 @@ | |||
216 | 3892 | { | 3892 | { |
217 | 3893 | return; | 3893 | return; |
218 | 3894 | } | 3894 | } |
220 | 3895 | s->theValue.reserve(len); | 3895 | s->theValue.reserve(static_cast<std::vector<char>::size_type>(len)); |
221 | 3896 | char buf[1024]; | 3896 | char buf[1024]; |
222 | 3897 | while (lStream.good()) | 3897 | while (lStream.good()) |
223 | 3898 | { | 3898 | { |
224 | @@ -3908,7 +3908,7 @@ | |||
225 | 3908 | lStream.read(buf, 4048); | 3908 | lStream.read(buf, 4048); |
226 | 3909 | if (lStream.gcount() > 0) | 3909 | if (lStream.gcount() > 0) |
227 | 3910 | { | 3910 | { |
229 | 3911 | s->theValue.reserve(s->theValue.size() + lStream.gcount()); | 3911 | s->theValue.reserve(static_cast<std::vector<char>::size_type>(s->theValue.size() + lStream.gcount())); |
230 | 3912 | s->theValue.insert(s->theValue.end(), buf, buf + lStream.gcount()); | 3912 | s->theValue.insert(s->theValue.end(), buf, buf + lStream.gcount()); |
231 | 3913 | } | 3913 | } |
232 | 3914 | } | 3914 | } |
233 | 3915 | 3915 | ||
234 | === modified file 'src/store/naive/json_items.cpp' | |||
235 | --- src/store/naive/json_items.cpp 2013-03-24 20:40:03 +0000 | |||
236 | +++ src/store/naive/json_items.cpp 2013-04-17 18:46:27 +0000 | |||
237 | @@ -876,7 +876,8 @@ | |||
238 | 876 | } | 876 | } |
239 | 877 | 877 | ||
240 | 878 | member->addReference(); | 878 | member->addReference(); |
242 | 879 | theContent.insert(theContent.begin() + (cast(pos) - 1), member.getp()); | 879 | Members::size_type sPos = static_cast<Members::size_type>(cast(pos) - 1); |
243 | 880 | theContent.insert(theContent.begin() + sPos, member.getp()); | ||
244 | 880 | 881 | ||
245 | 881 | ASSERT_INVARIANT(); | 882 | ASSERT_INVARIANT(); |
246 | 882 | } | 883 | } |
247 | @@ -939,7 +940,8 @@ | |||
248 | 939 | } | 940 | } |
249 | 940 | 941 | ||
250 | 941 | lItem->addReference(); | 942 | lItem->addReference(); |
252 | 942 | theContent.insert(theContent.begin() + aTargetPos + i, lItem); | 943 | Members::size_type sPos = static_cast<Members::size_type>(aTargetPos + i); |
253 | 944 | theContent.insert(theContent.begin() + sPos, lItem); | ||
254 | 943 | } | 945 | } |
255 | 944 | 946 | ||
256 | 945 | ASSERT_INVARIANT(); | 947 | ASSERT_INVARIANT(); |
257 | @@ -965,7 +967,8 @@ | |||
258 | 965 | 967 | ||
259 | 966 | lItem->removeReference(); | 968 | lItem->removeReference(); |
260 | 967 | uint64_t lPosStartingZero = cast(aPos) - 1; | 969 | uint64_t lPosStartingZero = cast(aPos) - 1; |
262 | 968 | theContent.erase(theContent.begin() + lPosStartingZero); | 970 | |
263 | 971 | theContent.erase(theContent.begin() + static_cast<Members::size_type>(lPosStartingZero) ); | ||
264 | 969 | 972 | ||
265 | 970 | ASSERT_INVARIANT(); | 973 | ASSERT_INVARIANT(); |
266 | 971 | return lItem; | 974 | return lItem; |
267 | @@ -1013,10 +1016,10 @@ | |||
268 | 1013 | static_cast<StructuredItem*>(value.getp()); | 1016 | static_cast<StructuredItem*>(value.getp()); |
269 | 1014 | lStructuredItem->setCollectionTreeInfo(theCollectionInfo); | 1017 | lStructuredItem->setCollectionTreeInfo(theCollectionInfo); |
270 | 1015 | } | 1018 | } |
273 | 1016 | 1019 | Members::size_type sPos = static_cast<Members::size_type>(pos); | |
274 | 1017 | theContent[pos]->removeReference(); | 1020 | theContent[sPos]->removeReference(); |
275 | 1018 | value->addReference(); | 1021 | value->addReference(); |
277 | 1019 | theContent[pos] = value.getp(); | 1022 | theContent[sPos] = value.getp(); |
278 | 1020 | 1023 | ||
279 | 1021 | ASSERT_INVARIANT(); | 1024 | ASSERT_INVARIANT(); |
280 | 1022 | return lItem; | 1025 | return lItem; |
281 | @@ -1078,7 +1081,7 @@ | |||
282 | 1078 | } | 1081 | } |
283 | 1079 | else | 1082 | else |
284 | 1080 | { | 1083 | { |
286 | 1081 | return theContent[lPos-1]; | 1084 | return theContent[ static_cast<Members::size_type>(lPos-1) ]; |
287 | 1082 | } | 1085 | } |
288 | 1083 | } | 1086 | } |
289 | 1084 | 1087 | ||
290 | 1085 | 1088 | ||
291 | === modified file 'src/store/naive/loader_dtd.cpp' | |||
292 | --- src/store/naive/loader_dtd.cpp 2013-03-05 22:57:42 +0000 | |||
293 | +++ src/store/naive/loader_dtd.cpp 2013-04-17 18:46:27 +0000 | |||
294 | @@ -140,7 +140,7 @@ | |||
295 | 140 | if (theFragmentStream->theStream->eof()) | 140 | if (theFragmentStream->theStream->eof()) |
296 | 141 | theFragmentStream->reached_eof = true; | 141 | theFragmentStream->reached_eof = true; |
297 | 142 | 142 | ||
299 | 143 | theFragmentStream->bytes_in_buffer += numChars; | 143 | theFragmentStream->bytes_in_buffer += static_cast<unsigned long>(numChars); |
300 | 144 | theFragmentStream->current_offset = 0; | 144 | theFragmentStream->current_offset = 0; |
301 | 145 | theFragmentStream->ctxt->input->base = (xmlChar*)(&theFragmentStream->theBuffer[0]); | 145 | theFragmentStream->ctxt->input->base = (xmlChar*)(&theFragmentStream->theBuffer[0]); |
302 | 146 | theFragmentStream->ctxt->input->length = (theFragmentStream->bytes_in_buffer < (theFragmentStream->theBuffer.size()-1) ? theFragmentStream->bytes_in_buffer : (theFragmentStream->theBuffer.size()-1)); | 146 | theFragmentStream->ctxt->input->length = (theFragmentStream->bytes_in_buffer < (theFragmentStream->theBuffer.size()-1) ? theFragmentStream->bytes_in_buffer : (theFragmentStream->theBuffer.size()-1)); |
303 | @@ -782,8 +782,9 @@ | |||
304 | 782 | std::streamoff fileSize = stream.tellg(); | 782 | std::streamoff fileSize = stream.tellg(); |
305 | 783 | stream.seekg(0, std::ios::beg); | 783 | stream.seekg(0, std::ios::beg); |
306 | 784 | 784 | ||
309 | 785 | theBuffer.resize(static_cast<unsigned int>(fileSize+1)); | 785 | unsigned int fSize = static_cast<unsigned int>(fileSize); |
310 | 786 | theBuffer[fileSize] = 0; | 786 | theBuffer.resize(fSize+1); |
311 | 787 | theBuffer[fSize] = 0; | ||
312 | 787 | 788 | ||
313 | 788 | std::streamsize numChars = readPacket(stream, | 789 | std::streamsize numChars = readPacket(stream, |
314 | 789 | static_cast<char*>(&theBuffer[0]), | 790 | static_cast<char*>(&theBuffer[0]), |
315 | 790 | 791 | ||
316 | === modified file 'src/store/naive/node_iterators.cpp' | |||
317 | --- src/store/naive/node_iterators.cpp 2013-02-07 17:24:36 +0000 | |||
318 | +++ src/store/naive/node_iterators.cpp 2013-04-17 18:46:27 +0000 | |||
319 | @@ -443,9 +443,9 @@ | |||
320 | 443 | if (theDistinct) | 443 | if (theDistinct) |
321 | 444 | { | 444 | { |
322 | 445 | result = theNodes[theCurrentNode++]; | 445 | result = theNodes[theCurrentNode++]; |
326 | 446 | 446 | zorba::csize size = static_cast<zorba::csize>(theNodes.size()); | |
327 | 447 | while (theCurrentNode < (long)theNodes.size() && | 447 | while ( (theCurrentNode < size) && |
328 | 448 | theNodes[theCurrentNode] == result) | 448 | (theNodes[theCurrentNode] == result) ) |
329 | 449 | { | 449 | { |
330 | 450 | theCurrentNode++; | 450 | theCurrentNode++; |
331 | 451 | } | 451 | } |
332 | 452 | 452 | ||
333 | === modified file 'src/store/naive/simple_collection.cpp' | |||
334 | --- src/store/naive/simple_collection.cpp 2013-02-28 19:59:38 +0000 | |||
335 | +++ src/store/naive/simple_collection.cpp 2013-04-17 18:46:27 +0000 | |||
336 | @@ -271,7 +271,8 @@ | |||
337 | 271 | } | 271 | } |
338 | 272 | else | 272 | else |
339 | 273 | { | 273 | { |
341 | 274 | theTrees.insert(theTrees.begin() + pos, item); | 274 | zorba::checked_vector<store::Item_t>::size_type sPos = static_cast<zorba::checked_vector<store::Item_t>::size_type>(pos); |
342 | 275 | theTrees.insert(theTrees.begin() + sPos, item); | ||
343 | 275 | 276 | ||
344 | 276 | structuredItem->attachToCollection(this, createTreeId(), position); | 277 | structuredItem->attachToCollection(this, createTreeId(), position); |
345 | 277 | } | 278 | } |
346 | @@ -586,7 +587,7 @@ | |||
347 | 586 | : | 587 | : |
348 | 587 | theCollection(collection), | 588 | theCollection(collection), |
349 | 588 | theHaveLock(false), | 589 | theHaveLock(false), |
351 | 589 | theSkip(to_xs_unsignedLong(skip)) | 590 | theSkip(static_cast<zorba::csize>(to_xs_unsignedLong(skip))) |
352 | 590 | { | 591 | { |
353 | 591 | } | 592 | } |
354 | 592 | 593 | ||
355 | 593 | 594 | ||
356 | === modified file 'src/store/naive/simple_index_value.cpp' | |||
357 | --- src/store/naive/simple_index_value.cpp 2013-03-24 20:40:03 +0000 | |||
358 | +++ src/store/naive/simple_index_value.cpp 2013-04-17 18:46:27 +0000 | |||
359 | @@ -518,7 +518,8 @@ | |||
360 | 518 | } | 518 | } |
361 | 519 | else | 519 | else |
362 | 520 | { | 520 | { |
364 | 521 | theIte += to_xs_long(theSkip); | 521 | std::vector<store::Item_t>::size_type toSum = static_cast<std::vector<store::Item_t>::size_type>(to_xs_long(theSkip)); |
365 | 522 | theIte += toSum; | ||
366 | 522 | } | 523 | } |
367 | 523 | } | 524 | } |
368 | 524 | } | 525 | } |
369 | 525 | 526 | ||
370 | === modified file 'src/store/naive/simple_item_factory.cpp' | |||
371 | --- src/store/naive/simple_item_factory.cpp 2013-04-17 18:19:28 +0000 | |||
372 | +++ src/store/naive/simple_item_factory.cpp 2013-04-17 18:46:27 +0000 | |||
373 | @@ -2278,7 +2278,7 @@ | |||
374 | 2278 | return createDouble(result, d); | 2278 | return createDouble(result, d); |
375 | 2279 | } | 2279 | } |
376 | 2280 | } | 2280 | } |
378 | 2281 | catch (std::exception& e) | 2281 | catch (std::exception const&) |
379 | 2282 | { | 2282 | { |
380 | 2283 | return false; | 2283 | return false; |
381 | 2284 | } | 2284 | } |
382 | 2285 | 2285 | ||
383 | === modified file 'src/store/naive/simple_lazy_temp_seq.cpp' | |||
384 | --- src/store/naive/simple_lazy_temp_seq.cpp 2013-03-04 21:00:58 +0000 | |||
385 | +++ src/store/naive/simple_lazy_temp_seq.cpp 2013-04-17 18:46:27 +0000 | |||
386 | @@ -182,7 +182,7 @@ | |||
387 | 182 | ZORBA_ASSERT(pos - thePurgedUpTo <= theItems.size()); | 182 | ZORBA_ASSERT(pos - thePurgedUpTo <= theItems.size()); |
388 | 183 | 183 | ||
389 | 184 | std::vector<store::Item*>::iterator ite = theItems.begin(); | 184 | std::vector<store::Item*>::iterator ite = theItems.begin(); |
391 | 185 | std::vector<store::Item*>::iterator end = theItems.begin() + (pos - thePurgedUpTo); | 185 | std::vector<store::Item*>::iterator end = theItems.begin() + static_cast<std::vector<store::Item*>::size_type>(pos - thePurgedUpTo); |
392 | 186 | for (; ite != end; ++ite) | 186 | for (; ite != end; ++ite) |
393 | 187 | { | 187 | { |
394 | 188 | (*ite)->removeReference(); | 188 | (*ite)->removeReference(); |
395 | @@ -221,7 +221,8 @@ | |||
396 | 221 | 221 | ||
397 | 222 | if (theItems.size() >= numItemsToBuffer) | 222 | if (theItems.size() >= numItemsToBuffer) |
398 | 223 | { | 223 | { |
400 | 224 | result = theItems[pos - thePurgedUpTo - 1]; | 224 | std::vector<store::Item*>::size_type sPos = static_cast<std::vector<store::Item*>::size_type>(pos - thePurgedUpTo - 1); |
401 | 225 | result = theItems[sPos]; | ||
402 | 225 | } | 226 | } |
403 | 226 | else | 227 | else |
404 | 227 | { | 228 | { |
405 | 228 | 229 | ||
406 | === modified file 'src/store/naive/simple_temp_seq.cpp' | |||
407 | --- src/store/naive/simple_temp_seq.cpp 2013-04-15 12:07:41 +0000 | |||
408 | +++ src/store/naive/simple_temp_seq.cpp 2013-04-17 18:46:27 +0000 | |||
409 | @@ -186,7 +186,7 @@ | |||
410 | 186 | 186 | ||
411 | 187 | if (0 < pos && pos <= theItems.size()) | 187 | if (0 < pos && pos <= theItems.size()) |
412 | 188 | { | 188 | { |
414 | 189 | res = theItems[pos - 1]; | 189 | res = theItems[static_cast<unsigned int>(pos) - 1]; |
415 | 190 | } | 190 | } |
416 | 191 | else | 191 | else |
417 | 192 | { | 192 | { |
418 | @@ -329,8 +329,8 @@ | |||
419 | 329 | 329 | ||
420 | 330 | if (start > 0 && end > 0) | 330 | if (start > 0 && end > 0) |
421 | 331 | { | 331 | { |
424 | 332 | theBegin = theTempSeq->theItems.begin() + (start - 1); | 332 | theBegin = theTempSeq->theItems.begin() + static_cast<std::vector<store::Item*>::size_type>(start - 1); |
425 | 333 | theEnd = theTempSeq->theItems.begin() + end; | 333 | theEnd = theTempSeq->theItems.begin() + static_cast<std::vector<store::Item*>::size_type>(end); |
426 | 334 | } | 334 | } |
427 | 335 | else | 335 | else |
428 | 336 | { | 336 | { |
429 | 337 | 337 | ||
430 | === modified file 'src/types/schema/schema.cpp' | |||
431 | --- src/types/schema/schema.cpp 2013-04-03 07:43:27 +0000 | |||
432 | +++ src/types/schema/schema.cpp 2013-04-17 18:46:27 +0000 | |||
433 | @@ -2097,7 +2097,7 @@ | |||
434 | 2097 | { | 2097 | { |
435 | 2098 | theGrammarPool->serializeGrammars(&binmemoutputstream); | 2098 | theGrammarPool->serializeGrammars(&binmemoutputstream); |
436 | 2099 | binstr.assign((char*)binmemoutputstream.getRawBuffer(), | 2099 | binstr.assign((char*)binmemoutputstream.getRawBuffer(), |
438 | 2100 | binmemoutputstream.getSize()); | 2100 | static_cast<zstring::size_type>(binmemoutputstream.getSize()) ); |
439 | 2101 | } | 2101 | } |
440 | 2102 | catch (...) | 2102 | catch (...) |
441 | 2103 | { | 2103 | { |
442 | 2104 | 2104 | ||
443 | === modified file 'src/unit_tests/test_base64_streambuf.cpp' | |||
444 | --- src/unit_tests/test_base64_streambuf.cpp 2013-02-07 17:24:36 +0000 | |||
445 | +++ src/unit_tests/test_base64_streambuf.cpp 2013-04-17 18:46:27 +0000 | |||
446 | @@ -80,7 +80,9 @@ | |||
447 | 80 | char raw_buf[ 1024 ]; | 80 | char raw_buf[ 1024 ]; |
448 | 81 | iss.read( raw_buf, sizeof raw_buf ); | 81 | iss.read( raw_buf, sizeof raw_buf ); |
449 | 82 | if ( iss.gcount() ) { | 82 | if ( iss.gcount() ) { |
451 | 83 | string const raw_str( raw_buf, iss.gcount() ); | 83 | string const raw_str( |
452 | 84 | raw_buf, static_cast<string::size_type>( iss.gcount() ) | ||
453 | 85 | ); | ||
454 | 84 | return raw_str == t->raw_str; | 86 | return raw_str == t->raw_str; |
455 | 85 | } | 87 | } |
456 | 86 | return false; | 88 | return false; |
457 | 87 | 89 | ||
458 | === modified file 'src/unit_tests/test_hashmaps.cpp' | |||
459 | --- src/unit_tests/test_hashmaps.cpp 2012-12-18 20:46:49 +0000 | |||
460 | +++ src/unit_tests/test_hashmaps.cpp 2013-04-17 18:46:27 +0000 | |||
461 | @@ -95,8 +95,8 @@ | |||
462 | 95 | std::unordered_map<uint64_t, int> map3(1024); | 95 | std::unordered_map<uint64_t, int> map3(1024); |
463 | 96 | std::unordered_map<std::string, int> map4(1024); | 96 | std::unordered_map<std::string, int> map4(1024); |
464 | 97 | 97 | ||
467 | 98 | hash64map<int> map5(1024, load_factor); | 98 | hash64map<int> map5(1024, static_cast<float>(load_factor)); |
468 | 99 | hashmap<std::string, int> map6(1024, load_factor); | 99 | hashmap<std::string, int> map6(1024, static_cast<float>(load_factor)); |
469 | 100 | 100 | ||
470 | 101 | map1.set_load_factor(load_factor); | 101 | map1.set_load_factor(load_factor); |
471 | 102 | map2.set_load_factor(load_factor); | 102 | map2.set_load_factor(load_factor); |
472 | 103 | 103 | ||
473 | === modified file 'src/unit_tests/test_icu_streambuf.cpp' | |||
474 | --- src/unit_tests/test_icu_streambuf.cpp 2013-02-07 17:24:36 +0000 | |||
475 | +++ src/unit_tests/test_icu_streambuf.cpp 2013-04-17 18:46:27 +0000 | |||
476 | @@ -102,7 +102,9 @@ | |||
477 | 102 | char utf8_buf[ 1024 ]; | 102 | char utf8_buf[ 1024 ]; |
478 | 103 | iss.read( utf8_buf, sizeof utf8_buf ); | 103 | iss.read( utf8_buf, sizeof utf8_buf ); |
479 | 104 | if ( iss.gcount() ) { | 104 | if ( iss.gcount() ) { |
481 | 105 | string const utf8_str( utf8_buf, iss.gcount() ); | 105 | string const utf8_str( |
482 | 106 | utf8_buf, static_cast<string::size_type>( iss.gcount() ) | ||
483 | 107 | ); | ||
484 | 106 | return utf8_str == t->utf8_str; | 108 | return utf8_str == t->utf8_str; |
485 | 107 | } | 109 | } |
486 | 108 | return false; | 110 | return false; |
487 | 109 | 111 | ||
488 | === modified file 'src/unit_tests/test_utf8_streambuf.cpp' | |||
489 | --- src/unit_tests/test_utf8_streambuf.cpp 2012-12-27 19:01:51 +0000 | |||
490 | +++ src/unit_tests/test_utf8_streambuf.cpp 2013-04-17 18:46:27 +0000 | |||
491 | @@ -79,7 +79,7 @@ | |||
492 | 79 | 79 | ||
493 | 80 | #define ASSERT_EXCEPTION( NO, EXPR ) \ | 80 | #define ASSERT_EXCEPTION( NO, EXPR ) \ |
494 | 81 | try { EXPR; assert_true( NO, #EXPR, __LINE__, false ); } \ | 81 | try { EXPR; assert_true( NO, #EXPR, __LINE__, false ); } \ |
496 | 82 | catch ( ZorbaException const &e ) { } \ | 82 | catch ( ZorbaException const& ) { } \ |
497 | 83 | catch ( ... ) { assert_true( NO, #EXPR, __LINE__, false ); } | 83 | catch ( ... ) { assert_true( NO, #EXPR, __LINE__, false ); } |
498 | 84 | 84 | ||
499 | 85 | /////////////////////////////////////////////////////////////////////////////// | 85 | /////////////////////////////////////////////////////////////////////////////// |
500 | @@ -93,7 +93,7 @@ | |||
501 | 93 | char buf[ 1024 ]; | 93 | char buf[ 1024 ]; |
502 | 94 | iss.getline( buf, sizeof buf ); | 94 | iss.getline( buf, sizeof buf ); |
503 | 95 | if ( iss.gcount() ) { | 95 | if ( iss.gcount() ) { |
505 | 96 | string const s( buf, iss.gcount() ); | 96 | string const s( buf, static_cast<string::size_type>( iss.gcount() ) ); |
506 | 97 | return s == test; | 97 | return s == test; |
507 | 98 | } | 98 | } |
508 | 99 | return false; | 99 | return false; |
509 | @@ -108,7 +108,7 @@ | |||
510 | 108 | char buf[ 1024 ]; | 108 | char buf[ 1024 ]; |
511 | 109 | iss.read( buf, sizeof buf ); | 109 | iss.read( buf, sizeof buf ); |
512 | 110 | if ( iss.gcount() ) { | 110 | if ( iss.gcount() ) { |
514 | 111 | string const s( buf, iss.gcount() ); | 111 | string const s( buf, static_cast<string::size_type>( iss.gcount() ) ); |
515 | 112 | return s == test; | 112 | return s == test; |
516 | 113 | } | 113 | } |
517 | 114 | return false; | 114 | return false; |
518 | 115 | 115 | ||
519 | === modified file 'src/util/base64_util.cpp' | |||
520 | --- src/util/base64_util.cpp 2013-03-25 14:48:29 +0000 | |||
521 | +++ src/util/base64_util.cpp 2013-04-17 18:46:27 +0000 | |||
522 | @@ -123,7 +123,7 @@ | |||
523 | 123 | int options ) { | 123 | int options ) { |
524 | 124 | char chunk[4]; | 124 | char chunk[4]; |
525 | 125 | int chunk_len = 0; | 125 | int chunk_len = 0; |
527 | 126 | bool const ignore_ws = options & dopt_ignore_ws; | 126 | bool const ignore_ws = !!(options & dopt_ignore_ws); |
528 | 127 | int pads = 0; | 127 | int pads = 0; |
529 | 128 | char const *const to_orig = to; | 128 | char const *const to_orig = to; |
530 | 129 | 129 | ||
531 | @@ -230,7 +230,8 @@ | |||
532 | 230 | gcount = from.gcount(); | 230 | gcount = from.gcount(); |
533 | 231 | } | 231 | } |
534 | 232 | if ( gcount ) { | 232 | if ( gcount ) { |
536 | 233 | size_type const decoded = decode( from_buf, gcount, to_buf, options ); | 233 | size_type const decoded = |
537 | 234 | decode( from_buf, static_cast<size_type>( gcount ), to_buf, options ); | ||
538 | 234 | to.write( to_buf, decoded ); | 235 | to.write( to_buf, decoded ); |
539 | 235 | total_decoded += decoded; | 236 | total_decoded += decoded; |
540 | 236 | } else | 237 | } else |
541 | @@ -253,9 +254,14 @@ | |||
542 | 253 | } | 254 | } |
543 | 254 | if ( gcount ) { | 255 | if ( gcount ) { |
544 | 255 | vector<char>::size_type const orig_size = to->size(); | 256 | vector<char>::size_type const orig_size = to->size(); |
546 | 256 | to->resize( orig_size + decoded_size( gcount ) ); | 257 | to->resize( |
547 | 258 | orig_size + decoded_size( static_cast<size_type>( gcount ) ) | ||
548 | 259 | ); | ||
549 | 257 | size_type const decoded = | 260 | size_type const decoded = |
551 | 258 | decode( from_buf, gcount, &(*to)[ total_decoded ], options ); | 261 | decode( |
552 | 262 | from_buf, static_cast<size_type>( gcount ), &(*to)[ total_decoded ], | ||
553 | 263 | options | ||
554 | 264 | ); | ||
555 | 259 | to->resize( orig_size + decoded ); | 265 | to->resize( orig_size + decoded ); |
556 | 260 | total_decoded += decoded; | 266 | total_decoded += decoded; |
557 | 261 | } else | 267 | } else |
558 | @@ -319,7 +325,8 @@ | |||
559 | 319 | char from_buf[ 1024 * 3 ], to_buf[ 1024 * 4 ]; | 325 | char from_buf[ 1024 * 3 ], to_buf[ 1024 * 4 ]; |
560 | 320 | from.read( from_buf, sizeof from_buf ); | 326 | from.read( from_buf, sizeof from_buf ); |
561 | 321 | if ( streamsize const gcount = from.gcount() ) { | 327 | if ( streamsize const gcount = from.gcount() ) { |
563 | 322 | size_type const encoded = encode( from_buf, gcount, to_buf ); | 328 | size_type const encoded = |
564 | 329 | encode( from_buf, static_cast<size_type>( gcount ), to_buf ); | ||
565 | 323 | to.write( to_buf, encoded ); | 330 | to.write( to_buf, encoded ); |
566 | 324 | total_encoded += encoded; | 331 | total_encoded += encoded; |
567 | 325 | } else | 332 | } else |
568 | @@ -335,8 +342,12 @@ | |||
569 | 335 | char from_buf[ 1024 * 3 ]; | 342 | char from_buf[ 1024 * 3 ]; |
570 | 336 | from.read( from_buf, sizeof from_buf ); | 343 | from.read( from_buf, sizeof from_buf ); |
571 | 337 | if ( streamsize const gcount = from.gcount() ) { | 344 | if ( streamsize const gcount = from.gcount() ) { |
574 | 338 | to->resize( to->size() + encoded_size( gcount ) ); | 345 | to->resize( |
575 | 339 | total_encoded += encode( from_buf, gcount, &(*to)[ total_encoded ] ); | 346 | to->size() + encoded_size( static_cast<size_type>( gcount ) ) |
576 | 347 | ); | ||
577 | 348 | total_encoded += encode( | ||
578 | 349 | from_buf, static_cast<size_type>( gcount ), &(*to)[ total_encoded ] | ||
579 | 350 | ); | ||
580 | 340 | } else | 351 | } else |
581 | 341 | break; | 352 | break; |
582 | 342 | } | 353 | } |
583 | 343 | 354 | ||
584 | === modified file 'src/util/base64_util.h' | |||
585 | --- src/util/base64_util.h 2013-03-25 14:48:29 +0000 | |||
586 | +++ src/util/base64_util.h 2013-04-17 18:46:27 +0000 | |||
587 | @@ -189,7 +189,8 @@ | |||
588 | 189 | gcount = from.gcount(); | 189 | gcount = from.gcount(); |
589 | 190 | } | 190 | } |
590 | 191 | if ( gcount ) { | 191 | if ( gcount ) { |
592 | 192 | size_type const decoded = decode( from_buf, gcount, to_buf, options ); | 192 | size_type const decoded = |
593 | 193 | decode( from_buf, static_cast<size_type>( gcount ), to_buf, options ); | ||
594 | 193 | to->append( to_buf, decoded ); | 194 | to->append( to_buf, decoded ); |
595 | 194 | total_decoded += decoded; | 195 | total_decoded += decoded; |
596 | 195 | } else | 196 | } else |
597 | @@ -312,7 +313,8 @@ | |||
598 | 312 | char from_buf[ 1024 * 3 ], to_buf[ 1024 * 4 ]; | 313 | char from_buf[ 1024 * 3 ], to_buf[ 1024 * 4 ]; |
599 | 313 | from.read( from_buf, sizeof from_buf ); | 314 | from.read( from_buf, sizeof from_buf ); |
600 | 314 | if ( std::streamsize const gcount = from.gcount() ) { | 315 | if ( std::streamsize const gcount = from.gcount() ) { |
602 | 315 | size_type const encoded = encode( from_buf, gcount, to_buf ); | 316 | size_type const encoded = |
603 | 317 | encode( from_buf, static_cast<size_type>( gcount ), to_buf ); | ||
604 | 316 | to->append( to_buf, encoded ); | 318 | to->append( to_buf, encoded ); |
605 | 317 | total_encoded += encoded; | 319 | total_encoded += encoded; |
606 | 318 | } else | 320 | } else |
607 | 319 | 321 | ||
608 | === modified file 'src/util/hexbinary_util.cpp' | |||
609 | --- src/util/hexbinary_util.cpp 2013-03-25 14:48:29 +0000 | |||
610 | +++ src/util/hexbinary_util.cpp 2013-04-17 18:46:27 +0000 | |||
611 | @@ -133,7 +133,8 @@ | |||
612 | 133 | gcount = from.gcount(); | 133 | gcount = from.gcount(); |
613 | 134 | } | 134 | } |
614 | 135 | if ( gcount ) { | 135 | if ( gcount ) { |
616 | 136 | size_type const decoded = decode( from_buf, gcount, to_buf, options ); | 136 | size_type const decoded = |
617 | 137 | decode( from_buf, static_cast<size_type>( gcount ), to_buf, options ); | ||
618 | 137 | to.write( to_buf, decoded ); | 138 | to.write( to_buf, decoded ); |
619 | 138 | total_decoded += decoded; | 139 | total_decoded += decoded; |
620 | 139 | } else | 140 | } else |
621 | @@ -156,9 +157,13 @@ | |||
622 | 156 | } | 157 | } |
623 | 157 | if ( gcount ) { | 158 | if ( gcount ) { |
624 | 158 | vector<char>::size_type const orig_size = to->size(); | 159 | vector<char>::size_type const orig_size = to->size(); |
628 | 159 | to->resize( orig_size + decoded_size( gcount ) ); | 160 | to->resize( |
629 | 160 | size_type const decoded = | 161 | orig_size + decoded_size( static_cast<size_type>( gcount ) ) |
630 | 161 | decode( from_buf, gcount, &(*to)[ total_decoded ], options ); | 162 | ); |
631 | 163 | size_type const decoded = decode( | ||
632 | 164 | from_buf, static_cast<size_type>( gcount ), &(*to)[ total_decoded ], | ||
633 | 165 | options | ||
634 | 166 | ); | ||
635 | 162 | to->resize( orig_size + decoded ); | 167 | to->resize( orig_size + decoded ); |
636 | 163 | total_decoded += decoded; | 168 | total_decoded += decoded; |
637 | 164 | } else | 169 | } else |
638 | @@ -198,7 +203,8 @@ | |||
639 | 198 | char from_buf[ 1024 ], to_buf[ 1024 * 2 ]; | 203 | char from_buf[ 1024 ], to_buf[ 1024 * 2 ]; |
640 | 199 | from.read( from_buf, sizeof from_buf ); | 204 | from.read( from_buf, sizeof from_buf ); |
641 | 200 | if ( streamsize const gcount = from.gcount() ) { | 205 | if ( streamsize const gcount = from.gcount() ) { |
643 | 201 | size_type const encoded = encode( from_buf, gcount, to_buf ); | 206 | size_type const encoded = |
644 | 207 | encode( from_buf, static_cast<size_type>( gcount ), to_buf ); | ||
645 | 202 | to.write( to_buf, encoded ); | 208 | to.write( to_buf, encoded ); |
646 | 203 | total_encoded += encoded; | 209 | total_encoded += encoded; |
647 | 204 | } else | 210 | } else |
648 | @@ -213,8 +219,12 @@ | |||
649 | 213 | char from_buf[ 1024 ]; | 219 | char from_buf[ 1024 ]; |
650 | 214 | from.read( from_buf, sizeof from_buf ); | 220 | from.read( from_buf, sizeof from_buf ); |
651 | 215 | if ( streamsize const gcount = from.gcount() ) { | 221 | if ( streamsize const gcount = from.gcount() ) { |
654 | 216 | to->resize( to->size() + encoded_size( gcount ) ); | 222 | to->resize( |
655 | 217 | total_encoded += encode( from_buf, gcount, &(*to)[ total_encoded ] ); | 223 | to->size() + encoded_size( static_cast<size_type>( gcount ) ) |
656 | 224 | ); | ||
657 | 225 | total_encoded += encode( | ||
658 | 226 | from_buf, static_cast<size_type>( gcount ), &(*to)[ total_encoded ] | ||
659 | 227 | ); | ||
660 | 218 | } else | 228 | } else |
661 | 219 | break; | 229 | break; |
662 | 220 | } | 230 | } |
663 | 221 | 231 | ||
664 | === modified file 'src/util/hexbinary_util.h' | |||
665 | --- src/util/hexbinary_util.h 2013-03-25 14:48:29 +0000 | |||
666 | +++ src/util/hexbinary_util.h 2013-04-17 18:46:27 +0000 | |||
667 | @@ -182,7 +182,8 @@ | |||
668 | 182 | gcount = from.gcount(); | 182 | gcount = from.gcount(); |
669 | 183 | } | 183 | } |
670 | 184 | if ( gcount ) { | 184 | if ( gcount ) { |
672 | 185 | size_type const decoded = decode( from_buf, gcount, to_buf, options ); | 185 | size_type const decoded = |
673 | 186 | decode( from_buf, static_cast<size_type>( gcount ), to_buf, options ); | ||
674 | 186 | to->append( to_buf, decoded ); | 187 | to->append( to_buf, decoded ); |
675 | 187 | total_decoded += decoded; | 188 | total_decoded += decoded; |
676 | 188 | } else | 189 | } else |
677 | @@ -301,7 +302,8 @@ | |||
678 | 301 | char from_buf[ 1024 * 2 ], to_buf[ 1024 ]; | 302 | char from_buf[ 1024 * 2 ], to_buf[ 1024 ]; |
679 | 302 | from.read( from_buf, sizeof from_buf ); | 303 | from.read( from_buf, sizeof from_buf ); |
680 | 303 | if ( std::streamsize const gcount = from.gcount() ) { | 304 | if ( std::streamsize const gcount = from.gcount() ) { |
682 | 304 | size_type const encoded = encode( from_buf, gcount, to_buf ); | 305 | size_type const encoded = |
683 | 306 | encode( from_buf, static_cast<size_type>( gcount ), to_buf ); | ||
684 | 305 | to->append( to_buf, encoded ); | 307 | to->append( to_buf, encoded ); |
685 | 306 | total_encoded += encoded; | 308 | total_encoded += encoded; |
686 | 307 | } else | 309 | } else |
687 | 308 | 310 | ||
688 | === modified file 'src/util/icu_streambuf.cpp' | |||
689 | --- src/util/icu_streambuf.cpp 2013-02-07 17:24:36 +0000 | |||
690 | +++ src/util/icu_streambuf.cpp 2013-04-17 18:46:27 +0000 | |||
691 | @@ -226,11 +226,13 @@ | |||
692 | 226 | return true; | 226 | return true; |
693 | 227 | } | 227 | } |
694 | 228 | 228 | ||
695 | 229 | #ifndef WIN32 | ||
696 | 229 | #ifdef GCC_PRAGMA_DIAGNOSTIC_PUSH | 230 | #ifdef GCC_PRAGMA_DIAGNOSTIC_PUSH |
697 | 230 | # pragma GCC diagnostic pop | 231 | # pragma GCC diagnostic pop |
698 | 231 | #else | 232 | #else |
699 | 232 | # pragma GCC diagnostic warning "-Warray-bounds" | 233 | # pragma GCC diagnostic warning "-Warray-bounds" |
700 | 233 | #endif /* GCC_PRAGMA_DIAGNOSTIC_PUSH */ | 234 | #endif /* GCC_PRAGMA_DIAGNOSTIC_PUSH */ |
701 | 235 | #endif /* WIN32 */ | ||
702 | 234 | 236 | ||
703 | 235 | icu_streambuf::int_type icu_streambuf::underflow() { | 237 | icu_streambuf::int_type icu_streambuf::underflow() { |
704 | 236 | #ifdef ZORBA_DEBUG_ICU_STREAMBUF | 238 | #ifdef ZORBA_DEBUG_ICU_STREAMBUF |
705 | @@ -275,8 +277,8 @@ | |||
706 | 275 | if ( streamsize const gsize = egptr() - gptr() ) { | 277 | if ( streamsize const gsize = egptr() - gptr() ) { |
707 | 276 | // must first get any chars in g_.utf8_char_ | 278 | // must first get any chars in g_.utf8_char_ |
708 | 277 | streamsize const n = min( gsize, size ); | 279 | streamsize const n = min( gsize, size ); |
711 | 278 | traits_type::copy( to, gptr(), n ); | 280 | traits_type::copy( to, gptr(), static_cast<size_t>( n ) ); |
712 | 279 | gbump( n ); | 281 | gbump( static_cast<int>( n ) ); |
713 | 280 | to += n; | 282 | to += n; |
714 | 281 | size -= n, return_size += n; | 283 | size -= n, return_size += n; |
715 | 282 | } | 284 | } |
716 | 283 | 285 | ||
717 | === modified file 'src/util/mem_streambuf.cpp' | |||
718 | --- src/util/mem_streambuf.cpp 2013-02-07 17:24:36 +0000 | |||
719 | +++ src/util/mem_streambuf.cpp 2013-04-17 18:46:27 +0000 | |||
720 | @@ -102,7 +102,7 @@ | |||
721 | 102 | streamsize const remaining = showmanyc(); | 102 | streamsize const remaining = showmanyc(); |
722 | 103 | if ( size > remaining ) | 103 | if ( size > remaining ) |
723 | 104 | size = remaining; | 104 | size = remaining; |
725 | 105 | ::memcpy( buf, gptr(), size ); | 105 | ::memcpy( buf, gptr(), static_cast<size_t>( size ) ); |
726 | 106 | return size; | 106 | return size; |
727 | 107 | } | 107 | } |
728 | 108 | 108 | ||
729 | @@ -110,7 +110,7 @@ | |||
730 | 110 | streamsize const remaining = epptr() - pptr(); | 110 | streamsize const remaining = epptr() - pptr(); |
731 | 111 | if ( size > remaining ) | 111 | if ( size > remaining ) |
732 | 112 | size = remaining; | 112 | size = remaining; |
734 | 113 | ::memcpy( pptr(), buf, size ); | 113 | ::memcpy( pptr(), buf, static_cast<size_t>( size ) ); |
735 | 114 | return size; | 114 | return size; |
736 | 115 | } | 115 | } |
737 | 116 | 116 | ||
738 | 117 | 117 | ||
739 | === modified file 'src/util/stream_util.cpp' | |||
740 | --- src/util/stream_util.cpp 2013-03-25 14:48:29 +0000 | |||
741 | +++ src/util/stream_util.cpp 2013-04-17 18:46:27 +0000 | |||
742 | @@ -62,7 +62,9 @@ | |||
743 | 62 | while ( buf < buf_end ) { | 62 | while ( buf < buf_end ) { |
744 | 63 | is.read( buf, n ); | 63 | is.read( buf, n ); |
745 | 64 | if ( streamsize read = is.gcount() ) { | 64 | if ( streamsize read = is.gcount() ) { |
747 | 65 | read = ascii::remove_whitespace( buf, read ); | 65 | read = ascii::remove_whitespace( |
748 | 66 | buf, static_cast<ascii::size_type>( read ) | ||
749 | 67 | ); | ||
750 | 66 | buf += read, n -= read; | 68 | buf += read, n -= read; |
751 | 67 | } else | 69 | } else |
752 | 68 | break; | 70 | break; |
753 | 69 | 71 | ||
754 | === modified file 'src/util/utf8_util.cpp' | |||
755 | --- src/util/utf8_util.cpp 2013-03-12 03:43:11 +0000 | |||
756 | +++ src/util/utf8_util.cpp 2013-04-17 18:46:27 +0000 | |||
757 | @@ -157,9 +157,11 @@ | |||
758 | 157 | do { | 157 | do { |
759 | 158 | unsigned long long const n_prev = n; | 158 | unsigned long long const n_prev = n; |
760 | 159 | n /= 10; | 159 | n /= 10; |
764 | 160 | unsigned const digit = n_prev - n * 10; | 160 | unsigned long long const digit = n_prev - n * 10; |
765 | 161 | if ( !utf8_size[ digit ] ) // didn't cache previously: cache now | 161 | if ( !utf8_size[ digit ] ) { // didn't cache previously: cache now |
766 | 162 | utf8_size[ digit ] = encode( zero + digit, utf8_digit[ digit ] ); | 162 | unicode::code_point const cp = static_cast<unicode::code_point>( digit ); |
767 | 163 | utf8_size[ digit ] = encode( zero + cp, utf8_digit[ digit ] ); | ||
768 | 164 | } | ||
769 | 163 | // | 165 | // |
770 | 164 | // Copy the UTF-8 bytes into buf backwards so when we reverse the entire | 166 | // Copy the UTF-8 bytes into buf backwards so when we reverse the entire |
771 | 165 | // buffer later (to reverse the digit order to put them the right way | 167 | // buffer later (to reverse the digit order to put them the right way |
772 | 166 | 168 | ||
773 | === modified file 'src/zorbaserialization/bin_archiver.cpp' | |||
774 | --- src/zorbaserialization/bin_archiver.cpp 2013-02-07 17:24:36 +0000 | |||
775 | +++ src/zorbaserialization/bin_archiver.cpp 2013-04-17 18:46:27 +0000 | |||
776 | @@ -972,7 +972,7 @@ | |||
777 | 972 | ********************************************************************************/ | 972 | ********************************************************************************/ |
778 | 973 | void BinArchiver::read_binary_string(zstring& str) | 973 | void BinArchiver::read_binary_string(zstring& str) |
779 | 974 | { | 974 | { |
781 | 975 | csize size = read_uint64(); | 975 | csize size = static_cast<csize>(read_uint64()); |
782 | 976 | 976 | ||
783 | 977 | if (theBitfill != 8) | 977 | if (theBitfill != 8) |
784 | 978 | { | 978 | { |
785 | @@ -1334,7 +1334,7 @@ | |||
786 | 1334 | } | 1334 | } |
787 | 1335 | case TYPE_BOOL: | 1335 | case TYPE_BOOL: |
788 | 1336 | { | 1336 | { |
790 | 1337 | *static_cast<bool*>(obj) = read_bit(); | 1337 | *static_cast<bool*>(obj) = !!read_bit(); |
791 | 1338 | break; | 1338 | break; |
792 | 1339 | } | 1339 | } |
793 | 1340 | case TYPE_ZSTRING: | 1340 | case TYPE_ZSTRING: |
794 | 1341 | 1341 | ||
795 | === modified file 'src/zorbatypes/datetime/datetimetype.cpp' | |||
796 | --- src/zorbatypes/datetime/datetimetype.cpp 2013-04-03 09:33:11 +0000 | |||
797 | +++ src/zorbatypes/datetime/datetimetype.cpp 2013-04-17 18:46:27 +0000 | |||
798 | @@ -157,7 +157,7 @@ | |||
799 | 157 | dt.data[DAY_DATA] = std::abs(days); | 157 | dt.data[DAY_DATA] = std::abs(days); |
800 | 158 | dt.data[HOUR_DATA] = std::abs(hours); | 158 | dt.data[HOUR_DATA] = std::abs(hours); |
801 | 159 | dt.data[MINUTE_DATA] = std::abs(minutes); | 159 | dt.data[MINUTE_DATA] = std::abs(minutes); |
803 | 160 | dt.data[SECONDS_DATA] = std::floor(std::fabs(seconds)); | 160 | dt.data[SECONDS_DATA] = static_cast<long>(std::floor(std::fabs(seconds))); |
804 | 161 | dt.data[FRACSECONDS_DATA] = round(frac(std::fabs(seconds)) * FRAC_SECONDS_UPPER_LIMIT); | 161 | dt.data[FRACSECONDS_DATA] = round(frac(std::fabs(seconds)) * FRAC_SECONDS_UPPER_LIMIT); |
805 | 162 | 162 | ||
806 | 163 | if (tz != NULL) | 163 | if (tz != NULL) |
807 | @@ -230,7 +230,7 @@ | |||
808 | 230 | dt.data[DAY_DATA] = 1; | 230 | dt.data[DAY_DATA] = 1; |
809 | 231 | dt.data[HOUR_DATA] = std::abs(hours); | 231 | dt.data[HOUR_DATA] = std::abs(hours); |
810 | 232 | dt.data[MINUTE_DATA] = std::abs(minutes); | 232 | dt.data[MINUTE_DATA] = std::abs(minutes); |
812 | 233 | dt.data[SECONDS_DATA] = std::floor(std::fabs(seconds)); | 233 | dt.data[SECONDS_DATA] = static_cast<long>(std::floor(std::fabs(seconds))); |
813 | 234 | dt.data[FRACSECONDS_DATA] = round(frac(std::fabs(seconds)) * FRAC_SECONDS_UPPER_LIMIT); | 234 | dt.data[FRACSECONDS_DATA] = round(frac(std::fabs(seconds)) * FRAC_SECONDS_UPPER_LIMIT); |
814 | 235 | 235 | ||
815 | 236 | if (tz != NULL) | 236 | if (tz != NULL) |
816 | 237 | 237 | ||
817 | === modified file 'src/zorbatypes/datetime/duration.cpp' | |||
818 | --- src/zorbatypes/datetime/duration.cpp 2013-04-08 21:00:41 +0000 | |||
819 | +++ src/zorbatypes/datetime/duration.cpp 2013-04-17 18:46:27 +0000 | |||
820 | @@ -485,7 +485,7 @@ | |||
821 | 485 | data[DAY_DATA] = std::abs(days); | 485 | data[DAY_DATA] = std::abs(days); |
822 | 486 | data[HOUR_DATA] = std::abs(hours); | 486 | data[HOUR_DATA] = std::abs(hours); |
823 | 487 | data[MINUTE_DATA] = std::abs(minutes); | 487 | data[MINUTE_DATA] = std::abs(minutes); |
825 | 488 | data[SECONDS_DATA] = std::floor(seconds); | 488 | data[SECONDS_DATA] = static_cast<long>(std::floor(seconds)); |
826 | 489 | data[FRACSECONDS_DATA] = round(frac(seconds) * FRAC_SECONDS_UPPER_LIMIT); | 489 | data[FRACSECONDS_DATA] = round(frac(seconds) * FRAC_SECONDS_UPPER_LIMIT); |
827 | 490 | 490 | ||
828 | 491 | normalize(); | 491 | normalize(); |
829 | @@ -511,7 +511,7 @@ | |||
830 | 511 | data[DAY_DATA] = std::abs(days); | 511 | data[DAY_DATA] = std::abs(days); |
831 | 512 | data[HOUR_DATA] = std::abs(hours); | 512 | data[HOUR_DATA] = std::abs(hours); |
832 | 513 | data[MINUTE_DATA] = std::abs(minutes); | 513 | data[MINUTE_DATA] = std::abs(minutes); |
834 | 514 | data[SECONDS_DATA] = std::floor(seconds); | 514 | data[SECONDS_DATA] = static_cast<long>(std::floor(seconds)); |
835 | 515 | data[FRACSECONDS_DATA] = round(frac(seconds) * FRAC_SECONDS_UPPER_LIMIT); | 515 | data[FRACSECONDS_DATA] = round(frac(seconds) * FRAC_SECONDS_UPPER_LIMIT); |
836 | 516 | 516 | ||
837 | 517 | normalize(); | 517 | normalize(); |
838 | @@ -695,7 +695,7 @@ | |||
839 | 695 | { | 695 | { |
840 | 696 | double sum = double(data[i] + (right_operand_sign? -1 : 1) * d.data[i]) / FRAC_SECONDS_UPPER_LIMIT; | 696 | double sum = double(data[i] + (right_operand_sign? -1 : 1) * d.data[i]) / FRAC_SECONDS_UPPER_LIMIT; |
841 | 697 | result->data[FRACSECONDS_DATA] = round(frac(sum)*FRAC_SECONDS_UPPER_LIMIT); | 697 | result->data[FRACSECONDS_DATA] = round(frac(sum)*FRAC_SECONDS_UPPER_LIMIT); |
843 | 698 | carry = std::floor(sum); | 698 | carry = static_cast<long>(std::floor(sum)); |
844 | 699 | } | 699 | } |
845 | 700 | else | 700 | else |
846 | 701 | { | 701 | { |
I corrected all size_types
only one warning couldn't solve, I don't know how to solve this:
1>c:\dev\bug1100471\src\zorbatypes \integer. h(916): warning C4146: unary minus operator applied to unsigned type, result still unsigned (..\..\ src\zorbatypes\ integer. cpp) \integer. h(915) : while compiling class template member function 'zorba: :IntegerImpl< IntType> zorba:: IntegerImpl< IntType> ::operator -(void) const' zorbatypes\ integer. cpp(453) : see reference to class template instantiation 'zorba: :IntegerImpl< IntType> ' being compiled
1> c:\dev\bug1100471\src\zorbatypes
1> with
1> [
1> IntType=unsigned __int64
1> ]
1> ..\..\src\
1> with
1> [
1> IntType=unsigned __int64
1> ]