aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack <66967891+ASpoonPlaysGames@users.noreply.github.com>2024-01-21 17:56:09 +0000
committerGitHub <noreply@github.com>2024-01-21 18:56:09 +0100
commite72f0cbbac6ffcbfbf0c52f14a2a3cb7c18ba8fc (patch)
tree48e8082ee1c9d7374b9ca767c173261db3d4e131
parentbf7b5e0a81f84d712c393980ad9486624c1ea58e (diff)
downloadNorthstarLauncher-e72f0cbbac6ffcbfbf0c52f14a2a3cb7c18ba8fc.tar.gz
NorthstarLauncher-e72f0cbbac6ffcbfbf0c52f14a2a3cb7c18ba8fc.zip
Cherry-pick changes from more recent RapidJSON to reduce warnings (#646)
* fix C5054 (cherry-pick change from https://github.com/Tencent/rapidjson/pull/1817) * fix C4099 in Rapidjson. Cherry-picks the following: https://github.com/Tencent/rapidjson/commit/d87b698d0fcc10a5f632ecbc80a9cb2a8fa094a5 https://github.com/Tencent/rapidjson/pull/1568
-rw-r--r--primedev/thirdparty/rapidjson/document.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/primedev/thirdparty/rapidjson/document.h b/primedev/thirdparty/rapidjson/document.h
index e3e20dfb..22fb2f56 100644
--- a/primedev/thirdparty/rapidjson/document.h
+++ b/primedev/thirdparty/rapidjson/document.h
@@ -198,17 +198,19 @@ private:
// class-based member iterator implementation disabled, use plain pointers
template <bool Const, typename Encoding, typename Allocator>
-struct GenericMemberIterator;
+class GenericMemberIterator;
//! non-const GenericMemberIterator
template <typename Encoding, typename Allocator>
-struct GenericMemberIterator<false,Encoding,Allocator> {
+class GenericMemberIterator<false,Encoding,Allocator> {
+public:
//! use plain pointer as iterator type
typedef GenericMember<Encoding,Allocator>* Iterator;
};
//! const GenericMemberIterator
template <typename Encoding, typename Allocator>
-struct GenericMemberIterator<true,Encoding,Allocator> {
+class GenericMemberIterator<true,Encoding,Allocator> {
+public:
//! use plain const pointer as iterator type
typedef const GenericMember<Encoding,Allocator>* Iterator;
};
@@ -1822,17 +1824,18 @@ private:
// Initial flags of different types.
kNullFlag = kNullType,
- kTrueFlag = kTrueType | kBoolFlag,
- kFalseFlag = kFalseType | kBoolFlag,
- kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag,
- kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag,
- kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag,
- kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag,
- kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag,
- kNumberAnyFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag,
- kConstStringFlag = kStringType | kStringFlag,
- kCopyStringFlag = kStringType | kStringFlag | kCopyFlag,
- kShortStringFlag = kStringType | kStringFlag | kCopyFlag | kInlineStrFlag,
+ // These casts are added to suppress the warning on MSVC about bitwise operations between enums of different types.
+ kTrueFlag = static_cast<int>(kTrueType) | static_cast<int>(kBoolFlag),
+ kFalseFlag = static_cast<int>(kFalseType) | static_cast<int>(kBoolFlag),
+ kNumberIntFlag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kIntFlag | kInt64Flag),
+ kNumberUintFlag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag),
+ kNumberInt64Flag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kInt64Flag),
+ kNumberUint64Flag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kUint64Flag),
+ kNumberDoubleFlag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kDoubleFlag),
+ kNumberAnyFlag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag),
+ kConstStringFlag = static_cast<int>(kStringType) | static_cast<int>(kStringFlag),
+ kCopyStringFlag = static_cast<int>(kStringType) | static_cast<int>(kStringFlag | kCopyFlag),
+ kShortStringFlag = static_cast<int>(kStringType) | static_cast<int>(kStringFlag | kCopyFlag | kInlineStrFlag),
kObjectFlag = kObjectType,
kArrayFlag = kArrayType,