Fixed some cppcheck warnings about methods that can be static/const
This commit is contained in:
parent
af2ada9258
commit
ad0d23036c
|
@ -317,7 +317,7 @@ void CheckAutoVariables::errorUselessAssignmentPtrArg(const Token *tok)
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
// return temporary?
|
// 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 func = false; // Might it be a function call?
|
||||||
bool retref = false; // is there such a function that returns a reference?
|
bool retref = false; // is there such a function that returns a reference?
|
||||||
|
|
|
@ -79,7 +79,7 @@ private:
|
||||||
* @param tok pointing at the "return" token
|
* @param tok pointing at the "return" token
|
||||||
* @return true if a temporary object is returned
|
* @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 errorReturnAddressToAutoVariable(const Token *tok);
|
||||||
void errorReturnPointerToLocalArray(const Token *tok);
|
void errorReturnPointerToLocalArray(const Token *tok);
|
||||||
|
|
|
@ -62,7 +62,7 @@ private:
|
||||||
static std::map<std::string, std::string> _obsoleteC99Functions;
|
static std::map<std::string, std::string> _obsoleteC99Functions;
|
||||||
|
|
||||||
/** init obsolete functions list ' */
|
/** init obsolete functions list ' */
|
||||||
void initObsoleteFunctions() {
|
static void initObsoleteFunctions() {
|
||||||
// Obsolete posix functions, which messages suggest only one alternative and doesn't contain additional information.
|
// Obsolete posix functions, which messages suggest only one alternative and doesn't contain additional information.
|
||||||
const struct {
|
const struct {
|
||||||
const char* bad;
|
const char* bad;
|
||||||
|
|
|
@ -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())
|
if (tok->varId())
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1019,7 +1019,7 @@ private:
|
||||||
Function *addGlobalFunctionDecl(Scope*& scope, const Token* tok, const Token *argStart, const Token* funcStart);
|
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);
|
Function *addGlobalFunction(Scope*& scope, const Token*& tok, const Token *argStart, const Token* funcStart);
|
||||||
void addNewFunction(Scope **info, const Token **tok);
|
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 Type *findTypeInNested(const Token *tok, const Scope *startScope) const;
|
||||||
const Scope *findNamespace(const Token * tok, const Scope * scope) const;
|
const Scope *findNamespace(const Token * tok, const Scope * scope) const;
|
||||||
Function *findFunctionInScope(const Token *func, const Scope *ns);
|
Function *findFunctionInScope(const Token *func, const Scope *ns);
|
||||||
|
|
Loading…
Reference in New Issue