Skip to content

Commit 4babd12

Browse files
authored
Merge pull request open-source-parsers#953 from baylesj/clang-format
Run clang format
2 parents 6935317 + d5bd1a7 commit 4babd12

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

include/json/config.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ msvc_pre1900_c99_snprintf(char* outBuf, size_t size, const char* format, ...);
108108
#define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
109109
#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
110110
#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
111-
#endif // GNUC version
112-
#elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates MSVC)
111+
#endif // GNUC version
112+
#elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates
113+
// MSVC)
113114
#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
114115
#endif // __clang__ || __GNUC__ || _MSC_VER
115116

include/json/value.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,9 @@ Json::Value obj_value(Json::objectValue); // {}
612612
ptrdiff_t getOffsetLimit() const;
613613

614614
private:
615-
void setType(ValueType v) { bits_.value_type_ = static_cast<unsigned char> (v); }
615+
void setType(ValueType v) {
616+
bits_.value_type_ = static_cast<unsigned char>(v);
617+
}
616618
bool isAllocated() const { return bits_.allocated_; }
617619
void setIsAllocated(bool v) { bits_.allocated_ = v; }
618620

src/lib_json/json_value.cpp

+4-9
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,9 @@ JSONCPP_NORETURN void throwRuntimeError(String const& msg) {
238238
JSONCPP_NORETURN void throwLogicError(String const& msg) {
239239
throw LogicError(msg);
240240
}
241-
# else // !JSON_USE_EXCEPTION
242-
JSONCPP_NORETURN void throwRuntimeError(String const& msg) {
243-
abort();
244-
}
245-
JSONCPP_NORETURN void throwLogicError(String const& msg) {
246-
abort();
247-
}
241+
#else // !JSON_USE_EXCEPTION
242+
JSONCPP_NORETURN void throwRuntimeError(String const& msg) { abort(); }
243+
JSONCPP_NORETURN void throwLogicError(String const& msg) { abort(); }
248244
#endif
249245

250246
// //////////////////////////////////////////////////////////////////
@@ -1445,8 +1441,7 @@ bool Value::isObject() const { return type() == objectValue; }
14451441
Value::Comments::Comments(const Comments& that)
14461442
: ptr_{cloneUnique(that.ptr_)} {}
14471443

1448-
Value::Comments::Comments(Comments&& that)
1449-
: ptr_{std::move(that.ptr_)} {}
1444+
Value::Comments::Comments(Comments&& that) : ptr_{std::move(that.ptr_)} {}
14501445

14511446
Value::Comments& Value::Comments::operator=(const Comments& that) {
14521447
ptr_ = cloneUnique(that.ptr_);

src/test_lib_json/main.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,17 @@ JSONTEST_FIXTURE(ValueTest, objects) {
211211
JSONTEST_ASSERT_EQUAL(Json::Value(1234), *foundId);
212212

213213
const char unknownIdKey[] = "unknown id";
214-
const Json::Value* foundUnknownId = object1_.find(unknownIdKey, unknownIdKey + strlen(unknownIdKey));
214+
const Json::Value* foundUnknownId =
215+
object1_.find(unknownIdKey, unknownIdKey + strlen(unknownIdKey));
215216
JSONTEST_ASSERT_EQUAL(nullptr, foundUnknownId);
216217

217218
// Access through demand()
218219
const char yetAnotherIdKey[] = "yet another id";
219-
const Json::Value* foundYetAnotherId = object1_.find(yetAnotherIdKey, yetAnotherIdKey + strlen(yetAnotherIdKey));
220+
const Json::Value* foundYetAnotherId =
221+
object1_.find(yetAnotherIdKey, yetAnotherIdKey + strlen(yetAnotherIdKey));
220222
JSONTEST_ASSERT_EQUAL(nullptr, foundYetAnotherId);
221-
Json::Value* demandedYetAnotherId = object1_.demand(yetAnotherIdKey, yetAnotherIdKey + strlen(yetAnotherIdKey));
223+
Json::Value* demandedYetAnotherId = object1_.demand(
224+
yetAnotherIdKey, yetAnotherIdKey + strlen(yetAnotherIdKey));
222225
JSONTEST_ASSERT(demandedYetAnotherId != nullptr);
223226
*demandedYetAnotherId = "baz";
224227

0 commit comments

Comments
 (0)