Skip to content

Commit

Permalink
Try to fix clang and gcc warnings problems again x7
Browse files Browse the repository at this point in the history
  • Loading branch information
miloyip committed Dec 18, 2015
1 parent d72039f commit 6d6381f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/rapidjson/document.h
Expand Up @@ -1231,7 +1231,7 @@ class GenericValue {
for (MemberIterator itr = pos; itr != last; ++itr)
itr->~Member();
std::memmove(&*pos, &*last, static_cast<size_t>(MemberEnd() - last) * sizeof(Member));
data_.o.size -= (last - first);
data_.o.size -= static_cast<SizeType>(last - first);
return pos;
}

Expand Down Expand Up @@ -1431,7 +1431,7 @@ class GenericValue {
for (ValueIterator itr = pos; itr != last; ++itr)
itr->~GenericValue();
std::memmove(pos, last, static_cast<size_t>(End() - last) * sizeof(GenericValue));
data_.a.size -= (last - first);
data_.a.size -= static_cast<SizeType>(last - first);
return pos;
}

Expand Down
2 changes: 1 addition & 1 deletion include/rapidjson/rapidjson.h
Expand Up @@ -467,7 +467,7 @@ RAPIDJSON_NAMESPACE_END
///////////////////////////////////////////////////////////////////////////////
// RAPIDJSON_NORETURN_SUFFIX

#if defined(__clang__)
#if defined(__clang__) && !defined(NDEBUG)
#define RAPIDJSON_NORETURN_SUFFIX __attribute__ ((noreturn))
#else
#define RAPIDJSON_NORETURN_SUFFIX
Expand Down
2 changes: 1 addition & 1 deletion test/unittest/valuetest.cpp
Expand Up @@ -492,7 +492,7 @@ TEST(Value, Int64) {
EXPECT_FALSE(z.IsUint());
EXPECT_NEAR(4294967296.0, z.GetDouble(), 0.0);

z.SetInt64(int64_t(-2147483648) - 1); // -2^31-1, cannot cast as int
z.SetInt64(-int64_t(2147483648u) - 1); // -2^31-1, cannot cast as int
EXPECT_FALSE(z.IsInt());
EXPECT_NEAR(-2147483649.0, z.GetDouble(), 0.0);

Expand Down

0 comments on commit 6d6381f

Please sign in to comment.