mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-12 10:03:51 +01:00
tweak to avoid implicit narrowing warning. (#1114)
* tweak to avoid implicit narrowing warning. change an int to size_t #1113 * Update main.cpp
This commit is contained in:
parent
a3c8642886
commit
d6c4a8fb2d
@ -124,8 +124,8 @@ Json::String ValueTest::normalizeFloatingPointStr(const Json::String& s) {
|
||||
auto index = s.find_last_of("eE");
|
||||
if (index == s.npos)
|
||||
return s;
|
||||
int hasSign = (s[index + 1] == '+' || s[index + 1] == '-') ? 1 : 0;
|
||||
auto exponentStartIndex = index + 1 + hasSign;
|
||||
std::size_t signWidth = (s[index + 1] == '+' || s[index + 1] == '-') ? 1 : 0;
|
||||
auto exponentStartIndex = index + 1 + signWidth;
|
||||
Json::String normalized = s.substr(0, exponentStartIndex);
|
||||
auto indexDigit = s.find_first_not_of('0', exponentStartIndex);
|
||||
Json::String exponent = "0";
|
||||
|
Loading…
Reference in New Issue
Block a user