Fixed some sign conversion messages from clang.

This commit is contained in:
PKEuS 2012-09-16 16:41:15 +02:00
parent f762b55aa0
commit 547d3e94b2
3 changed files with 4 additions and 4 deletions

View File

@ -1279,7 +1279,7 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable()
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) {
if (Token::Match(tok, "%str% [ %num% ]")) {
std::string str = tok->strValue();
std::size_t index = std::atoi(tok->strAt(2).c_str());
std::size_t index = (std::size_t)std::atoi(tok->strAt(2).c_str());
if (index > str.length()) {
bufferOverrunError(tok, tok->str());
}

View File

@ -377,7 +377,7 @@ bool CheckNullPointer::CanFunctionAssignPointer(const Token *functiontoken, unsi
if (Token::Match(functiontoken, "if|while|for|switch|sizeof|catch"))
return false;
int argumentNumber = 0;
unsigned int argumentNumber = 0;
for (const Token *arg = functiontoken->tokAt(2); arg; arg = arg->nextArgument()) {
if (Token::Match(arg, "%varid% [,)]", varid)) {
const Function* func = _tokenizer->getSymbolDatabase()->findFunctionByName(functiontoken->str(), functiontoken->scope());

View File

@ -128,9 +128,9 @@ std::string Preprocessor::read(std::istream &istr, const std::string &filename)
// The UTF-16 BOM is 0xfffe or 0xfeff.
unsigned int bom = 0;
if (istr.peek() >= 0xfe) {
bom = (istr.get() << 8);
bom = ((unsigned int)istr.get() << 8);
if (istr.peek() >= 0xfe)
bom |= istr.get();
bom |= (unsigned int)istr.get();
}
// ------------------------------------------------------------------------------------------