mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-06-07 01:04:55 +02:00
Run clang format
Clang format hasn't been run on some recent checkins. This patch updates the repository with clang format properly run on all files.
This commit is contained in:
parent
f7182a0fdc
commit
d5bd1a7716
@ -108,8 +108,9 @@ msvc_pre1900_c99_snprintf(char* outBuf, size_t size, const char* format, ...);
|
|||||||
#define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
|
#define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
|
||||||
#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
|
#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
|
||||||
#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
|
#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
|
||||||
#endif // GNUC version
|
#endif // GNUC version
|
||||||
#elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates MSVC)
|
#elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates
|
||||||
|
// MSVC)
|
||||||
#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
|
#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
|
||||||
#endif // __clang__ || __GNUC__ || _MSC_VER
|
#endif // __clang__ || __GNUC__ || _MSC_VER
|
||||||
|
|
||||||
|
@ -612,7 +612,9 @@ Json::Value obj_value(Json::objectValue); // {}
|
|||||||
ptrdiff_t getOffsetLimit() const;
|
ptrdiff_t getOffsetLimit() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setType(ValueType v) { bits_.value_type_ = static_cast<unsigned char> (v); }
|
void setType(ValueType v) {
|
||||||
|
bits_.value_type_ = static_cast<unsigned char>(v);
|
||||||
|
}
|
||||||
bool isAllocated() const { return bits_.allocated_; }
|
bool isAllocated() const { return bits_.allocated_; }
|
||||||
void setIsAllocated(bool v) { bits_.allocated_ = v; }
|
void setIsAllocated(bool v) { bits_.allocated_ = v; }
|
||||||
|
|
||||||
|
@ -238,13 +238,9 @@ JSONCPP_NORETURN void throwRuntimeError(String const& msg) {
|
|||||||
JSONCPP_NORETURN void throwLogicError(String const& msg) {
|
JSONCPP_NORETURN void throwLogicError(String const& msg) {
|
||||||
throw LogicError(msg);
|
throw LogicError(msg);
|
||||||
}
|
}
|
||||||
# else // !JSON_USE_EXCEPTION
|
#else // !JSON_USE_EXCEPTION
|
||||||
JSONCPP_NORETURN void throwRuntimeError(String const& msg) {
|
JSONCPP_NORETURN void throwRuntimeError(String const& msg) { abort(); }
|
||||||
abort();
|
JSONCPP_NORETURN void throwLogicError(String const& msg) { abort(); }
|
||||||
}
|
|
||||||
JSONCPP_NORETURN void throwLogicError(String const& msg) {
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// //////////////////////////////////////////////////////////////////
|
// //////////////////////////////////////////////////////////////////
|
||||||
@ -1445,8 +1441,7 @@ bool Value::isObject() const { return type() == objectValue; }
|
|||||||
Value::Comments::Comments(const Comments& that)
|
Value::Comments::Comments(const Comments& that)
|
||||||
: ptr_{cloneUnique(that.ptr_)} {}
|
: ptr_{cloneUnique(that.ptr_)} {}
|
||||||
|
|
||||||
Value::Comments::Comments(Comments&& that)
|
Value::Comments::Comments(Comments&& that) : ptr_{std::move(that.ptr_)} {}
|
||||||
: ptr_{std::move(that.ptr_)} {}
|
|
||||||
|
|
||||||
Value::Comments& Value::Comments::operator=(const Comments& that) {
|
Value::Comments& Value::Comments::operator=(const Comments& that) {
|
||||||
ptr_ = cloneUnique(that.ptr_);
|
ptr_ = cloneUnique(that.ptr_);
|
||||||
|
@ -211,14 +211,17 @@ JSONTEST_FIXTURE(ValueTest, objects) {
|
|||||||
JSONTEST_ASSERT_EQUAL(Json::Value(1234), *foundId);
|
JSONTEST_ASSERT_EQUAL(Json::Value(1234), *foundId);
|
||||||
|
|
||||||
const char unknownIdKey[] = "unknown id";
|
const char unknownIdKey[] = "unknown id";
|
||||||
const Json::Value* foundUnknownId = object1_.find(unknownIdKey, unknownIdKey + strlen(unknownIdKey));
|
const Json::Value* foundUnknownId =
|
||||||
|
object1_.find(unknownIdKey, unknownIdKey + strlen(unknownIdKey));
|
||||||
JSONTEST_ASSERT_EQUAL(nullptr, foundUnknownId);
|
JSONTEST_ASSERT_EQUAL(nullptr, foundUnknownId);
|
||||||
|
|
||||||
// Access through demand()
|
// Access through demand()
|
||||||
const char yetAnotherIdKey[] = "yet another id";
|
const char yetAnotherIdKey[] = "yet another id";
|
||||||
const Json::Value* foundYetAnotherId = object1_.find(yetAnotherIdKey, yetAnotherIdKey + strlen(yetAnotherIdKey));
|
const Json::Value* foundYetAnotherId =
|
||||||
|
object1_.find(yetAnotherIdKey, yetAnotherIdKey + strlen(yetAnotherIdKey));
|
||||||
JSONTEST_ASSERT_EQUAL(nullptr, foundYetAnotherId);
|
JSONTEST_ASSERT_EQUAL(nullptr, foundYetAnotherId);
|
||||||
Json::Value* demandedYetAnotherId = object1_.demand(yetAnotherIdKey, yetAnotherIdKey + strlen(yetAnotherIdKey));
|
Json::Value* demandedYetAnotherId = object1_.demand(
|
||||||
|
yetAnotherIdKey, yetAnotherIdKey + strlen(yetAnotherIdKey));
|
||||||
JSONTEST_ASSERT(demandedYetAnotherId != nullptr);
|
JSONTEST_ASSERT(demandedYetAnotherId != nullptr);
|
||||||
*demandedYetAnotherId = "baz";
|
*demandedYetAnotherId = "baz";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user