Skip to content

Commit

Permalink
Fix Tencent#498 VC2015 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
miloyip committed Jan 20, 2016
1 parent 44f81f0 commit 78c7d54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/rapidjson/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ class GenericReader {
while (s.Peek() >= '0' && s.Peek() <= '9') {
if (i64 >= RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC)) // 2^63 = 9223372036854775808
if (i64 != RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC) || s.Peek() > '8') {
d = i64;
d = static_cast<double>(i64);
useDouble = true;
break;
}
Expand All @@ -897,7 +897,7 @@ class GenericReader {
while (s.Peek() >= '0' && s.Peek() <= '9') {
if (i64 >= RAPIDJSON_UINT64_C2(0x19999999, 0x99999999)) // 2^64 - 1 = 18446744073709551615
if (i64 != RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || s.Peek() > '5') {
d = i64;
d = static_cast<double>(i64);
useDouble = true;
break;
}
Expand Down Expand Up @@ -968,7 +968,7 @@ class GenericReader {
int exp = 0;
if (s.Peek() == 'e' || s.Peek() == 'E') {
if (!useDouble) {
d = use64bit ? i64 : i;
d = static_cast<double>(use64bit ? i64 : i);
useDouble = true;
}
s.Take();
Expand Down
2 changes: 1 addition & 1 deletion test/unittest/readertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ TEST(Reader, ParseNumber_NormalPrecisionError) {
a = h.actual_;
uint64_t bias1 = e.ToBias();
uint64_t bias2 = a.ToBias();
double ulp = bias1 >= bias2 ? bias1 - bias2 : bias2 - bias1;
double ulp = static_cast<double>(bias1 >= bias2 ? bias1 - bias2 : bias2 - bias1);
ulpMax = std::max(ulpMax, ulp);
ulpSum += ulp;
}
Expand Down

0 comments on commit 78c7d54

Please sign in to comment.