From a7fe4413d5d2e156c8b9f126e713f0a1085ad1f7 Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Fri, 25 Sep 2015 09:16:56 +0200 Subject: [PATCH] jsoncpp: Add missing cast to convert from char to UInt When parsing digits we know our `c - '0'` expression results in a non-negative value due to preceding conditions. Simply cast the result to UInt. This fixes compilation on SolarisStudio 12.4. --- Utilities/cmjsoncpp/src/lib_json/json_reader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp index 41896a7f0..7b338285c 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp @@ -529,7 +529,7 @@ bool Reader::decodeNumber(Token& token, Value& decoded) { return addError("'" + std::string(token.start_, token.end_) + "' is not a number.", token); - Value::UInt digit(c - '0'); + Value::UInt digit(static_cast(c - '0')); if (value >= threshold) { // We've hit or exceeded the max value divided by 10 (rounded down). If // a) we've only just touched the limit, b) this is the last digit, and