Fixed various Cppcheck inconclusive warnings

This commit is contained in:
Alexander Mai 2013-07-30 12:52:27 +02:00 committed by Daniel Marjamäki
parent 807204e580
commit 7a324cef25
7 changed files with 10 additions and 10 deletions

View File

@ -209,7 +209,7 @@ CheckMemoryLeak::AllocType CheckMemoryLeak::getAllocationType(const Token *tok2,
}
CheckMemoryLeak::AllocType CheckMemoryLeak::getReallocationType(const Token *tok2, unsigned int varid) const
CheckMemoryLeak::AllocType CheckMemoryLeak::getReallocationType(const Token *tok2, unsigned int varid)
{
// What we may have...
// * var = (char *)realloc(..;

View File

@ -121,7 +121,7 @@ public:
/**
* @brief Get type of reallocation at given position
*/
AllocType getReallocationType(const Token *tok2, unsigned int varid) const;
static AllocType getReallocationType(const Token *tok2, unsigned int varid);
/**
* @brief Is a typename the name of a class?

View File

@ -157,7 +157,7 @@ private:
/**
* @brief Removes any variable that may be assigned from pointerArgs.
*/
void removeAssignedVarFromSet(const Token* tok, std::set<unsigned int>& pointerArgs);
static void removeAssignedVarFromSet(const Token* tok, std::set<unsigned int>& pointerArgs);
/**
* @brief Investigate if function call can make pointer null. If

View File

@ -363,7 +363,7 @@ private:
* @param tok2 start token of rhs
* @param checks the execution paths
*/
void parserhs(const Token *tok2, std::list<ExecutionPath *> &checks) const {
static void parserhs(const Token *tok2, std::list<ExecutionPath *> &checks) {
// check variable usages in rhs/index
while (NULL != (tok2 = tok2->next())) {
if (Token::Match(tok2, "[;)=]"))
@ -1690,7 +1690,7 @@ bool CheckUninitVar::isVariableUsage(const Token *vartok, bool pointer, bool cpp
return false;
}
bool CheckUninitVar::isMemberVariableAssignment(const Token *tok, const std::string &membervar) const
bool CheckUninitVar::isMemberVariableAssignment(const Token *tok, const std::string &membervar)
{
if (Token::Match(tok, "%var% . %var%") && tok->strAt(2) == membervar) {
if (Token::Match(tok->tokAt(3), "[=.[]"))

View File

@ -62,7 +62,7 @@ public:
bool checkLoopBody(const Token *tok, const Variable& var, const std::string &membervar, const bool suppressErrors);
void checkRhs(const Token *tok, const Variable &var, const std::string &membervar);
static bool isVariableUsage(const Token *vartok, bool ispointer, bool cpp);
bool isMemberVariableAssignment(const Token *tok, const std::string &membervar) const;
static bool isMemberVariableAssignment(const Token *tok, const std::string &membervar);
bool isMemberVariableUsage(const Token *tok, bool isPointer, const std::string &membervar) const;
/**

View File

@ -58,9 +58,9 @@ private:
/**
* Dummy implementation, just to provide error for --errorlist
*/
void unusedFunctionError(ErrorLogger * const errorLogger,
const std::string &filename, unsigned int lineNumber,
const std::string &funcname);
static void unusedFunctionError(ErrorLogger * const errorLogger,
const std::string &filename, unsigned int lineNumber,
const std::string &funcname);
/**
* Dummy implementation, just to provide error for --errorlist

View File

@ -133,7 +133,7 @@ private:
return NULL;
}
int getid(const std::map<std::string,int> &data, const std::string &name) const {
static int getid(const std::map<std::string,int> &data, const std::string &name) {
const std::map<std::string,int>::const_iterator it = data.find(name);
return (it == data.end()) ? 0 : it->second;
}