diff options
author | Marc Chevrier <marc.chevrier@sap.com> | 2015-09-25 07:16:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-25 12:38:20 (GMT) |
commit | a7fe4413d5d2e156c8b9f126e713f0a1085ad1f7 (patch) | |
tree | 05dca1daf25ce5f790f0450e918278a3dd8ac7f5 /Utilities/cmjsoncpp/src | |
parent | 7c0b22a84e59c17e588da451ced454c6bc4232c2 (diff) | |
download | CMake-a7fe4413d5d2e156c8b9f126e713f0a1085ad1f7.zip CMake-a7fe4413d5d2e156c8b9f126e713f0a1085ad1f7.tar.gz CMake-a7fe4413d5d2e156c8b9f126e713f0a1085ad1f7.tar.bz2 |
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.
Diffstat (limited to 'Utilities/cmjsoncpp/src')
-rw-r--r-- | Utilities/cmjsoncpp/src/lib_json/json_reader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp index 41896a7..7b33828 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<Value::UInt>(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 |