lib: fix a bunch of warnings about differing function arguments in definition and declaration.

[lib/token.h:72] -> [lib/token.cpp:36]: (style, inconclusive) Function 'Token' argument 1 names different: declaration 'tokensBack' definition 't'.
    [lib/token.h:445] -> [lib/token.cpp:497]: (style, inconclusive) Function 'multiCompare' argument 1 names different: declaration 'needle' definition 'tok'.
    [lib/checkio.h:73] -> [lib/checkio.cpp:1385]: (style, inconclusive) Function 'ArgumentInfo' argument 3 names different: declaration 'isCPP' definition '_isCPP'.
    [lib/checkother.h:216] -> [lib/checkother.cpp:2136]: (style, inconclusive) Function 'checkComparisonFunctionIsAlwaysTrueOrFalseError' argument 2 names different: declaration 'strFunctionName' definition 'functionName'.
    [lib/errorlogger.h:214] -> [lib/errorlogger.cpp:51]: (style, inconclusive) Function 'ErrorMessage' argument 2 names different: declaration 'file0' definition 'file0_'.
    [lib/errorlogger.h:215] -> [lib/errorlogger.cpp:65]: (style, inconclusive) Function 'ErrorMessage' argument 2 names different: declaration 'file0' definition 'file0_'.
    [lib/library.h:327] -> [lib/library.cpp:1043]: (style, inconclusive) Function 'ignorefunction' argument 1 names different: declaration 'function' definition 'functionName'.
    [lib/mathlib.h:112] -> [lib/mathlib.cpp:1275]: (style, inconclusive) Function 'isNullValue' argument 1 names different: declaration 'tok' definition 'str'.
    [lib/preprocessor.h:91] -> [lib/preprocessor.cpp:122]: (style, inconclusive) Function 'setDirectives' argument 1 names different: declaration 'tokens' definition 'tokens1'.
    [lib/symboldatabase.h:860] -> [lib/symboldatabase.cpp:1801]: (style, inconclusive) Function 'argsMatch' argument 1 names different: declaration 'info' definition 'scope'.
    [lib/symboldatabase.h:1171] -> [lib/symboldatabase.cpp:2048]: (style, inconclusive) Function 'addClassFunction' argument 1 names different: declaration 'info' definition 'scope'.
    [lib/symboldatabase.h:1174] -> [lib/symboldatabase.cpp:2208]: (style, inconclusive) Function 'addNewFunction' argument 1 names different: declaration 'info' definition 'scope'.
    [lib/symboldatabase.h:1090] -> [lib/symboldatabase.cpp:3648]: (style, inconclusive) Function 'findVariableType' argument 2 names different: declaration 'type' definition 'typeTok'.
    [lib/symboldatabase.h:1101] -> [lib/symboldatabase.cpp:4308]: (style, inconclusive) Function 'findType' argument 1 names different: declaration 'tok' definition 'startTok'.
    [lib/symboldatabase.h:1176] -> [lib/symboldatabase.cpp:4349]: (style, inconclusive) Function 'findTypeInNested' argument 1 names different: declaration 'tok' definition 'startTok'.
    [lib/symboldatabase.h:1193] -> [lib/symboldatabase.cpp:4501]: (style, inconclusive) Function 'setValueType' argument 2 names different: declaration 'enumerators' definition 'enumerator'.
    [lib/path.h:159] -> [lib/path.cpp:247]: (style, inconclusive) Function 'isCPP' argument 1 names different: declaration 'extensionInLowerCase' definition 'path'.
    [lib/path.h:145] -> [lib/path.cpp:266]: (style, inconclusive) Function 'acceptFile' argument 1 names different: declaration 'filename' definition 'path'.
This commit is contained in:
Matthias Krüger 2017-04-03 00:06:46 +02:00
parent abb43b6a81
commit 79010eecea
11 changed files with 25 additions and 25 deletions

View File

@ -70,7 +70,7 @@ public:
private:
class ArgumentInfo {
public:
ArgumentInfo(const Token *arg, const Settings *settings, bool isCPP);
ArgumentInfo(const Token *arg, const Settings *settings, bool _isCPP);
~ArgumentInfo();
bool isArrayOrPointer() const;

View File

@ -213,7 +213,7 @@ public:
private:
// Error messages..
void checkComparisonFunctionIsAlwaysTrueOrFalseError(const Token* tok, const std::string &strFunctionName, const std::string &varName, const bool result);
void checkComparisonFunctionIsAlwaysTrueOrFalseError(const Token* tok, const std::string &functionName, const std::string &varName, const bool result);
void checkCastIntToCharAndBackError(const Token *tok, const std::string &strFunctionName);
void checkPipeParameterSizeError(const Token *tok, const std::string &strVarName, const std::string &strDim);
void clarifyCalculationError(const Token *tok, const std::string &op);

View File

@ -48,10 +48,10 @@ ErrorLogger::ErrorMessage::ErrorMessage()
{
}
ErrorLogger::ErrorMessage::ErrorMessage(const std::list<FileLocation> &callStack, const std::string& file0_, Severity::SeverityType severity, const std::string &msg, const std::string &id, bool inconclusive) :
ErrorLogger::ErrorMessage::ErrorMessage(const std::list<FileLocation> &callStack, const std::string& file1, Severity::SeverityType severity, const std::string &msg, const std::string &id, bool inconclusive) :
_callStack(callStack), // locations for this error message
_id(id), // set the message id
file0(file0_),
file0(file1),
_severity(severity), // severity for this error message
_cwe(0U),
_inconclusive(inconclusive)
@ -62,10 +62,10 @@ ErrorLogger::ErrorMessage::ErrorMessage(const std::list<FileLocation> &callStack
ErrorLogger::ErrorMessage::ErrorMessage(const std::list<FileLocation> &callStack, const std::string& file0_, Severity::SeverityType severity, const std::string &msg, const std::string &id, const CWE &cwe, bool inconclusive) :
ErrorLogger::ErrorMessage::ErrorMessage(const std::list<FileLocation> &callStack, const std::string& file1, Severity::SeverityType severity, const std::string &msg, const std::string &id, const CWE &cwe, bool inconclusive) :
_callStack(callStack), // locations for this error message
_id(id), // set the message id
file0(file0_),
file0(file1),
_severity(severity), // severity for this error message
_cwe(cwe.id),
_inconclusive(inconclusive)

View File

@ -211,8 +211,8 @@ public:
std::string _file;
};
ErrorMessage(const std::list<FileLocation> &callStack, const std::string& file0, Severity::SeverityType severity, const std::string &msg, const std::string &id, bool inconclusive);
ErrorMessage(const std::list<FileLocation> &callStack, const std::string& file0, Severity::SeverityType severity, const std::string &msg, const std::string &id, const CWE &cwe, bool inconclusive);
ErrorMessage(const std::list<FileLocation> &callStack, const std::string& file1, Severity::SeverityType severity, const std::string &msg, const std::string &id, bool inconclusive);
ErrorMessage(const std::list<FileLocation> &callStack, const std::string& file1, Severity::SeverityType severity, const std::string &msg, const std::string &id, const CWE &cwe, bool inconclusive);
ErrorMessage(const std::list<const Token*>& callstack, const TokenList* list, Severity::SeverityType severity, const std::string& id, const std::string& msg, bool inconclusive);
ErrorMessage(const std::list<const Token*>& callstack, const TokenList* list, Severity::SeverityType severity, const std::string& id, const std::string& msg, const CWE &cwe, bool inconclusive);
ErrorMessage();

View File

@ -324,7 +324,7 @@ public:
bool reportErrors(const std::string &path) const;
bool ignorefunction(const std::string &function) const;
bool ignorefunction(const std::string &functionName) const;
bool isexecutableblock(const std::string &file, const std::string &token) const;

View File

@ -109,7 +109,7 @@ public:
static bool isGreaterEqual(const std::string & first, const std::string & second);
static bool isLess(const std::string & first, const std::string & second);
static bool isLessEqual(const std::string & first, const std::string & second);
static bool isNullValue(const std::string &tok);
static bool isNullValue(const std::string & str);
/**
* Return true if given character is 0,1,2,3,4,5,6 or 7.
* @param[in] c The character to check

View File

@ -142,7 +142,7 @@ public:
* @param extra extra file extensions
* @return true if the file extension indicates it should be checked
*/
static bool acceptFile(const std::string &filename, const std::set<std::string> &extra);
static bool acceptFile(const std::string &path, const std::set<std::string> &extra);
/**
* @brief Identify language based on file extension.
@ -156,7 +156,7 @@ public:
* @param extensionInLowerCase filename to check. path info is optional
* @return true if extension is meant for C++ files
*/
static bool isCPP(const std::string &extensionInLowerCase);
static bool isCPP(const std::string &path);
/**
* @brief Is filename a header based on file extension

View File

@ -119,14 +119,14 @@ void Preprocessor::inlineSuppressions(const simplecpp::TokenList &tokens)
}
}
void Preprocessor::setDirectives(const simplecpp::TokenList &tokens1)
void Preprocessor::setDirectives(const simplecpp::TokenList &tokens)
{
// directive list..
directives.clear();
std::vector<const simplecpp::TokenList *> list;
list.reserve(1U + tokenlists.size());
list.push_back(&tokens1);
list.push_back(&tokens);
for (std::map<std::string, simplecpp::TokenList *>::const_iterator it = tokenlists.begin(); it != tokenlists.end(); ++it) {
list.push_back(it->second);
}

View File

@ -857,7 +857,7 @@ public:
const Token *noexceptArg;
const Token *throwArg;
static bool argsMatch(const Scope *info, const Token *first, const Token *second, const std::string &path, unsigned int depth);
static bool argsMatch(const Scope *scope, const Token *first, const Token *second, const std::string &path, unsigned int depth);
/**
* @return token to ":" if the function is a constructor
@ -1087,7 +1087,7 @@ public:
* @param type token containing variable type
* @return pointer to type if found or NULL if not found
*/
const Type *findVariableType(const Scope *start, const Token *type) const;
const Type *findVariableType(const Scope *start, const Token *typeTok) const;
/**
* @brief find a function
@ -1098,7 +1098,7 @@ public:
const Scope *findScopeByName(const std::string& name) const;
const Type* findType(const Token *tok, const Scope *startScope) const;
const Type* findType(const Token *startTok, const Scope *startScope) const;
Type* findType(const Token *tok, Scope *startScope) const {
return const_cast<Type*>(this->findType(tok, const_cast<const Scope *>(startScope)));
}
@ -1168,12 +1168,12 @@ private:
void createSymbolDatabaseEnums();
void createSymbolDatabaseUnknownArrayDimensions();
void addClassFunction(Scope **info, const Token **tok, const Token *argStart);
void addClassFunction(Scope **scope, const Token **tok, const Token *argStart);
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);
void addNewFunction(Scope **scope, const Token **tok);
bool isFunction(const Token *tok, const Scope* outerScope, const Token **funcStart, const Token **argStart, const Token** declEnd) const;
const Type *findTypeInNested(const Token *tok, const Scope *startScope) const;
const Type *findTypeInNested(const Token *startTok, const Scope *startScope) const;
const Scope *findNamespace(const Token * tok, const Scope * scope) const;
Function *findFunctionInScope(const Token *func, const Scope *ns);
const Type *findVariableTypeInBase(const Scope *scope, const Token *typeTok) const;
@ -1190,7 +1190,7 @@ private:
void setValueType(Token *tok, const ValueType &valuetype);
void setValueType(Token *tok, const Variable &var);
void setValueType(Token *tok, const Enumerator &enumerators);
void setValueType(Token *tok, const Enumerator &enumerator);
const Tokenizer *_tokenizer;
const Settings *_settings;

View File

@ -33,8 +33,8 @@
#include <algorithm>
Token::Token(Token **t) :
tokensBack(t),
Token::Token(Token **tokens) :
tokensBack(tokens),
_next(0),
_previous(0),
_link(0),

View File

@ -69,7 +69,7 @@ public:
eNone
};
explicit Token(Token **tokensBack);
explicit Token(Token **tokens);
~Token();
template<typename T>
@ -442,7 +442,7 @@ public:
* 0 if needle was empty string
* -1 if needle was not found
*/
static int multiCompare(const Token *needle, const char *haystack, unsigned int varid);
static int multiCompare(const Token *tok, const char *haystack, unsigned int varid);
unsigned int linenr() const {
return _linenr;