Fixed some cppcheck warnings about methods that can be static/const

This commit is contained in:
Daniel Marjamäki 2015-11-14 18:43:07 +01:00
parent af2ada9258
commit ad0d23036c
5 changed files with 5 additions and 5 deletions

View File

@ -317,7 +317,7 @@ void CheckAutoVariables::errorUselessAssignmentPtrArg(const Token *tok)
//---------------------------------------------------------------------------
// return temporary?
bool CheckAutoVariables::returnTemporary(const Token *tok) const
bool CheckAutoVariables::returnTemporary(const Token *tok)
{
bool func = false; // Might it be a function call?
bool retref = false; // is there such a function that returns a reference?

View File

@ -79,7 +79,7 @@ private:
* @param tok pointing at the "return" token
* @return true if a temporary object is returned
*/
bool returnTemporary(const Token *tok) const;
static bool returnTemporary(const Token *tok);
void errorReturnAddressToAutoVariable(const Token *tok);
void errorReturnPointerToLocalArray(const Token *tok);

View File

@ -62,7 +62,7 @@ private:
static std::map<std::string, std::string> _obsoleteC99Functions;
/** init obsolete functions list ' */
void initObsoleteFunctions() {
static void initObsoleteFunctions() {
// Obsolete posix functions, which messages suggest only one alternative and doesn't contain additional information.
const struct {
const char* bad;

View File

@ -1301,7 +1301,7 @@ SymbolDatabase::~SymbolDatabase()
}
}
bool SymbolDatabase::isFunction(const Token *tok, const Scope* outerScope, const Token **funcStart, const Token **argStart)
bool SymbolDatabase::isFunction(const Token *tok, const Scope* outerScope, const Token **funcStart, const Token **argStart) const
{
if (tok->varId())
return false;

View File

@ -1019,7 +1019,7 @@ private:
Function *addGlobalFunctionDecl(Scope*& scope, const Token* tok, const Token *argStart, const Token* funcStart);
Function *addGlobalFunction(Scope*& scope, const Token*& tok, const Token *argStart, const Token* funcStart);
void addNewFunction(Scope **info, const Token **tok);
bool isFunction(const Token *tok, const Scope* outerScope, const Token **funcStart, const Token **argStart);
bool isFunction(const Token *tok, const Scope* outerScope, const Token **funcStart, const Token **argStart) const;
const Type *findTypeInNested(const Token *tok, const Scope *startScope) const;
const Scope *findNamespace(const Token * tok, const Scope * scope) const;
Function *findFunctionInScope(const Token *func, const Scope *ns);