Skip to content

Commit 4356d9b

Browse files
committed
Merge pull request #474 from cdunn2001/fix-warning
Fix some warnings
2 parents 660307d + ea4af18 commit 4356d9b

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/jsontestrunner/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static JSONCPP_STRING readInputTestFile(const char* path) {
5858
return JSONCPP_STRING("");
5959
fseek(file, 0, SEEK_END);
6060
long const size = ftell(file);
61-
unsigned long const usize = static_cast<unsigned long const>(size);
61+
unsigned long const usize = static_cast<unsigned long>(size);
6262
fseek(file, 0, SEEK_SET);
6363
JSONCPP_STRING text;
6464
char* buffer = new char[size + 1];

src/lib_json/json_reader.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -430,25 +430,25 @@ void Reader::readNumber() {
430430
char c = '0'; // stopgap for already consumed character
431431
// integral part
432432
while (c >= '0' && c <= '9')
433-
c = (current_ = p) < end_ ? *p++ : 0;
433+
c = (current_ = p) < end_ ? *p++ : '\0';
434434
// fractional part
435435
if (c == '.') {
436-
c = (current_ = p) < end_ ? *p++ : 0;
436+
c = (current_ = p) < end_ ? *p++ : '\0';
437437
while (c >= '0' && c <= '9')
438-
c = (current_ = p) < end_ ? *p++ : 0;
438+
c = (current_ = p) < end_ ? *p++ : '\0';
439439
}
440440
// exponential part
441441
if (c == 'e' || c == 'E') {
442-
c = (current_ = p) < end_ ? *p++ : 0;
442+
c = (current_ = p) < end_ ? *p++ : '\0';
443443
if (c == '+' || c == '-')
444-
c = (current_ = p) < end_ ? *p++ : 0;
444+
c = (current_ = p) < end_ ? *p++ : '\0';
445445
while (c >= '0' && c <= '9')
446-
c = (current_ = p) < end_ ? *p++ : 0;
446+
c = (current_ = p) < end_ ? *p++ : '\0';
447447
}
448448
}
449449

450450
bool Reader::readString() {
451-
Char c = 0;
451+
Char c = '\0';
452452
while (current_ != end_) {
453453
c = getNextChar();
454454
if (c == '\\')
@@ -1394,20 +1394,20 @@ bool OurReader::readNumber(bool checkInf) {
13941394
char c = '0'; // stopgap for already consumed character
13951395
// integral part
13961396
while (c >= '0' && c <= '9')
1397-
c = (current_ = p) < end_ ? *p++ : 0;
1397+
c = (current_ = p) < end_ ? *p++ : '\0';
13981398
// fractional part
13991399
if (c == '.') {
1400-
c = (current_ = p) < end_ ? *p++ : 0;
1400+
c = (current_ = p) < end_ ? *p++ : '\0';
14011401
while (c >= '0' && c <= '9')
1402-
c = (current_ = p) < end_ ? *p++ : 0;
1402+
c = (current_ = p) < end_ ? *p++ : '\0';
14031403
}
14041404
// exponential part
14051405
if (c == 'e' || c == 'E') {
1406-
c = (current_ = p) < end_ ? *p++ : 0;
1406+
c = (current_ = p) < end_ ? *p++ : '\0';
14071407
if (c == '+' || c == '-')
1408-
c = (current_ = p) < end_ ? *p++ : 0;
1408+
c = (current_ = p) < end_ ? *p++ : '\0';
14091409
while (c >= '0' && c <= '9')
1410-
c = (current_ = p) < end_ ? *p++ : 0;
1410+
c = (current_ = p) < end_ ? *p++ : '\0';
14111411
}
14121412
return true;
14131413
}

0 commit comments

Comments
 (0)