Skip to content

Commit ea4af18

Browse files
committed
Fix int->char conv warn
resolves open-source-parsers#473
1 parent b999616 commit ea4af18

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

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)