Fixed 2 Cppcheck warnings. Function can be static|const

This commit is contained in:
Daniel Marjamäki 2014-05-10 11:49:14 +02:00
parent 4e2c0617d3
commit f31ec37d52
3 changed files with 3 additions and 3 deletions

View File

@ -1760,7 +1760,7 @@ bool CheckClass::isConstMemberFunc(const Scope *scope, const Token *tok) const
return false;
}
bool CheckClass::checkConstFunc(const Scope *scope, const Function *func, bool& memberAccessed)
bool CheckClass::checkConstFunc(const Scope *scope, const Function *func, bool& memberAccessed) const
{
// if the function doesn't have any assignment nor function call,
// it can be a const function..

View File

@ -213,7 +213,7 @@ private:
bool isMemberVar(const Scope *scope, const Token *tok) const;
bool isMemberFunc(const Scope *scope, const Token *tok) const;
bool isConstMemberFunc(const Scope *scope, const Token *tok) const;
bool checkConstFunc(const Scope *scope, const Function *func, bool& memberAccessed);
bool checkConstFunc(const Scope *scope, const Function *func, bool& memberAccessed) const;
// constructors helper function
/** @brief Information about a member variable. Used when checking for uninitialized variables */

View File

@ -120,7 +120,7 @@ private:
void invalidPrintfArgTypeError_float(const Token* tok, unsigned int numFormat, const std::string& specifier, const ArgumentInfo* argInfo);
void invalidLengthModifierError(const Token* tok, unsigned int numFormat, const std::string& modifier);
void invalidScanfFormatWidthError(const Token* tok, unsigned int numFormat, int width, const Variable *var);
void argumentType(std::ostream & s, const ArgumentInfo * argInfo);
static void argumentType(std::ostream & s, const ArgumentInfo * argInfo);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
CheckIO c(0, settings, errorLogger);