Fixed 2 Cppcheck warnings. Function can be static|const
This commit is contained in:
parent
4e2c0617d3
commit
f31ec37d52
|
@ -1760,7 +1760,7 @@ bool CheckClass::isConstMemberFunc(const Scope *scope, const Token *tok) const
|
||||||
return false;
|
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,
|
// if the function doesn't have any assignment nor function call,
|
||||||
// it can be a const function..
|
// it can be a const function..
|
||||||
|
|
|
@ -213,7 +213,7 @@ private:
|
||||||
bool isMemberVar(const Scope *scope, const Token *tok) const;
|
bool isMemberVar(const Scope *scope, const Token *tok) const;
|
||||||
bool isMemberFunc(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 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
|
// constructors helper function
|
||||||
/** @brief Information about a member variable. Used when checking for uninitialized variables */
|
/** @brief Information about a member variable. Used when checking for uninitialized variables */
|
||||||
|
|
|
@ -120,7 +120,7 @@ private:
|
||||||
void invalidPrintfArgTypeError_float(const Token* tok, unsigned int numFormat, const std::string& specifier, const ArgumentInfo* argInfo);
|
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 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 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 {
|
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
|
||||||
CheckIO c(0, settings, errorLogger);
|
CheckIO c(0, settings, errorLogger);
|
||||||
|
|
Loading…
Reference in New Issue