From 63423eb6f8aa2b315d810baf8e96e7f2600745d7 Mon Sep 17 00:00:00 2001 From: Oliver Hahm Date: Fri, 21 Apr 2017 14:49:12 +0200 Subject: [PATCH 1/2] fix return values --- include/rapidjson/document.h | 2 +- include/rapidjson/schema.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index a2b044c..c12820e 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -515,7 +515,7 @@ struct TypeHelper { static bool Is(const ValueType& v) { return v.IsObject(); } static ObjectType Get(ValueType& v) { return v.GetObject(); } static ValueType& Set(ValueType& v, ObjectType data) { return v = data; } - static ValueType& Set(ValueType& v, ObjectType data, typename ValueType::AllocatorType&) { v = data; } + static ValueType& Set(ValueType& v, ObjectType data, typename ValueType::AllocatorType&) { return v = data; } }; template diff --git a/include/rapidjson/schema.h b/include/rapidjson/schema.h index 3dddd3a..44a94f8 100644 --- a/include/rapidjson/schema.h +++ b/include/rapidjson/schema.h @@ -1789,7 +1789,7 @@ RAPIDJSON_MULTILINEMACRO_END } virtual void FreeState(void* p) { - return StateAllocator::Free(p); + StateAllocator::Free(p); } private: From 885b5cd2f9b0fe9596d58ee28663cb6267559f67 Mon Sep 17 00:00:00 2001 From: Oliver Hahm Date: Fri, 21 Apr 2017 14:49:30 +0200 Subject: [PATCH 2/2] common notation of empty if/else case --- include/rapidjson/schema.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/rapidjson/schema.h b/include/rapidjson/schema.h index 44a94f8..348dd37 100644 --- a/include/rapidjson/schema.h +++ b/include/rapidjson/schema.h @@ -1112,8 +1112,8 @@ private: if (exclusiveMaximum_ ? i >= maximum_.GetInt64() : i > maximum_.GetInt64()) RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); } - else if (maximum_.IsUint64()) - /* do nothing */; // i <= max(int64_t) < maximum_.GetUint64() + else if (maximum_.IsUint64()) { } + /* do nothing */ // i <= max(int64_t) < maximum_.GetUint64() else if (!CheckDoubleMaximum(context, static_cast(i))) return false; }