Skip to content

Commit 30b07c0

Browse files
committed
Ran clang-format over all .h and .cpp files.
clang-format -i $(find . -name '*.h' -or -name '*.cpp')
1 parent 32009b1 commit 30b07c0

File tree

7 files changed

+38
-36
lines changed

7 files changed

+38
-36
lines changed

Diff for: include/json/value.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class JSON_API Value {
133133
typedef Json::LargestUInt LargestUInt;
134134
typedef Json::ArrayIndex ArrayIndex;
135135

136-
static const Value& null;
136+
static const Value &null;
137137
/// Minimum signed integer value that can be stored in a Json::Value.
138138
static const LargestInt minLargestInt;
139139
/// Maximum signed integer value that can be stored in a Json::Value.

Diff for: include/json/version.h

+9-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
// and "version.h.in" files.
33
// Run CMake configure step to update it.
44
#ifndef JSON_VERSION_H_INCLUDED
5-
# define JSON_VERSION_H_INCLUDED
5+
#define JSON_VERSION_H_INCLUDED
66

7-
# define JSONCPP_VERSION_STRING "0.6.0-dev"
8-
# define JSONCPP_VERSION_MAJOR 0
9-
# define JSONCPP_VERSION_MINOR 6
10-
# define JSONCPP_VERSION_PATCH 0
11-
# define JSONCPP_VERSION_QUALIFIER -dev
12-
# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
7+
#define JSONCPP_VERSION_STRING "0.6.0-dev"
8+
#define JSONCPP_VERSION_MAJOR 0
9+
#define JSONCPP_VERSION_MINOR 6
10+
#define JSONCPP_VERSION_PATCH 0
11+
#define JSONCPP_VERSION_QUALIFIER -dev
12+
#define JSONCPP_VERSION_HEXA \
13+
((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \
14+
(JSONCPP_VERSION_PATCH << 8))
1315

1416
#endif // JSON_VERSION_H_INCLUDED

Diff for: src/lib_json/json_reader.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -781,11 +781,11 @@ std::string Reader::getLocationLineAndColumn(Location location) const {
781781
getLocationLineAndColumn(location, line, column);
782782
char buffer[18 + 16 + 16 + 1];
783783
#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__)
784-
#if defined(WINCE)
784+
#if defined(WINCE)
785785
_snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
786-
#else
786+
#else
787787
sprintf_s(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
788-
#endif
788+
#endif
789789
#else
790790
snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
791791
#endif

Diff for: src/lib_json/json_tool.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static inline void uintToString(LargestUInt value, char *&current) {
7373
* We had a sophisticated way, but it did not work in WinCE.
7474
* @see https://github.com/open-source-parsers/jsoncpp/pull/9
7575
*/
76-
static inline void fixNumericLocale(char* begin, char* end) {
76+
static inline void fixNumericLocale(char *begin, char *end) {
7777
while (begin < end) {
7878
if (*begin == ',') {
7979
*begin = '.';

Diff for: src/lib_json/json_value.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ namespace Json {
3333
#else
3434
#define ALIGNAS(byte_alignment)
3535
#endif
36-
static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = {0};
37-
const unsigned char& kNullRef = kNull[0];
38-
const Value& Value::null = reinterpret_cast<const Value&>(kNullRef);
36+
static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 };
37+
const unsigned char &kNullRef = kNull[0];
38+
const Value &Value::null = reinterpret_cast<const Value &>(kNullRef);
3939

4040
const Int Value::minInt = Int(~(UInt(-1) / 2));
4141
const Int Value::maxInt = Int(UInt(-1) / 2);
@@ -104,9 +104,7 @@ static inline char *duplicateStringValue(const char *value,
104104

105105
/** Free the string duplicated by duplicateStringValue().
106106
*/
107-
static inline void releaseStringValue(char *value) {
108-
free(value);
109-
}
107+
static inline void releaseStringValue(char *value) { free(value); }
110108

111109
} // namespace Json
112110

Diff for: src/lib_json/json_writer.cpp

+16-15
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,27 @@ std::string valueToString(double value) {
7575
#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with
7676
// visual studio 2005 to
7777
// avoid warning.
78-
#if defined(WINCE)
78+
#if defined(WINCE)
7979
len = _snprintf(buffer, sizeof(buffer), "%.16g", value);
80-
#else
80+
#else
8181
len = sprintf_s(buffer, sizeof(buffer), "%.16g", value);
82-
#endif
82+
#endif
8383
#else
84-
if (isfinite( value )) {
84+
if (isfinite(value)) {
8585
len = snprintf(buffer, sizeof(buffer), "%.16g", value);
8686
} else {
87-
// IEEE standard states that NaN values will not compare to themselves
88-
if ( value != value) {
89-
len = snprintf(buffer, sizeof(buffer), "null");
90-
} else if ( value < 0) {
91-
len = snprintf(buffer, sizeof(buffer), "-1e+9999");
92-
} else {
93-
len = snprintf(buffer, sizeof(buffer), "1e+9999");
94-
}
95-
// For those, we do not need to call fixNumLoc, but it is fast.
87+
// IEEE standard states that NaN values will not compare to themselves
88+
if (value != value) {
89+
len = snprintf(buffer, sizeof(buffer), "null");
90+
} else if (value < 0) {
91+
len = snprintf(buffer, sizeof(buffer), "-1e+9999");
92+
} else {
93+
len = snprintf(buffer, sizeof(buffer), "1e+9999");
94+
}
95+
// For those, we do not need to call fixNumLoc, but it is fast.
9696
}
9797
#endif
98-
assert(len>=0);
98+
assert(len >= 0);
9999
fixNumericLocale(buffer, buffer + len);
100100
return buffer;
101101
}
@@ -172,7 +172,8 @@ Writer::~Writer() {}
172172
// //////////////////////////////////////////////////////////////////
173173

174174
FastWriter::FastWriter()
175-
: yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false), omitEndingLineFeed_(false) {}
175+
: yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false),
176+
omitEndingLineFeed_(false) {}
176177

177178
void FastWriter::enableYAMLCompatibility() { yamlCompatiblityEnabled_ = true; }
178179

Diff for: src/test_lib_json/jsontest.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,13 @@ TestResult &checkStringEqual(TestResult &result,
247247
bool _threw = false; \
248248
try { \
249249
expr; \
250-
} catch (...) { \
250+
} \
251+
catch (...) { \
251252
_threw = true; \
252253
} \
253254
if (!_threw) \
254-
result_->addFailure(__FILE__, __LINE__, \
255-
"expected exception thrown: " #expr); \
255+
result_->addFailure( \
256+
__FILE__, __LINE__, "expected exception thrown: " #expr); \
256257
}
257258

258259
/// \brief Begin a fixture test case.

0 commit comments

Comments
 (0)