diff --git a/lib/errorlogger.cpp b/lib/errorlogger.cpp index b151a450d..eddf58fe7 100644 --- a/lib/errorlogger.cpp +++ b/lib/errorlogger.cpp @@ -159,7 +159,7 @@ bool ErrorLogger::ErrorMessage::deserialize(const std::string &data) _id = results[0]; _severity = Severity::fromString(results[1]); - _cwe = (unsigned)MathLib::toULongNumber(results[2]); + _cwe = MathLib::toULongNumber(results[2]); _shortMessage = results[3]; _verboseMessage = results[4]; @@ -235,7 +235,7 @@ std::string ErrorLogger::ErrorMessage::fixInvalidChars(const std::string& raw) } else { std::ostringstream es; // straight cast to (unsigned) doesn't work out. - const unsigned uFrom = (unsigned)(unsigned char)*from; + const unsigned uFrom = (unsigned char)*from; #if 0 if (uFrom<0x20) es << "\\XXX"; diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index ea0077660..6647d105f 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -1525,9 +1525,9 @@ static void execute(const Token *expr, const std::string strValue = val.tokvalue->strValue(); MathLib::bigint index = 0; execute(expr->astOperand2(), programMemory, &index, error); - if (index >= 0 && index < (int)strValue.size()) + if (index >= 0 && index < strValue.size()) *result = strValue[index]; - else if (index == (int)strValue.size()) + else if (index == strValue.size()) *result = 0; else *error = true;