Merge lp:~zorba-coders/zorba/bug1100471 into lp:zorba

Proposed by Rodolfo Ochoa
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
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

To post a comment you must log in.
Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) wrote :

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)
1> c:\dev\bug1100471\src\zorbatypes\integer.h(915) : while compiling class template member function 'zorba::IntegerImpl<IntType> zorba::IntegerImpl<IntType>::operator -(void) const'
1> with
1> [
1> IntType=unsigned __int64
1> ]
1> ..\..\src\zorbatypes\integer.cpp(453) : see reference to class template instantiation 'zorba::IntegerImpl<IntType>' being compiled
1> with
1> [
1> IntType=unsigned __int64
1> ]

Revision history for this message
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_cast<size_type>(x) rather than static_cast<zorba::base64::size_type>(x).

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.

review: Needs Fixing
lp:~zorba-coders/zorba/bug1100471 updated
11373. By Rodolfo Ochoa

Merge from Paul's changes

11374. By Rodolfo Ochoa

Merge from trunk

11375. By Rodolfo Ochoa

Reverting parser & lexer changes

Revision history for this message
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.

Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
Rodolfo Ochoa (rodolfo-ochoa) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug1100471-2013-04-24T17-04-59.855Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/api/base64_streambuf.cpp'
--- src/api/base64_streambuf.cpp 2013-02-07 17:24:36 +0000
+++ src/api/base64_streambuf.cpp 2013-04-17 18:46:27 +0000
@@ -156,8 +156,8 @@
156 // Get any chunk fragment pending the the get buffer first.156 // Get any chunk fragment pending the the get buffer first.
157 //157 //
158 streamsize const n = min( gsize, size );158 streamsize const n = min( gsize, size );
159 traits_type::copy( to, gptr(), n );159 traits_type::copy( to, gptr(), static_cast<size_t>( n ) );
160 gbump( n );160 gbump( static_cast<int>( n ) );
161 to += n;161 to += n;
162 size -= n, return_size += n;162 size -= n, return_size += n;
163 }163 }
@@ -165,13 +165,14 @@
165 //165 //
166 // Must get bytes in terms of encoded size.166 // Must get bytes in terms of encoded size.
167 //167 //
168 size = base64::encoded_size( size );168 size = base64::encoded_size( static_cast<size_type>( size ) );
169169
170 while ( size ) {170 while ( size ) {
171 char ebuf[ Large_External_Buf_Size ];171 char ebuf[ Large_External_Buf_Size ];
172 streamsize const get = min( (streamsize)(sizeof ebuf), size );172 streamsize const get = min( (streamsize)(sizeof ebuf), size );
173 if ( streamsize got = orig_buf_->sgetn( ebuf, get ) ) {173 if ( streamsize got = orig_buf_->sgetn( ebuf, get ) ) {
174 streamsize const decoded = base64::decode( ebuf, got, to );174 streamsize const decoded =
175 base64::decode( ebuf, static_cast<size_type>( got ), to );
175 to += decoded;176 to += decoded;
176 size -= got, return_size += decoded;177 size -= got, return_size += decoded;
177 } else178 } else
@@ -198,7 +199,8 @@
198 while ( size >= 3 ) {199 while ( size >= 3 ) {
199 char ebuf[ Large_External_Buf_Size ];200 char ebuf[ Large_External_Buf_Size ];
200 streamsize const put = min( (streamsize)(sizeof ebuf), size );201 streamsize const put = min( (streamsize)(sizeof ebuf), size );
201 streamsize const encoded = base64::encode( from, put, ebuf );202 streamsize const encoded =
203 base64::encode( from, static_cast<size_type>( put ), ebuf );
202 orig_buf_->sputn( ebuf, encoded );204 orig_buf_->sputn( ebuf, encoded );
203 from += put, size -= put, return_size += put;205 from += put, size -= put, return_size += put;
204 }206 }
@@ -207,8 +209,8 @@
207 // Put any remaining chunk fragment into the put buffer.209 // Put any remaining chunk fragment into the put buffer.
208 //210 //
209 if ( size ) {211 if ( size ) {
210 traits_type::copy( pbuf_, from, size );212 traits_type::copy( pbuf_, from, static_cast<size_t>( size ) );
211 plen_ = size;213 plen_ = static_cast<int>( size );
212 }214 }
213215
214 return return_size;216 return return_size;
215217
=== modified file 'src/api/module_info_impl.cpp'
--- src/api/module_info_impl.cpp 2013-02-15 06:02:54 +0000
+++ src/api/module_info_impl.cpp 2013-04-17 18:46:27 +0000
@@ -13,6 +13,7 @@
13 * See the License for the specific language governing permissions and13 * See the License for the specific language governing permissions and
14 * limitations under the License.14 * limitations under the License.
15 */15 */
16#include "stdafx.h"
16#include "api/module_info_impl.h"17#include "api/module_info_impl.h"
17#include <zorba/zorba_string.h>18#include <zorba/zorba_string.h>
18#include "zorbatypes/zstring.h"19#include "zorbatypes/zstring.h"
1920
=== modified file 'src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp'
--- src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2013-04-08 00:44:26 +0000
+++ src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2013-04-17 18:46:27 +0000
@@ -1208,7 +1208,7 @@
12081208
1209void end_visit(const CollectionDecl& n, void*)1209void end_visit(const CollectionDecl& n, void*)
1210{1210{
1211 if ((!theOptions & xqdoc_component_collections))1211 if (!(theOptions & xqdoc_component_collections))
1212 return;1212 return;
12131213
1214 store::Item_t lCollectionQName, lNameQName, lTypeQName;1214 store::Item_t lCollectionQName, lNameQName, lTypeQName;
12151215
=== modified file 'src/runtime/base64/base64_impl.cpp'
--- src/runtime/base64/base64_impl.cpp 2013-02-07 17:24:36 +0000
+++ src/runtime/base64/base64_impl.cpp 2013-04-17 18:46:27 +0000
@@ -113,7 +113,7 @@
113 while (lTranscoder.good())113 while (lTranscoder.good())
114 {114 {
115 lTranscoder.read(buf, 1024);115 lTranscoder.read(buf, 1024);
116 lTranscodedString.append(buf, lTranscoder.gcount());116 lTranscodedString.append(buf, static_cast<zstring::size_type>(lTranscoder.gcount()));
117 }117 }
118 GENV_ITEMFACTORY->createString(result, lTranscodedString);118 GENV_ITEMFACTORY->createString(result, lTranscodedString);
119 }119 }
120120
=== modified file 'src/runtime/datetime/datetime_impl.cpp'
--- src/runtime/datetime/datetime_impl.cpp 2013-03-12 16:51:44 +0000
+++ src/runtime/datetime/datetime_impl.cpp 2013-04-17 18:46:27 +0000
@@ -49,10 +49,10 @@
49 ::memset( tm, 0, sizeof( *tm ) );49 ::memset( tm, 0, sizeof( *tm ) );
50 time::parse( buf, fmt, lang, country, tm, &set_fields );50 time::parse( buf, fmt, lang, country, tm, &set_fields );
5151
52 bool set_mday = set_fields & time::set_mday;52 bool set_mday = !!(set_fields & time::set_mday);
53 bool set_mon = set_fields & time::set_mon;53 bool set_mon = !!(set_fields & time::set_mon);
54 bool const set_yday = set_fields & time::set_yday;54 bool const set_yday = !!(set_fields & time::set_yday);
55 bool const set_year = set_fields & time::set_year;55 bool const set_year = !!(set_fields & time::set_year);
5656
57 if ( set_yday && set_year && (!set_mday || !set_mon) ) {57 if ( set_yday && set_year && (!set_mday || !set_mon) ) {
58 //58 //
5959
=== modified file 'src/runtime/full_text/ft_module_impl.cpp'
--- src/runtime/full_text/ft_module_impl.cpp 2013-02-26 04:12:43 +0000
+++ src/runtime/full_text/ft_module_impl.cpp 2013-04-17 18:46:27 +0000
@@ -345,7 +345,8 @@
345345
346 consumeNext( item, theChildren[0], plan_state );346 consumeNext( item, theChildren[0], plan_state );
347 try {347 try {
348 is_supported = ft_stop_words_set::get_default( get_lang_from( item, loc ) );348 is_supported =
349 !!ft_stop_words_set::get_default( get_lang_from( item, loc ) );
349 }350 }
350 catch ( ZorbaException const &e ) {351 catch ( ZorbaException const &e ) {
351 if ( e.diagnostic() != err::FTST0009 /* lang not supported */ )352 if ( e.diagnostic() != err::FTST0009 /* lang not supported */ )
@@ -606,6 +607,7 @@
606 ZORBA_ASSERT( state->tresult_.get() );607 ZORBA_ASSERT( state->tresult_.get() );
607}608}
608609
610#ifndef WIN32
609#ifdef GCC_PRAGMA_DIAGNOSTIC_PUSH611#ifdef GCC_PRAGMA_DIAGNOSTIC_PUSH
610# pragma GCC diagnostic pop612# pragma GCC diagnostic pop
611#else613#else
@@ -613,7 +615,7 @@
613# pragma GCC diagnostic warning "-Wunknown-pragmas"615# pragma GCC diagnostic warning "-Wunknown-pragmas"
614# pragma GCC diagnostic warning "-Wpragmas"616# pragma GCC diagnostic warning "-Wpragmas"
615#endif /* GCC_PRAGMA_DIAGNOSTIC_PUSH */617#endif /* GCC_PRAGMA_DIAGNOSTIC_PUSH */
616618#endif /* WIN32 */
617///////////////////////////////////////////////////////////////////////////////619///////////////////////////////////////////////////////////////////////////////
618620
619bool TokenizeNodeIterator::nextImpl( store::Item_t &result,621bool TokenizeNodeIterator::nextImpl( store::Item_t &result,
620622
=== modified file 'src/runtime/numerics/format_integer.cpp'
--- src/runtime/numerics/format_integer.cpp 2013-04-09 23:59:24 +0000
+++ src/runtime/numerics/format_integer.cpp 2013-04-17 18:46:27 +0000
@@ -317,7 +317,7 @@
317 ostringstream oss;317 ostringstream oss;
318 if ( pic.primary.type == picture::ROMAN )318 if ( pic.primary.type == picture::ROMAN )
319 oss << uppercase;319 oss << uppercase;
320 oss << roman( n );320 oss << roman( static_cast<unsigned>( n ) );
321 *dest += oss.str();321 *dest += oss.str();
322 }322 }
323 catch ( range_error const& ) {323 catch ( range_error const& ) {
324324
=== modified file 'src/runtime/parsing_and_serializing/parse_fragment_impl.cpp'
--- src/runtime/parsing_and_serializing/parse_fragment_impl.cpp 2013-03-05 22:57:42 +0000
+++ src/runtime/parsing_and_serializing/parse_fragment_impl.cpp 2013-04-17 18:46:27 +0000
@@ -364,7 +364,7 @@
364 while (lInstream->good())364 while (lInstream->good())
365 {365 {
366 lInstream->read(buf, 1024);366 lInstream->read(buf, 1024);
367 lDocString.append(buf, lInstream->gcount());367 lDocString.append(buf, static_cast<zstring::size_type>(lInstream->gcount()));
368 }368 }
369 }369 }
370 else370 else
@@ -385,7 +385,7 @@
385 xmlFree(lResult);385 xmlFree(lResult);
386 xmlFreeDoc(lDoc);386 xmlFreeDoc(lDoc);
387 }387 }
388 catch ( std::exception const& e)388 catch ( std::exception const& )
389 {389 {
390 zstring lErrorMsg;390 zstring lErrorMsg;
391 lErrorMsg = "\"" + lDocString + "\"";391 lErrorMsg = "\"" + lDocString + "\"";
392392
=== modified file 'src/runtime/sequences/sequences_impl.cpp'
--- src/runtime/sequences/sequences_impl.cpp 2013-04-11 23:37:12 +0000
+++ src/runtime/sequences/sequences_impl.cpp 2013-04-17 18:46:27 +0000
@@ -1347,7 +1347,7 @@
13471347
1348 theChildren[0]->count(result, planState);1348 theChildren[0]->count(result, planState);
13491349
1350 STACK_PUSH(result, state);1350 STACK_PUSH(!!result, state);
13511351
1352 STACK_END(state);1352 STACK_END(state);
1353}1353}
@@ -2143,7 +2143,7 @@
2143 {2143 {
2144 readDocument(uriString, encodingString, theSctx, planState, loc, unparsedText);2144 readDocument(uriString, encodingString, theSctx, planState, loc, unparsedText);
2145 }2145 }
2146 catch (XQueryException const& e)2146 catch (XQueryException const&)
2147 {2147 {
2148 unparsedText = NULL;2148 unparsedText = NULL;
2149 }2149 }
21502150
=== modified file 'src/runtime/uris/uris_impl.cpp'
--- src/runtime/uris/uris_impl.cpp 2013-02-07 17:24:36 +0000
+++ src/runtime/uris/uris_impl.cpp 2013-04-17 18:46:27 +0000
@@ -84,7 +84,7 @@
84 while (lTranscoder.good())84 while (lTranscoder.good())
85 {85 {
86 lTranscoder.read(buf, 1024);86 lTranscoder.read(buf, 1024);
87 lDecodedString.append(buf, lTranscoder.gcount());87 lDecodedString.append(buf, static_cast<zstring::size_type>(lTranscoder.gcount()));
88 }88 }
89 }89 }
90 catch (ZorbaException& e)90 catch (ZorbaException& e)
9191
=== modified file 'src/store/naive/atomic_items.cpp'
--- src/store/naive/atomic_items.cpp 2013-04-08 00:44:26 +0000
+++ src/store/naive/atomic_items.cpp 2013-04-17 18:46:27 +0000
@@ -3892,7 +3892,7 @@
3892 {3892 {
3893 return;3893 return;
3894 }3894 }
3895 s->theValue.reserve(len);3895 s->theValue.reserve(static_cast<std::vector<char>::size_type>(len));
3896 char buf[1024];3896 char buf[1024];
3897 while (lStream.good())3897 while (lStream.good())
3898 {3898 {
@@ -3908,7 +3908,7 @@
3908 lStream.read(buf, 4048);3908 lStream.read(buf, 4048);
3909 if (lStream.gcount() > 0)3909 if (lStream.gcount() > 0)
3910 {3910 {
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()));
3912 s->theValue.insert(s->theValue.end(), buf, buf + lStream.gcount());3912 s->theValue.insert(s->theValue.end(), buf, buf + lStream.gcount());
3913 }3913 }
3914 }3914 }
39153915
=== modified file 'src/store/naive/json_items.cpp'
--- src/store/naive/json_items.cpp 2013-03-24 20:40:03 +0000
+++ src/store/naive/json_items.cpp 2013-04-17 18:46:27 +0000
@@ -876,7 +876,8 @@
876 }876 }
877877
878 member->addReference();878 member->addReference();
879 theContent.insert(theContent.begin() + (cast(pos) - 1), member.getp());879 Members::size_type sPos = static_cast<Members::size_type>(cast(pos) - 1);
880 theContent.insert(theContent.begin() + sPos, member.getp());
880881
881 ASSERT_INVARIANT();882 ASSERT_INVARIANT();
882}883}
@@ -939,7 +940,8 @@
939 }940 }
940941
941 lItem->addReference();942 lItem->addReference();
942 theContent.insert(theContent.begin() + aTargetPos + i, lItem);943 Members::size_type sPos = static_cast<Members::size_type>(aTargetPos + i);
944 theContent.insert(theContent.begin() + sPos, lItem);
943 }945 }
944946
945 ASSERT_INVARIANT();947 ASSERT_INVARIANT();
@@ -965,7 +967,8 @@
965967
966 lItem->removeReference();968 lItem->removeReference();
967 uint64_t lPosStartingZero = cast(aPos) - 1;969 uint64_t lPosStartingZero = cast(aPos) - 1;
968 theContent.erase(theContent.begin() + lPosStartingZero);970
971 theContent.erase(theContent.begin() + static_cast<Members::size_type>(lPosStartingZero) );
969972
970 ASSERT_INVARIANT();973 ASSERT_INVARIANT();
971 return lItem;974 return lItem;
@@ -1013,10 +1016,10 @@
1013 static_cast<StructuredItem*>(value.getp());1016 static_cast<StructuredItem*>(value.getp());
1014 lStructuredItem->setCollectionTreeInfo(theCollectionInfo);1017 lStructuredItem->setCollectionTreeInfo(theCollectionInfo);
1015 }1018 }
10161019 Members::size_type sPos = static_cast<Members::size_type>(pos);
1017 theContent[pos]->removeReference();1020 theContent[sPos]->removeReference();
1018 value->addReference();1021 value->addReference();
1019 theContent[pos] = value.getp();1022 theContent[sPos] = value.getp();
10201023
1021 ASSERT_INVARIANT();1024 ASSERT_INVARIANT();
1022 return lItem;1025 return lItem;
@@ -1078,7 +1081,7 @@
1078 }1081 }
1079 else1082 else
1080 {1083 {
1081 return theContent[lPos-1];1084 return theContent[ static_cast<Members::size_type>(lPos-1) ];
1082 }1085 }
1083}1086}
10841087
10851088
=== modified file 'src/store/naive/loader_dtd.cpp'
--- src/store/naive/loader_dtd.cpp 2013-03-05 22:57:42 +0000
+++ src/store/naive/loader_dtd.cpp 2013-04-17 18:46:27 +0000
@@ -140,7 +140,7 @@
140 if (theFragmentStream->theStream->eof())140 if (theFragmentStream->theStream->eof())
141 theFragmentStream->reached_eof = true;141 theFragmentStream->reached_eof = true;
142142
143 theFragmentStream->bytes_in_buffer += numChars;143 theFragmentStream->bytes_in_buffer += static_cast<unsigned long>(numChars);
144 theFragmentStream->current_offset = 0;144 theFragmentStream->current_offset = 0;
145 theFragmentStream->ctxt->input->base = (xmlChar*)(&theFragmentStream->theBuffer[0]);145 theFragmentStream->ctxt->input->base = (xmlChar*)(&theFragmentStream->theBuffer[0]);
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));
@@ -782,8 +782,9 @@
782 std::streamoff fileSize = stream.tellg();782 std::streamoff fileSize = stream.tellg();
783 stream.seekg(0, std::ios::beg);783 stream.seekg(0, std::ios::beg);
784784
785 theBuffer.resize(static_cast<unsigned int>(fileSize+1));785 unsigned int fSize = static_cast<unsigned int>(fileSize);
786 theBuffer[fileSize] = 0;786 theBuffer.resize(fSize+1);
787 theBuffer[fSize] = 0;
787788
788 std::streamsize numChars = readPacket(stream,789 std::streamsize numChars = readPacket(stream,
789 static_cast<char*>(&theBuffer[0]),790 static_cast<char*>(&theBuffer[0]),
790791
=== modified file 'src/store/naive/node_iterators.cpp'
--- src/store/naive/node_iterators.cpp 2013-02-07 17:24:36 +0000
+++ src/store/naive/node_iterators.cpp 2013-04-17 18:46:27 +0000
@@ -443,9 +443,9 @@
443 if (theDistinct)443 if (theDistinct)
444 {444 {
445 result = theNodes[theCurrentNode++];445 result = theNodes[theCurrentNode++];
446446 zorba::csize size = static_cast<zorba::csize>(theNodes.size());
447 while (theCurrentNode < (long)theNodes.size() &&447 while ( (theCurrentNode < size) &&
448 theNodes[theCurrentNode] == result)448 (theNodes[theCurrentNode] == result) )
449 {449 {
450 theCurrentNode++;450 theCurrentNode++;
451 }451 }
452452
=== modified file 'src/store/naive/simple_collection.cpp'
--- src/store/naive/simple_collection.cpp 2013-02-28 19:59:38 +0000
+++ src/store/naive/simple_collection.cpp 2013-04-17 18:46:27 +0000
@@ -271,7 +271,8 @@
271 }271 }
272 else272 else
273 {273 {
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);
275 theTrees.insert(theTrees.begin() + sPos, item);
275276
276 structuredItem->attachToCollection(this, createTreeId(), position);277 structuredItem->attachToCollection(this, createTreeId(), position);
277 }278 }
@@ -586,7 +587,7 @@
586 :587 :
587 theCollection(collection),588 theCollection(collection),
588 theHaveLock(false),589 theHaveLock(false),
589 theSkip(to_xs_unsignedLong(skip))590 theSkip(static_cast<zorba::csize>(to_xs_unsignedLong(skip)))
590{591{
591}592}
592593
593594
=== modified file 'src/store/naive/simple_index_value.cpp'
--- src/store/naive/simple_index_value.cpp 2013-03-24 20:40:03 +0000
+++ src/store/naive/simple_index_value.cpp 2013-04-17 18:46:27 +0000
@@ -518,7 +518,8 @@
518 }518 }
519 else519 else
520 {520 {
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));
522 theIte += toSum;
522 }523 }
523 }524 }
524}525}
525526
=== modified file 'src/store/naive/simple_item_factory.cpp'
--- src/store/naive/simple_item_factory.cpp 2013-04-17 18:19:28 +0000
+++ src/store/naive/simple_item_factory.cpp 2013-04-17 18:46:27 +0000
@@ -2278,7 +2278,7 @@
2278 return createDouble(result, d);2278 return createDouble(result, d);
2279 }2279 }
2280 }2280 }
2281 catch (std::exception& e)2281 catch (std::exception const&)
2282 {2282 {
2283 return false;2283 return false;
2284 }2284 }
22852285
=== modified file 'src/store/naive/simple_lazy_temp_seq.cpp'
--- src/store/naive/simple_lazy_temp_seq.cpp 2013-03-04 21:00:58 +0000
+++ src/store/naive/simple_lazy_temp_seq.cpp 2013-04-17 18:46:27 +0000
@@ -182,7 +182,7 @@
182 ZORBA_ASSERT(pos - thePurgedUpTo <= theItems.size());182 ZORBA_ASSERT(pos - thePurgedUpTo <= theItems.size());
183183
184 std::vector<store::Item*>::iterator ite = theItems.begin();184 std::vector<store::Item*>::iterator ite = theItems.begin();
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);
186 for (; ite != end; ++ite)186 for (; ite != end; ++ite)
187 {187 {
188 (*ite)->removeReference();188 (*ite)->removeReference();
@@ -221,7 +221,8 @@
221221
222 if (theItems.size() >= numItemsToBuffer)222 if (theItems.size() >= numItemsToBuffer)
223 {223 {
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);
225 result = theItems[sPos];
225 }226 }
226 else 227 else
227 {228 {
228229
=== modified file 'src/store/naive/simple_temp_seq.cpp'
--- src/store/naive/simple_temp_seq.cpp 2013-04-15 12:07:41 +0000
+++ src/store/naive/simple_temp_seq.cpp 2013-04-17 18:46:27 +0000
@@ -186,7 +186,7 @@
186186
187 if (0 < pos && pos <= theItems.size())187 if (0 < pos && pos <= theItems.size())
188 {188 {
189 res = theItems[pos - 1];189 res = theItems[static_cast<unsigned int>(pos) - 1];
190 }190 }
191 else191 else
192 {192 {
@@ -329,8 +329,8 @@
329329
330 if (start > 0 && end > 0)330 if (start > 0 && end > 0)
331 {331 {
332 theBegin = theTempSeq->theItems.begin() + (start - 1);332 theBegin = theTempSeq->theItems.begin() + static_cast<std::vector<store::Item*>::size_type>(start - 1);
333 theEnd = theTempSeq->theItems.begin() + end;333 theEnd = theTempSeq->theItems.begin() + static_cast<std::vector<store::Item*>::size_type>(end);
334 }334 }
335 else335 else
336 {336 {
337337
=== modified file 'src/types/schema/schema.cpp'
--- src/types/schema/schema.cpp 2013-04-03 07:43:27 +0000
+++ src/types/schema/schema.cpp 2013-04-17 18:46:27 +0000
@@ -2097,7 +2097,7 @@
2097 {2097 {
2098 theGrammarPool->serializeGrammars(&binmemoutputstream);2098 theGrammarPool->serializeGrammars(&binmemoutputstream);
2099 binstr.assign((char*)binmemoutputstream.getRawBuffer(),2099 binstr.assign((char*)binmemoutputstream.getRawBuffer(),
2100 binmemoutputstream.getSize());2100 static_cast<zstring::size_type>(binmemoutputstream.getSize()) );
2101 }2101 }
2102 catch (...)2102 catch (...)
2103 {2103 {
21042104
=== modified file 'src/unit_tests/test_base64_streambuf.cpp'
--- src/unit_tests/test_base64_streambuf.cpp 2013-02-07 17:24:36 +0000
+++ src/unit_tests/test_base64_streambuf.cpp 2013-04-17 18:46:27 +0000
@@ -80,7 +80,9 @@
80 char raw_buf[ 1024 ];80 char raw_buf[ 1024 ];
81 iss.read( raw_buf, sizeof raw_buf );81 iss.read( raw_buf, sizeof raw_buf );
82 if ( iss.gcount() ) {82 if ( iss.gcount() ) {
83 string const raw_str( raw_buf, iss.gcount() );83 string const raw_str(
84 raw_buf, static_cast<string::size_type>( iss.gcount() )
85 );
84 return raw_str == t->raw_str;86 return raw_str == t->raw_str;
85 }87 }
86 return false;88 return false;
8789
=== modified file 'src/unit_tests/test_hashmaps.cpp'
--- src/unit_tests/test_hashmaps.cpp 2012-12-18 20:46:49 +0000
+++ src/unit_tests/test_hashmaps.cpp 2013-04-17 18:46:27 +0000
@@ -95,8 +95,8 @@
95 std::unordered_map<uint64_t, int> map3(1024);95 std::unordered_map<uint64_t, int> map3(1024);
96 std::unordered_map<std::string, int> map4(1024);96 std::unordered_map<std::string, int> map4(1024);
9797
98 hash64map<int> map5(1024, load_factor);98 hash64map<int> map5(1024, static_cast<float>(load_factor));
99 hashmap<std::string, int> map6(1024, load_factor);99 hashmap<std::string, int> map6(1024, static_cast<float>(load_factor));
100100
101 map1.set_load_factor(load_factor);101 map1.set_load_factor(load_factor);
102 map2.set_load_factor(load_factor);102 map2.set_load_factor(load_factor);
103103
=== modified file 'src/unit_tests/test_icu_streambuf.cpp'
--- src/unit_tests/test_icu_streambuf.cpp 2013-02-07 17:24:36 +0000
+++ src/unit_tests/test_icu_streambuf.cpp 2013-04-17 18:46:27 +0000
@@ -102,7 +102,9 @@
102 char utf8_buf[ 1024 ];102 char utf8_buf[ 1024 ];
103 iss.read( utf8_buf, sizeof utf8_buf );103 iss.read( utf8_buf, sizeof utf8_buf );
104 if ( iss.gcount() ) {104 if ( iss.gcount() ) {
105 string const utf8_str( utf8_buf, iss.gcount() );105 string const utf8_str(
106 utf8_buf, static_cast<string::size_type>( iss.gcount() )
107 );
106 return utf8_str == t->utf8_str;108 return utf8_str == t->utf8_str;
107 }109 }
108 return false;110 return false;
109111
=== modified file 'src/unit_tests/test_utf8_streambuf.cpp'
--- src/unit_tests/test_utf8_streambuf.cpp 2012-12-27 19:01:51 +0000
+++ src/unit_tests/test_utf8_streambuf.cpp 2013-04-17 18:46:27 +0000
@@ -79,7 +79,7 @@
7979
80#define ASSERT_EXCEPTION( NO, EXPR ) \80#define ASSERT_EXCEPTION( NO, EXPR ) \
81 try { EXPR; assert_true( NO, #EXPR, __LINE__, false ); } \81 try { EXPR; assert_true( NO, #EXPR, __LINE__, false ); } \
82 catch ( ZorbaException const &e ) { } \82 catch ( ZorbaException const& ) { } \
83 catch ( ... ) { assert_true( NO, #EXPR, __LINE__, false ); }83 catch ( ... ) { assert_true( NO, #EXPR, __LINE__, false ); }
8484
85///////////////////////////////////////////////////////////////////////////////85///////////////////////////////////////////////////////////////////////////////
@@ -93,7 +93,7 @@
93 char buf[ 1024 ];93 char buf[ 1024 ];
94 iss.getline( buf, sizeof buf );94 iss.getline( buf, sizeof buf );
95 if ( iss.gcount() ) {95 if ( iss.gcount() ) {
96 string const s( buf, iss.gcount() );96 string const s( buf, static_cast<string::size_type>( iss.gcount() ) );
97 return s == test;97 return s == test;
98 }98 }
99 return false;99 return false;
@@ -108,7 +108,7 @@
108 char buf[ 1024 ];108 char buf[ 1024 ];
109 iss.read( buf, sizeof buf );109 iss.read( buf, sizeof buf );
110 if ( iss.gcount() ) {110 if ( iss.gcount() ) {
111 string const s( buf, iss.gcount() );111 string const s( buf, static_cast<string::size_type>( iss.gcount() ) );
112 return s == test;112 return s == test;
113 }113 }
114 return false;114 return false;
115115
=== modified file 'src/util/base64_util.cpp'
--- src/util/base64_util.cpp 2013-03-25 14:48:29 +0000
+++ src/util/base64_util.cpp 2013-04-17 18:46:27 +0000
@@ -123,7 +123,7 @@
123 int options ) {123 int options ) {
124 char chunk[4];124 char chunk[4];
125 int chunk_len = 0;125 int chunk_len = 0;
126 bool const ignore_ws = options & dopt_ignore_ws;126 bool const ignore_ws = !!(options & dopt_ignore_ws);
127 int pads = 0;127 int pads = 0;
128 char const *const to_orig = to;128 char const *const to_orig = to;
129129
@@ -230,7 +230,8 @@
230 gcount = from.gcount();230 gcount = from.gcount();
231 }231 }
232 if ( gcount ) {232 if ( gcount ) {
233 size_type const decoded = decode( from_buf, gcount, to_buf, options );233 size_type const decoded =
234 decode( from_buf, static_cast<size_type>( gcount ), to_buf, options );
234 to.write( to_buf, decoded );235 to.write( to_buf, decoded );
235 total_decoded += decoded;236 total_decoded += decoded;
236 } else237 } else
@@ -253,9 +254,14 @@
253 }254 }
254 if ( gcount ) {255 if ( gcount ) {
255 vector<char>::size_type const orig_size = to->size();256 vector<char>::size_type const orig_size = to->size();
256 to->resize( orig_size + decoded_size( gcount ) );257 to->resize(
258 orig_size + decoded_size( static_cast<size_type>( gcount ) )
259 );
257 size_type const decoded =260 size_type const decoded =
258 decode( from_buf, gcount, &(*to)[ total_decoded ], options );261 decode(
262 from_buf, static_cast<size_type>( gcount ), &(*to)[ total_decoded ],
263 options
264 );
259 to->resize( orig_size + decoded );265 to->resize( orig_size + decoded );
260 total_decoded += decoded;266 total_decoded += decoded;
261 } else267 } else
@@ -319,7 +325,8 @@
319 char from_buf[ 1024 * 3 ], to_buf[ 1024 * 4 ];325 char from_buf[ 1024 * 3 ], to_buf[ 1024 * 4 ];
320 from.read( from_buf, sizeof from_buf );326 from.read( from_buf, sizeof from_buf );
321 if ( streamsize const gcount = from.gcount() ) {327 if ( streamsize const gcount = from.gcount() ) {
322 size_type const encoded = encode( from_buf, gcount, to_buf );328 size_type const encoded =
329 encode( from_buf, static_cast<size_type>( gcount ), to_buf );
323 to.write( to_buf, encoded );330 to.write( to_buf, encoded );
324 total_encoded += encoded;331 total_encoded += encoded;
325 } else332 } else
@@ -335,8 +342,12 @@
335 char from_buf[ 1024 * 3 ];342 char from_buf[ 1024 * 3 ];
336 from.read( from_buf, sizeof from_buf );343 from.read( from_buf, sizeof from_buf );
337 if ( streamsize const gcount = from.gcount() ) {344 if ( streamsize const gcount = from.gcount() ) {
338 to->resize( to->size() + encoded_size( gcount ) );345 to->resize(
339 total_encoded += encode( from_buf, gcount, &(*to)[ total_encoded ] );346 to->size() + encoded_size( static_cast<size_type>( gcount ) )
347 );
348 total_encoded += encode(
349 from_buf, static_cast<size_type>( gcount ), &(*to)[ total_encoded ]
350 );
340 } else351 } else
341 break;352 break;
342 }353 }
343354
=== modified file 'src/util/base64_util.h'
--- src/util/base64_util.h 2013-03-25 14:48:29 +0000
+++ src/util/base64_util.h 2013-04-17 18:46:27 +0000
@@ -189,7 +189,8 @@
189 gcount = from.gcount();189 gcount = from.gcount();
190 }190 }
191 if ( gcount ) {191 if ( gcount ) {
192 size_type const decoded = decode( from_buf, gcount, to_buf, options );192 size_type const decoded =
193 decode( from_buf, static_cast<size_type>( gcount ), to_buf, options );
193 to->append( to_buf, decoded );194 to->append( to_buf, decoded );
194 total_decoded += decoded;195 total_decoded += decoded;
195 } else196 } else
@@ -312,7 +313,8 @@
312 char from_buf[ 1024 * 3 ], to_buf[ 1024 * 4 ];313 char from_buf[ 1024 * 3 ], to_buf[ 1024 * 4 ];
313 from.read( from_buf, sizeof from_buf );314 from.read( from_buf, sizeof from_buf );
314 if ( std::streamsize const gcount = from.gcount() ) {315 if ( std::streamsize const gcount = from.gcount() ) {
315 size_type const encoded = encode( from_buf, gcount, to_buf );316 size_type const encoded =
317 encode( from_buf, static_cast<size_type>( gcount ), to_buf );
316 to->append( to_buf, encoded );318 to->append( to_buf, encoded );
317 total_encoded += encoded;319 total_encoded += encoded;
318 } else320 } else
319321
=== modified file 'src/util/hexbinary_util.cpp'
--- src/util/hexbinary_util.cpp 2013-03-25 14:48:29 +0000
+++ src/util/hexbinary_util.cpp 2013-04-17 18:46:27 +0000
@@ -133,7 +133,8 @@
133 gcount = from.gcount();133 gcount = from.gcount();
134 }134 }
135 if ( gcount ) {135 if ( gcount ) {
136 size_type const decoded = decode( from_buf, gcount, to_buf, options );136 size_type const decoded =
137 decode( from_buf, static_cast<size_type>( gcount ), to_buf, options );
137 to.write( to_buf, decoded );138 to.write( to_buf, decoded );
138 total_decoded += decoded;139 total_decoded += decoded;
139 } else140 } else
@@ -156,9 +157,13 @@
156 }157 }
157 if ( gcount ) {158 if ( gcount ) {
158 vector<char>::size_type const orig_size = to->size();159 vector<char>::size_type const orig_size = to->size();
159 to->resize( orig_size + decoded_size( gcount ) );160 to->resize(
160 size_type const decoded =161 orig_size + decoded_size( static_cast<size_type>( gcount ) )
161 decode( from_buf, gcount, &(*to)[ total_decoded ], options );162 );
163 size_type const decoded = decode(
164 from_buf, static_cast<size_type>( gcount ), &(*to)[ total_decoded ],
165 options
166 );
162 to->resize( orig_size + decoded );167 to->resize( orig_size + decoded );
163 total_decoded += decoded;168 total_decoded += decoded;
164 } else169 } else
@@ -198,7 +203,8 @@
198 char from_buf[ 1024 ], to_buf[ 1024 * 2 ];203 char from_buf[ 1024 ], to_buf[ 1024 * 2 ];
199 from.read( from_buf, sizeof from_buf );204 from.read( from_buf, sizeof from_buf );
200 if ( streamsize const gcount = from.gcount() ) {205 if ( streamsize const gcount = from.gcount() ) {
201 size_type const encoded = encode( from_buf, gcount, to_buf );206 size_type const encoded =
207 encode( from_buf, static_cast<size_type>( gcount ), to_buf );
202 to.write( to_buf, encoded );208 to.write( to_buf, encoded );
203 total_encoded += encoded;209 total_encoded += encoded;
204 } else210 } else
@@ -213,8 +219,12 @@
213 char from_buf[ 1024 ];219 char from_buf[ 1024 ];
214 from.read( from_buf, sizeof from_buf );220 from.read( from_buf, sizeof from_buf );
215 if ( streamsize const gcount = from.gcount() ) {221 if ( streamsize const gcount = from.gcount() ) {
216 to->resize( to->size() + encoded_size( gcount ) );222 to->resize(
217 total_encoded += encode( from_buf, gcount, &(*to)[ total_encoded ] );223 to->size() + encoded_size( static_cast<size_type>( gcount ) )
224 );
225 total_encoded += encode(
226 from_buf, static_cast<size_type>( gcount ), &(*to)[ total_encoded ]
227 );
218 } else228 } else
219 break;229 break;
220 }230 }
221231
=== modified file 'src/util/hexbinary_util.h'
--- src/util/hexbinary_util.h 2013-03-25 14:48:29 +0000
+++ src/util/hexbinary_util.h 2013-04-17 18:46:27 +0000
@@ -182,7 +182,8 @@
182 gcount = from.gcount();182 gcount = from.gcount();
183 }183 }
184 if ( gcount ) {184 if ( gcount ) {
185 size_type const decoded = decode( from_buf, gcount, to_buf, options );185 size_type const decoded =
186 decode( from_buf, static_cast<size_type>( gcount ), to_buf, options );
186 to->append( to_buf, decoded );187 to->append( to_buf, decoded );
187 total_decoded += decoded;188 total_decoded += decoded;
188 } else189 } else
@@ -301,7 +302,8 @@
301 char from_buf[ 1024 * 2 ], to_buf[ 1024 ];302 char from_buf[ 1024 * 2 ], to_buf[ 1024 ];
302 from.read( from_buf, sizeof from_buf );303 from.read( from_buf, sizeof from_buf );
303 if ( std::streamsize const gcount = from.gcount() ) {304 if ( std::streamsize const gcount = from.gcount() ) {
304 size_type const encoded = encode( from_buf, gcount, to_buf );305 size_type const encoded =
306 encode( from_buf, static_cast<size_type>( gcount ), to_buf );
305 to->append( to_buf, encoded );307 to->append( to_buf, encoded );
306 total_encoded += encoded;308 total_encoded += encoded;
307 } else309 } else
308310
=== modified file 'src/util/icu_streambuf.cpp'
--- src/util/icu_streambuf.cpp 2013-02-07 17:24:36 +0000
+++ src/util/icu_streambuf.cpp 2013-04-17 18:46:27 +0000
@@ -226,11 +226,13 @@
226 return true;226 return true;
227}227}
228228
229#ifndef WIN32
229#ifdef GCC_PRAGMA_DIAGNOSTIC_PUSH230#ifdef GCC_PRAGMA_DIAGNOSTIC_PUSH
230# pragma GCC diagnostic pop231# pragma GCC diagnostic pop
231#else232#else
232# pragma GCC diagnostic warning "-Warray-bounds"233# pragma GCC diagnostic warning "-Warray-bounds"
233#endif /* GCC_PRAGMA_DIAGNOSTIC_PUSH */234#endif /* GCC_PRAGMA_DIAGNOSTIC_PUSH */
235#endif /* WIN32 */
234236
235icu_streambuf::int_type icu_streambuf::underflow() {237icu_streambuf::int_type icu_streambuf::underflow() {
236#ifdef ZORBA_DEBUG_ICU_STREAMBUF238#ifdef ZORBA_DEBUG_ICU_STREAMBUF
@@ -275,8 +277,8 @@
275 if ( streamsize const gsize = egptr() - gptr() ) {277 if ( streamsize const gsize = egptr() - gptr() ) {
276 // must first get any chars in g_.utf8_char_278 // must first get any chars in g_.utf8_char_
277 streamsize const n = min( gsize, size );279 streamsize const n = min( gsize, size );
278 traits_type::copy( to, gptr(), n );280 traits_type::copy( to, gptr(), static_cast<size_t>( n ) );
279 gbump( n );281 gbump( static_cast<int>( n ) );
280 to += n;282 to += n;
281 size -= n, return_size += n;283 size -= n, return_size += n;
282 }284 }
283285
=== modified file 'src/util/mem_streambuf.cpp'
--- src/util/mem_streambuf.cpp 2013-02-07 17:24:36 +0000
+++ src/util/mem_streambuf.cpp 2013-04-17 18:46:27 +0000
@@ -102,7 +102,7 @@
102 streamsize const remaining = showmanyc();102 streamsize const remaining = showmanyc();
103 if ( size > remaining )103 if ( size > remaining )
104 size = remaining;104 size = remaining;
105 ::memcpy( buf, gptr(), size );105 ::memcpy( buf, gptr(), static_cast<size_t>( size ) );
106 return size;106 return size;
107}107}
108108
@@ -110,7 +110,7 @@
110 streamsize const remaining = epptr() - pptr();110 streamsize const remaining = epptr() - pptr();
111 if ( size > remaining )111 if ( size > remaining )
112 size = remaining;112 size = remaining;
113 ::memcpy( pptr(), buf, size );113 ::memcpy( pptr(), buf, static_cast<size_t>( size ) );
114 return size;114 return size;
115}115}
116116
117117
=== modified file 'src/util/stream_util.cpp'
--- src/util/stream_util.cpp 2013-03-25 14:48:29 +0000
+++ src/util/stream_util.cpp 2013-04-17 18:46:27 +0000
@@ -62,7 +62,9 @@
62 while ( buf < buf_end ) {62 while ( buf < buf_end ) {
63 is.read( buf, n );63 is.read( buf, n );
64 if ( streamsize read = is.gcount() ) {64 if ( streamsize read = is.gcount() ) {
65 read = ascii::remove_whitespace( buf, read );65 read = ascii::remove_whitespace(
66 buf, static_cast<ascii::size_type>( read )
67 );
66 buf += read, n -= read;68 buf += read, n -= read;
67 } else69 } else
68 break;70 break;
6971
=== modified file 'src/util/utf8_util.cpp'
--- src/util/utf8_util.cpp 2013-03-12 03:43:11 +0000
+++ src/util/utf8_util.cpp 2013-04-17 18:46:27 +0000
@@ -157,9 +157,11 @@
157 do {157 do {
158 unsigned long long const n_prev = n;158 unsigned long long const n_prev = n;
159 n /= 10;159 n /= 10;
160 unsigned const digit = n_prev - n * 10;160 unsigned long long const digit = n_prev - n * 10;
161 if ( !utf8_size[ digit ] ) // didn't cache previously: cache now161 if ( !utf8_size[ digit ] ) { // didn't cache previously: cache now
162 utf8_size[ digit ] = encode( zero + digit, utf8_digit[ digit ] );162 unicode::code_point const cp = static_cast<unicode::code_point>( digit );
163 utf8_size[ digit ] = encode( zero + cp, utf8_digit[ digit ] );
164 }
163 //165 //
164 // Copy the UTF-8 bytes into buf backwards so when we reverse the entire166 // Copy the UTF-8 bytes into buf backwards so when we reverse the entire
165 // buffer later (to reverse the digit order to put them the right way167 // buffer later (to reverse the digit order to put them the right way
166168
=== modified file 'src/zorbaserialization/bin_archiver.cpp'
--- src/zorbaserialization/bin_archiver.cpp 2013-02-07 17:24:36 +0000
+++ src/zorbaserialization/bin_archiver.cpp 2013-04-17 18:46:27 +0000
@@ -972,7 +972,7 @@
972********************************************************************************/972********************************************************************************/
973void BinArchiver::read_binary_string(zstring& str)973void BinArchiver::read_binary_string(zstring& str)
974{974{
975 csize size = read_uint64();975 csize size = static_cast<csize>(read_uint64());
976976
977 if (theBitfill != 8)977 if (theBitfill != 8)
978 {978 {
@@ -1334,7 +1334,7 @@
1334 }1334 }
1335 case TYPE_BOOL:1335 case TYPE_BOOL:
1336 {1336 {
1337 *static_cast<bool*>(obj) = read_bit();1337 *static_cast<bool*>(obj) = !!read_bit();
1338 break;1338 break;
1339 }1339 }
1340 case TYPE_ZSTRING:1340 case TYPE_ZSTRING:
13411341
=== modified file 'src/zorbatypes/datetime/datetimetype.cpp'
--- src/zorbatypes/datetime/datetimetype.cpp 2013-04-03 09:33:11 +0000
+++ src/zorbatypes/datetime/datetimetype.cpp 2013-04-17 18:46:27 +0000
@@ -157,7 +157,7 @@
157 dt.data[DAY_DATA] = std::abs(days);157 dt.data[DAY_DATA] = std::abs(days);
158 dt.data[HOUR_DATA] = std::abs(hours);158 dt.data[HOUR_DATA] = std::abs(hours);
159 dt.data[MINUTE_DATA] = std::abs(minutes);159 dt.data[MINUTE_DATA] = std::abs(minutes);
160 dt.data[SECONDS_DATA] = std::floor(std::fabs(seconds));160 dt.data[SECONDS_DATA] = static_cast<long>(std::floor(std::fabs(seconds)));
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);
162162
163 if (tz != NULL)163 if (tz != NULL)
@@ -230,7 +230,7 @@
230 dt.data[DAY_DATA] = 1;230 dt.data[DAY_DATA] = 1;
231 dt.data[HOUR_DATA] = std::abs(hours);231 dt.data[HOUR_DATA] = std::abs(hours);
232 dt.data[MINUTE_DATA] = std::abs(minutes);232 dt.data[MINUTE_DATA] = std::abs(minutes);
233 dt.data[SECONDS_DATA] = std::floor(std::fabs(seconds));233 dt.data[SECONDS_DATA] = static_cast<long>(std::floor(std::fabs(seconds)));
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);
235235
236 if (tz != NULL)236 if (tz != NULL)
237237
=== modified file 'src/zorbatypes/datetime/duration.cpp'
--- src/zorbatypes/datetime/duration.cpp 2013-04-08 21:00:41 +0000
+++ src/zorbatypes/datetime/duration.cpp 2013-04-17 18:46:27 +0000
@@ -485,7 +485,7 @@
485 data[DAY_DATA] = std::abs(days);485 data[DAY_DATA] = std::abs(days);
486 data[HOUR_DATA] = std::abs(hours);486 data[HOUR_DATA] = std::abs(hours);
487 data[MINUTE_DATA] = std::abs(minutes);487 data[MINUTE_DATA] = std::abs(minutes);
488 data[SECONDS_DATA] = std::floor(seconds);488 data[SECONDS_DATA] = static_cast<long>(std::floor(seconds));
489 data[FRACSECONDS_DATA] = round(frac(seconds) * FRAC_SECONDS_UPPER_LIMIT);489 data[FRACSECONDS_DATA] = round(frac(seconds) * FRAC_SECONDS_UPPER_LIMIT);
490490
491 normalize();491 normalize();
@@ -511,7 +511,7 @@
511 data[DAY_DATA] = std::abs(days);511 data[DAY_DATA] = std::abs(days);
512 data[HOUR_DATA] = std::abs(hours);512 data[HOUR_DATA] = std::abs(hours);
513 data[MINUTE_DATA] = std::abs(minutes);513 data[MINUTE_DATA] = std::abs(minutes);
514 data[SECONDS_DATA] = std::floor(seconds);514 data[SECONDS_DATA] = static_cast<long>(std::floor(seconds));
515 data[FRACSECONDS_DATA] = round(frac(seconds) * FRAC_SECONDS_UPPER_LIMIT);515 data[FRACSECONDS_DATA] = round(frac(seconds) * FRAC_SECONDS_UPPER_LIMIT);
516516
517 normalize();517 normalize();
@@ -695,7 +695,7 @@
695 {695 {
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;
697 result->data[FRACSECONDS_DATA] = round(frac(sum)*FRAC_SECONDS_UPPER_LIMIT);697 result->data[FRACSECONDS_DATA] = round(frac(sum)*FRAC_SECONDS_UPPER_LIMIT);
698 carry = std::floor(sum);698 carry = static_cast<long>(std::floor(sum));
699 }699 }
700 else700 else
701 {701 {

Subscribers

People subscribed via source and target branches