Remove some useless casts, probably added to avoid false positives.

This commit is contained in:
Daniel Marjamäki 2015-07-04 13:19:21 +02:00
parent b8e77c8005
commit f3b4c1d0db
2 changed files with 4 additions and 4 deletions

View File

@ -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";

View File

@ -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;