gcc: fixed some compiler warnings when using -Wsign-conversion

This commit is contained in:
Daniel Marjamäki 2010-08-06 18:32:31 +02:00
parent 6346e1aa90
commit 7fb44d1995
3 changed files with 7 additions and 5 deletions

View File

@ -720,8 +720,8 @@ const char * CheckMemoryLeakInFunction::call_func(const Token *tok, std::list<co
if (numpar <= 0) if (numpar <= 0)
return "callfunc"; return "callfunc";
int par = 1; unsigned int par = 1;
int parlevel = 0; unsigned int parlevel = 0;
const bool dot(tok->previous()->str() == "."); const bool dot(tok->previous()->str() == ".");

View File

@ -6807,11 +6807,13 @@ void Tokenizer::deleteTokens(Token *tok)
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
const char *Tokenizer::getParameterName(const Token *ftok, int par) const char *Tokenizer::getParameterName(const Token *ftok, unsigned int par)
{ {
int _par = 1; unsigned int _par = 1;
for (; ftok; ftok = ftok->next()) for (; ftok; ftok = ftok->next())
{ {
if (ftok->str() == ")")
break;
if (ftok->str() == ",") if (ftok->str() == ",")
++_par; ++_par;
if (par == _par && Token::Match(ftok, "%var% [,)]")) if (par == _par && Token::Match(ftok, "%var% [,)]"))

View File

@ -92,7 +92,7 @@ public:
bool simplifyTokenList(); bool simplifyTokenList();
static void deleteTokens(Token *tok); static void deleteTokens(Token *tok);
static const char *getParameterName(const Token *ftok, int par); static const char *getParameterName(const Token *ftok, unsigned int par);
std::string fileLine(const Token *tok) const; std::string fileLine(const Token *tok) const;