Skip to content

Commit 736409f

Browse files
dota17baylesj
authored andcommitted
fix clang-format error for ci (open-source-parsers#1036)
* fix clang-format error for ci * update
1 parent 7e97345 commit 736409f

File tree

4 files changed

+18
-22
lines changed

4 files changed

+18
-22
lines changed

src/lib_json/json_reader.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,9 @@ bool Reader::containsNewLine(Reader::Location begin, Reader::Location end) {
8585
// Class Reader
8686
// //////////////////////////////////////////////////////////////////
8787

88-
Reader::Reader()
89-
: features_(Features::all()) {}
88+
Reader::Reader() : features_(Features::all()) {}
9089

91-
Reader::Reader(const Features& features)
92-
: features_(features) {
93-
}
90+
Reader::Reader(const Features& features) : features_(features) {}
9491

9592
bool Reader::parse(const std::string& document,
9693
Value& root,
@@ -110,7 +107,7 @@ bool Reader::parse(std::istream& is, Value& root, bool collectComments) {
110107
// Since String is reference-counted, this at least does not
111108
// create an extra copy.
112109
String doc;
113-
std::getline(is, doc, static_cast<char>EOF);
110+
std::getline(is, doc, static_cast<char> EOF);
114111
return parse(doc.data(), doc.data() + doc.size(), root, collectComments);
115112
}
116113

@@ -895,7 +892,7 @@ OurFeatures OurFeatures::all() { return {}; }
895892
class OurReader {
896893
public:
897894
using Char = char;
898-
using Location = const Char *;
895+
using Location = const Char*;
899896
struct StructuredError {
900897
ptrdiff_t offset_start;
901898
ptrdiff_t offset_limit;
@@ -996,7 +993,7 @@ class OurReader {
996993
static String normalizeEOL(Location begin, Location end);
997994
static bool containsNewLine(Location begin, Location end);
998995

999-
using Nodes = std::stack<Value *>;
996+
using Nodes = std::stack<Value*>;
1000997
Nodes nodes_;
1001998
Errors errors_;
1002999
String document_;
@@ -1022,9 +1019,8 @@ bool OurReader::containsNewLine(OurReader::Location begin,
10221019
}
10231020

10241021
OurReader::OurReader(OurFeatures const& features)
1025-
: begin_(), end_(), current_(), lastValueEnd_(),
1026-
lastValue_(), features_(features), collectComments_() {
1027-
}
1022+
: begin_(), end_(), current_(), lastValueEnd_(), lastValue_(),
1023+
features_(features), collectComments_() {}
10281024

10291025
bool OurReader::parse(const char* beginDoc,
10301026
const char* endDoc,

src/lib_json/json_value.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,16 +1551,15 @@ Value::iterator Value::end() {
15511551
// class PathArgument
15521552
// //////////////////////////////////////////////////////////////////
15531553

1554-
PathArgument::PathArgument() {}
1554+
PathArgument::PathArgument() {}
15551555

15561556
PathArgument::PathArgument(ArrayIndex index)
1557-
: index_(index), kind_(kindIndex) {}
1557+
: index_(index), kind_(kindIndex) {}
15581558

1559-
PathArgument::PathArgument(const char* key)
1560-
: key_(key), kind_(kindKey) {}
1559+
PathArgument::PathArgument(const char* key) : key_(key), kind_(kindKey) {}
15611560

15621561
PathArgument::PathArgument(const String& key)
1563-
: key_(key.c_str()), kind_(kindKey) {}
1562+
: key_(key.c_str()), kind_(kindKey) {}
15641563

15651564
// class Path
15661565
// //////////////////////////////////////////////////////////////////

src/test_lib_json/jsontest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ void Runner::preventDialogOnCrash() {
378378
_CrtSetReportHook(&msvcrtSilentReportHook);
379379
#endif // if defined(_MSC_VER)
380380

381-
// @todo investigate this handler (for buffer overflow)
382-
// _set_security_error_handler
381+
// @todo investigate this handler (for buffer overflow)
382+
// _set_security_error_handler
383383

384384
#if defined(_WIN32)
385385
// Prevents the system from popping a dialog for debugging if the

src/test_lib_json/main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,8 +1391,10 @@ void ValueTest::checkIs(const Json::Value& value, const IsCheck& check) {
13911391

13921392
JSONTEST_FIXTURE(ValueTest, compareNull) {
13931393
JSONTEST_ASSERT_PRED(checkIsEqual(Json::Value(), Json::Value()));
1394-
JSONTEST_ASSERT_PRED(checkIsEqual(Json::Value::nullSingleton(), Json::Value()));
1395-
JSONTEST_ASSERT_PRED(checkIsEqual(Json::Value::nullSingleton(), Json::Value::nullSingleton()));
1394+
JSONTEST_ASSERT_PRED(
1395+
checkIsEqual(Json::Value::nullSingleton(), Json::Value()));
1396+
JSONTEST_ASSERT_PRED(
1397+
checkIsEqual(Json::Value::nullSingleton(), Json::Value::nullSingleton()));
13961398
}
13971399

13981400
JSONTEST_FIXTURE(ValueTest, compareInt) {
@@ -2644,8 +2646,7 @@ JSONTEST_FIXTURE(IteratorTest, indexes) {
26442646
JSONTEST_FIXTURE(IteratorTest, const) {
26452647
Json::Value const v;
26462648
JSONTEST_ASSERT_THROWS(
2647-
Json::Value::iterator it(v.begin()) // Compile, but throw.
2648-
);
2649+
Json::Value::iterator it(v.begin())); // Compile, but throw.
26492650

26502651
Json::Value value;
26512652

0 commit comments

Comments
 (0)