From b999616df8f34d8183c5836df76f3cb7b2bfa4b3 Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Sun, 15 May 2016 23:13:47 -0500 Subject: [PATCH 1/2] fix warning --- src/jsontestrunner/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jsontestrunner/main.cpp b/src/jsontestrunner/main.cpp index a1d911d..45db464 100644 --- a/src/jsontestrunner/main.cpp +++ b/src/jsontestrunner/main.cpp @@ -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(size); + unsigned long const usize = static_cast(size); fseek(file, 0, SEEK_SET); JSONCPP_STRING text; char* buffer = new char[size + 1]; From ea4af183171bcc1d775af301d9e8bd8db9405cc7 Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Sun, 15 May 2016 23:13:56 -0500 Subject: [PATCH 2/2] Fix int->char conv warn resolves #473 --- src/lib_json/json_reader.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index 5d39921..4930c17 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -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 == '\\') @@ -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; }