Skip to content

Commit 729abaf

Browse files
committed
clang formatize
1 parent 836d954 commit 729abaf

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

src/jsontestrunner/main.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
#include <algorithm> // sort
1717
#include <cstdio>
18+
#include <iostream>
1819
#include <json/json.h>
1920
#include <memory>
20-
#include <iostream>
2121
#include <sstream>
2222

2323
struct Options {
@@ -149,8 +149,8 @@ static int parseAndSaveValueTree(const Json::String& input,
149149
return 1;
150150
}
151151

152-
// We may instead check the legacy implementation (to ensure it doesn't
153-
// randomly get broken).
152+
// We may instead check the legacy implementation (to ensure it doesn't
153+
// randomly get broken).
154154
} else {
155155
Json::Reader reader(features);
156156
const bool parsingSuccessful =
@@ -165,7 +165,8 @@ static int parseAndSaveValueTree(const Json::String& input,
165165
if (!parseOnly) {
166166
FILE* factual = fopen(actual.c_str(), "wt");
167167
if (!factual) {
168-
std::cerr << "Failed to create '" << kind << "' actual file." << std::endl;
168+
std::cerr << "Failed to create '" << kind << "' actual file."
169+
<< std::endl;
169170
return 2;
170171
}
171172
printValueTree(factual, *root);
@@ -227,7 +228,8 @@ static void printConfig() {
227228
}
228229

229230
static int printUsage(const char* argv[]) {
230-
std::cout << "Usage: " << argv[0] << " [--strict] input-json-file" << std::endl;
231+
std::cout << "Usage: " << argv[0] << " [--strict] input-json-file"
232+
<< std::endl;
231233
return 3;
232234
}
233235

@@ -279,7 +281,8 @@ static int runTest(Options const& opts, bool use_legacy) {
279281

280282
Json::String basePath = removeSuffix(opts.path, ".json");
281283
if (!opts.parseOnly && basePath.empty()) {
282-
std::cerr << "Bad input path '" << opts.path << "'. Must end with '.expected'" << std::endl;
284+
std::cerr << "Bad input path '" << opts.path
285+
<< "'. Must end with '.expected'" << std::endl;
283286
return 3;
284287
}
285288

@@ -322,7 +325,8 @@ int main(int argc, const char* argv[]) {
322325
return modern_return_code;
323326
}
324327

325-
const std::string filename = opts.path.substr(opts.path.find_last_of("\\/") + 1);
328+
const std::string filename =
329+
opts.path.substr(opts.path.find_last_of("\\/") + 1);
326330
const bool should_run_legacy = (filename.rfind("legacy_", 0) == 0);
327331
if (should_run_legacy) {
328332
return runTest(opts, true);

src/lib_json/json_reader.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,14 +1531,19 @@ bool OurReader::decodeNumber(Token& token, Value& decoded) {
15311531
// We assume we can represent the largest and smallest integer types as
15321532
// unsigned integers with separate sign. This is only true if they can fit
15331533
// into an unsigned integer.
1534-
static_assert(Value::maxLargestInt <= Value::maxLargestUInt, "Int must be smaller than UInt");
1534+
static_assert(Value::maxLargestInt <= Value::maxLargestUInt,
1535+
"Int must be smaller than UInt");
15351536

15361537
// We need to convert minLargestInt into a positive number. The easiest way
15371538
// to do this conversion is to assume our "threshold" value of minLargestInt
15381539
// divided by 10 can fit in maxLargestInt when absolute valued. This should
15391540
// be a safe assumption.
1540-
static_assert(Value::minLargestInt <= -Value::maxLargestInt, "The absolute value of minLargestInt must be greater than or equal to maxLargestInt");
1541-
static_assert(Value::minLargestInt / 10 >= -Value::maxLargestInt, "The absolute value of minLargestInt must be only 1 magnitude larger than maxLargest Int");
1541+
static_assert(Value::minLargestInt <= -Value::maxLargestInt,
1542+
"The absolute value of minLargestInt must be greater than or "
1543+
"equal to maxLargestInt");
1544+
static_assert(Value::minLargestInt / 10 >= -Value::maxLargestInt,
1545+
"The absolute value of minLargestInt must be only 1 magnitude "
1546+
"larger than maxLargest Int");
15421547

15431548
static constexpr Value::LargestUInt positive_threshold =
15441549
Value::maxLargestUInt / 10;

0 commit comments

Comments
 (0)