Try to fix clang and gcc warnings problems againx2
This commit is contained in:
parent
9ce381b801
commit
a6a73b51b5
@ -17,6 +17,11 @@
|
|||||||
|
|
||||||
#include "rapidjson.h"
|
#include "rapidjson.h"
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
RAPIDJSON_DIAG_PUSH
|
||||||
|
RAPIDJSON_DIAG_OFF(unreachable-code)
|
||||||
|
#endif
|
||||||
|
|
||||||
RAPIDJSON_NAMESPACE_BEGIN
|
RAPIDJSON_NAMESPACE_BEGIN
|
||||||
|
|
||||||
//! Represents an in-memory input byte stream.
|
//! Represents an in-memory input byte stream.
|
||||||
@ -58,4 +63,8 @@ struct MemoryStream {
|
|||||||
|
|
||||||
RAPIDJSON_NAMESPACE_END
|
RAPIDJSON_NAMESPACE_END
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
RAPIDJSON_DIAG_POP
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // RAPIDJSON_MEMORYBUFFER_H_
|
#endif // RAPIDJSON_MEMORYBUFFER_H_
|
||||||
|
@ -18,6 +18,11 @@
|
|||||||
#include "document.h"
|
#include "document.h"
|
||||||
#include "internal/itoa.h"
|
#include "internal/itoa.h"
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
RAPIDJSON_DIAG_PUSH
|
||||||
|
RAPIDJSON_DIAG_OFF(switch-enum)
|
||||||
|
#endif
|
||||||
|
|
||||||
RAPIDJSON_NAMESPACE_BEGIN
|
RAPIDJSON_NAMESPACE_BEGIN
|
||||||
|
|
||||||
static const SizeType kPointerInvalidIndex = ~SizeType(0); //!< Represents an invalid index in GenericPointer::Token
|
static const SizeType kPointerInvalidIndex = ~SizeType(0); //!< Represents an invalid index in GenericPointer::Token
|
||||||
@ -71,7 +76,7 @@ template <typename ValueType, typename Allocator = CrtAllocator>
|
|||||||
class GenericPointer {
|
class GenericPointer {
|
||||||
public:
|
public:
|
||||||
typedef typename ValueType::EncodingType EncodingType; //!< Encoding type from Value
|
typedef typename ValueType::EncodingType EncodingType; //!< Encoding type from Value
|
||||||
typedef typename EncodingType::Ch Ch; //!< Character type from Value
|
typedef typename ValueType::Ch Ch; //!< Character type from Value
|
||||||
|
|
||||||
//! A token is the basic units of internal representation.
|
//! A token is the basic units of internal representation.
|
||||||
/*!
|
/*!
|
||||||
@ -472,11 +477,7 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
v = &((*v)[t->index]);
|
v = &((*v)[t->index]);
|
||||||
break;
|
break;
|
||||||
case kNullType:
|
default:
|
||||||
case kFalseType:
|
|
||||||
case kTrueType:
|
|
||||||
case kStringType:
|
|
||||||
case kNumberType:
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -705,11 +706,7 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
v = &((*v)[t->index]);
|
v = &((*v)[t->index]);
|
||||||
break;
|
break;
|
||||||
case kNullType:
|
default:
|
||||||
case kFalseType:
|
|
||||||
case kTrueType:
|
|
||||||
case kStringType:
|
|
||||||
case kNumberType:
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -722,11 +719,7 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
v->Erase(v->Begin() + last->index);
|
v->Erase(v->Begin() + last->index);
|
||||||
return true;
|
return true;
|
||||||
case kNullType:
|
default:
|
||||||
case kFalseType:
|
|
||||||
case kTrueType:
|
|
||||||
case kStringType:
|
|
||||||
case kNumberType:
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -958,7 +951,7 @@ private:
|
|||||||
*/
|
*/
|
||||||
class PercentDecodeStream {
|
class PercentDecodeStream {
|
||||||
public:
|
public:
|
||||||
typedef Ch Ch;
|
typedef typename ValueType::Ch Ch;
|
||||||
|
|
||||||
//! Constructor
|
//! Constructor
|
||||||
/*!
|
/*!
|
||||||
@ -1326,4 +1319,8 @@ bool EraseValueByPointer(T& root, const CharType(&source)[N]) {
|
|||||||
|
|
||||||
RAPIDJSON_NAMESPACE_END
|
RAPIDJSON_NAMESPACE_END
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
RAPIDJSON_DIAG_POP
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // RAPIDJSON_POINTER_H_
|
#endif // RAPIDJSON_POINTER_H_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user