mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-06-08 01:24:57 +02:00
fix gcc warnings
This commit is contained in:
parent
201904bfbb
commit
2bc6137ada
@ -85,10 +85,10 @@ endif( MSVC )
|
|||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
# using regular Clang or AppleClang
|
# using regular Clang or AppleClang
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
# using GCC
|
# using GCC
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra -Wpedantic")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(JSONCPP_WITH_WARNING_AS_ERROR)
|
IF(JSONCPP_WITH_WARNING_AS_ERROR)
|
||||||
|
@ -505,10 +505,10 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
} value_;
|
} value_;
|
||||||
ValueType type_ : 8;
|
ValueType type_ : 8;
|
||||||
int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
|
unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
|
||||||
#ifdef JSON_VALUE_USE_INTERNAL_MAP
|
#ifdef JSON_VALUE_USE_INTERNAL_MAP
|
||||||
unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container.
|
unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container.
|
||||||
int memberNameIsStatic_ : 1; // used by the ValueInternalMap container.
|
unsigned int memberNameIsStatic_ : 1; // used by the ValueInternalMap container.
|
||||||
#endif
|
#endif
|
||||||
CommentInfo* comments_;
|
CommentInfo* comments_;
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ Value::Value(const Value& other)
|
|||||||
case stringValue:
|
case stringValue:
|
||||||
if (other.value_.string_) {
|
if (other.value_.string_) {
|
||||||
value_.string_ = duplicateStringValue(other.value_.string_);
|
value_.string_ = duplicateStringValue(other.value_.string_);
|
||||||
allocated_ |= true;
|
allocated_ = true;
|
||||||
} else {
|
} else {
|
||||||
value_.string_ = 0;
|
value_.string_ = 0;
|
||||||
allocated_ = false;
|
allocated_ = false;
|
||||||
|
@ -323,7 +323,7 @@ void Runner::listTests() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Runner::runCommandLine(int argc, const char* argv[]) const {
|
int Runner::runCommandLine(int argc, const char* argv[]) const {
|
||||||
typedef std::deque<std::string> TestNames;
|
// typedef std::deque<std::string> TestNames;
|
||||||
Runner subrunner;
|
Runner subrunner;
|
||||||
for (int index = 1; index < argc; ++index) {
|
for (int index = 1; index < argc; ++index) {
|
||||||
std::string opt = argv[index];
|
std::string opt = argv[index];
|
||||||
|
@ -214,7 +214,7 @@ TestResult& checkStringEqual(TestResult& result,
|
|||||||
#define JSONTEST_ASSERT_PRED(expr) \
|
#define JSONTEST_ASSERT_PRED(expr) \
|
||||||
{ \
|
{ \
|
||||||
JsonTest::PredicateContext _minitest_Context = { \
|
JsonTest::PredicateContext _minitest_Context = { \
|
||||||
result_->predicateId_, __FILE__, __LINE__, #expr \
|
result_->predicateId_, __FILE__, __LINE__, #expr, nullptr, nullptr \
|
||||||
}; \
|
}; \
|
||||||
result_->predicateStackTail_->next_ = &_minitest_Context; \
|
result_->predicateStackTail_->next_ = &_minitest_Context; \
|
||||||
result_->predicateId_ += 1; \
|
result_->predicateId_ += 1; \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user