Fixed some compiler warning about signed/unsigned conversions.

This commit is contained in:
PKEuS 2014-09-02 11:44:51 +02:00
parent 3e65cb446e
commit a52401cf1b
2 changed files with 2 additions and 2 deletions

View File

@ -529,7 +529,7 @@ void CheckIO::checkWrongPrintfScanfArguments()
if (formatStringArgNo >= 0) {
// formatstring found in library. Find format string and first argument belonging to format string.
if (!findFormat(formatStringArgNo, tok->tokAt(2), &formatStringTok, &argListTok))
if (!findFormat(static_cast<unsigned int>(formatStringArgNo), tok->tokAt(2), &formatStringTok, &argListTok))
continue;
} else if (windows && Token::Match(tok, "Format|AppendFormat (") &&
Token::Match(tok->tokAt(-2), "%var% .") && tok->tokAt(-2)->variable() &&

View File

@ -3564,7 +3564,7 @@ bool Tokenizer::simplifyTokenList2()
for (Token *tok = list.front(); tok; tok = tok->next()) {
if (Token::Match(tok, "const static| %type% %var% = %num% ;") ||
Token::Match(tok, "const static| %type% %var% ( %num% ) ;")) {
unsigned int offset = 0;
int offset = 0;
if (tok->strAt(1) == "static")
offset = 1;
const unsigned int varId(tok->tokAt(2 + offset)->varId());