From d6478991d078eee2c0a48bca493810e6adf81ab6 Mon Sep 17 00:00:00 2001 From: Milo Yip Date: Fri, 18 Dec 2015 19:54:10 +0800 Subject: [PATCH] Try to fix clang and gcc warnings problems again x4 --- include/rapidjson/filereadstream.h | 4 ++-- test/unittest/readertest.cpp | 4 ++-- test/unittest/valuetest.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/rapidjson/filereadstream.h b/include/rapidjson/filereadstream.h index b6d6524..a31d7c0 100644 --- a/include/rapidjson/filereadstream.h +++ b/include/rapidjson/filereadstream.h @@ -51,8 +51,8 @@ public: size_t Tell() const { return count_ + static_cast(current_ - buffer_); } // Not implemented - void Put(Ch) RAPIDJSON_NORETURN_SUFFIX { RAPIDJSON_ASSERT(false); } - void Flush() RAPIDJSON_NORETURN_SUFFIX { RAPIDJSON_ASSERT(false); } + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } diff --git a/test/unittest/readertest.cpp b/test/unittest/readertest.cpp index 6285181..3248a5d 100644 --- a/test/unittest/readertest.cpp +++ b/test/unittest/readertest.cpp @@ -1040,8 +1040,8 @@ public: size_t Tell() const { return static_cast(is_.tellg()); } Ch* PutBegin() { assert(false); return 0; } - void Put(Ch) RAPIDJSON_NORETURN_SUFFIX { assert(false); } - void Flush() RAPIDJSON_NORETURN_SUFFIX { assert(false); } + void Put(Ch) { assert(false); } + void Flush() { assert(false); } size_t PutEnd(Ch*) { assert(false); return 0; } private: diff --git a/test/unittest/valuetest.cpp b/test/unittest/valuetest.cpp index 1ef877e..cac450c 100644 --- a/test/unittest/valuetest.cpp +++ b/test/unittest/valuetest.cpp @@ -482,12 +482,12 @@ TEST(Value, Int64) { z.SetInt64(1234); EXPECT_EQ(1234, z.GetInt64()); - z.SetInt64(2147483648); // 2^31, cannot cast as int + z.SetInt64(2147483648u); // 2^31, cannot cast as int EXPECT_FALSE(z.IsInt()); EXPECT_TRUE(z.IsUint()); EXPECT_NEAR(2147483648.0, z.GetDouble(), 0.0); - z.SetInt64(4294967296); // 2^32, cannot cast as uint + z.SetInt64(int64_t(4294967298u) + 1); // 2^32, cannot cast as uint EXPECT_FALSE(z.IsInt()); EXPECT_FALSE(z.IsUint()); EXPECT_NEAR(4294967296.0, z.GetDouble(), 0.0); @@ -528,12 +528,12 @@ TEST(Value, Uint64) { z.SetUint64(1234); EXPECT_EQ(1234u, z.GetUint64()); - z.SetUint64(uint64_t(2147483648)); // 2^31, cannot cast as int + z.SetUint64(uint64_t(2147483648u)); // 2^31, cannot cast as int EXPECT_FALSE(z.IsInt()); EXPECT_TRUE(z.IsUint()); EXPECT_TRUE(z.IsInt64()); - z.SetUint64(uint64_t(4294967295) + 1); // 2^32, cannot cast as uint + z.SetUint64(uint64_t(4294967295u) + 1); // 2^32, cannot cast as uint EXPECT_FALSE(z.IsInt()); EXPECT_FALSE(z.IsUint()); EXPECT_TRUE(z.IsInt64());