Skip to content

Fix some warnings #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/jsontestrunner/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static JSONCPP_STRING readInputTestFile(const char* path) {
return JSONCPP_STRING("");
fseek(file, 0, SEEK_END);
long const size = ftell(file);
unsigned long const usize = static_cast<unsigned long const>(size);
unsigned long const usize = static_cast<unsigned long>(size);
fseek(file, 0, SEEK_SET);
JSONCPP_STRING text;
char* buffer = new char[size + 1];
Expand Down
26 changes: 13 additions & 13 deletions src/lib_json/json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,25 +430,25 @@ void Reader::readNumber() {
char c = '0'; // stopgap for already consumed character
// integral part
while (c >= '0' && c <= '9')
c = (current_ = p) < end_ ? *p++ : 0;
c = (current_ = p) < end_ ? *p++ : '\0';
// fractional part
if (c == '.') {
c = (current_ = p) < end_ ? *p++ : 0;
c = (current_ = p) < end_ ? *p++ : '\0';
while (c >= '0' && c <= '9')
c = (current_ = p) < end_ ? *p++ : 0;
c = (current_ = p) < end_ ? *p++ : '\0';
}
// exponential part
if (c == 'e' || c == 'E') {
c = (current_ = p) < end_ ? *p++ : 0;
c = (current_ = p) < end_ ? *p++ : '\0';
if (c == '+' || c == '-')
c = (current_ = p) < end_ ? *p++ : 0;
c = (current_ = p) < end_ ? *p++ : '\0';
while (c >= '0' && c <= '9')
c = (current_ = p) < end_ ? *p++ : 0;
c = (current_ = p) < end_ ? *p++ : '\0';
}
}

bool Reader::readString() {
Char c = 0;
Char c = '\0';
while (current_ != end_) {
c = getNextChar();
if (c == '\\')
Expand Down Expand Up @@ -1394,20 +1394,20 @@ bool OurReader::readNumber(bool checkInf) {
char c = '0'; // stopgap for already consumed character
// integral part
while (c >= '0' && c <= '9')
c = (current_ = p) < end_ ? *p++ : 0;
c = (current_ = p) < end_ ? *p++ : '\0';
// fractional part
if (c == '.') {
c = (current_ = p) < end_ ? *p++ : 0;
c = (current_ = p) < end_ ? *p++ : '\0';
while (c >= '0' && c <= '9')
c = (current_ = p) < end_ ? *p++ : 0;
c = (current_ = p) < end_ ? *p++ : '\0';
}
// exponential part
if (c == 'e' || c == 'E') {
c = (current_ = p) < end_ ? *p++ : 0;
c = (current_ = p) < end_ ? *p++ : '\0';
if (c == '+' || c == '-')
c = (current_ = p) < end_ ? *p++ : 0;
c = (current_ = p) < end_ ? *p++ : '\0';
while (c >= '0' && c <= '9')
c = (current_ = p) < end_ ? *p++ : 0;
c = (current_ = p) < end_ ? *p++ : '\0';
}
return true;
}
Expand Down