From 7fb44d1995b6403178c0e45bfcc9ce05b3478cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 6 Aug 2010 18:32:31 +0200 Subject: [PATCH] gcc: fixed some compiler warnings when using -Wsign-conversion --- lib/checkmemoryleak.cpp | 4 ++-- lib/tokenize.cpp | 6 ++++-- lib/tokenize.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 1a1e15afa..df866d463 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -720,8 +720,8 @@ const char * CheckMemoryLeakInFunction::call_func(const Token *tok, std::listprevious()->str() == "."); diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index e61523058..a1061fdfb 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -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()) { + if (ftok->str() == ")") + break; if (ftok->str() == ",") ++_par; if (par == _par && Token::Match(ftok, "%var% [,)]")) diff --git a/lib/tokenize.h b/lib/tokenize.h index 1b3560051..2f463a33a 100644 --- a/lib/tokenize.h +++ b/lib/tokenize.h @@ -92,7 +92,7 @@ public: bool simplifyTokenList(); 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;