gcc: Fixed some compiler warnings when using -Wsign-conversion. Ticket: #1487

This commit is contained in:
Daniel Marjamäki 2010-08-06 19:40:54 +02:00
parent 290d02780f
commit faa713e7b5
2 changed files with 3 additions and 3 deletions

View File

@ -909,7 +909,7 @@ static int doAssignment(Variables &variables, const Token *tok, bool dereference
Token::Match(tok->tokAt(start), "( const| struct|union| %type% *| ) ( &| %var%") || Token::Match(tok->tokAt(start), "( const| struct|union| %type% *| ) ( &| %var%") ||
Token::Match(tok->tokAt(start), "%any% < const| struct|union| %type% *| > ( &| %var%")) Token::Match(tok->tokAt(start), "%any% < const| struct|union| %type% *| > ( &| %var%"))
{ {
unsigned int offset = 0; unsigned char offset = 0;
unsigned int varid2; unsigned int varid2;
bool addressOf = false; bool addressOf = false;
@ -4048,7 +4048,7 @@ void CheckOther::nullPointerError(const Token *tok, const std::string &varname)
reportError(tok, Severity::error, "nullPointer", "Possible null pointer dereference: " + varname); reportError(tok, Severity::error, "nullPointer", "Possible null pointer dereference: " + varname);
} }
void CheckOther::nullPointerError(const Token *tok, const std::string &varname, const int line) void CheckOther::nullPointerError(const Token *tok, const std::string &varname, const unsigned int line)
{ {
reportError(tok, Severity::error, "nullPointer", "Possible null pointer dereference: " + varname + " - otherwise it is redundant to check if " + varname + " is null at line " + MathLib::toString<long>(line)); reportError(tok, Severity::error, "nullPointer", "Possible null pointer dereference: " + varname + " - otherwise it is redundant to check if " + varname + " is null at line " + MathLib::toString<long>(line));
} }

View File

@ -199,7 +199,7 @@ public:
void strPlusChar(const Token *tok); void strPlusChar(const Token *tok);
void nullPointerError(const Token *tok); // variable name unknown / doesn't exist void nullPointerError(const Token *tok); // variable name unknown / doesn't exist
void nullPointerError(const Token *tok, const std::string &varname); void nullPointerError(const Token *tok, const std::string &varname);
void nullPointerError(const Token *tok, const std::string &varname, const int line); void nullPointerError(const Token *tok, const std::string &varname, const unsigned int line);
void uninitstringError(const Token *tok, const std::string &varname); void uninitstringError(const Token *tok, const std::string &varname);
void uninitdataError(const Token *tok, const std::string &varname); void uninitdataError(const Token *tok, const std::string &varname);
void uninitvarError(const Token *tok, const std::string &varname); void uninitvarError(const Token *tok, const std::string &varname);