Replace 'unsigned' with 'nonneg' in checkfunctions

This commit is contained in:
Daniel Marjamäki 2019-07-16 08:49:02 +02:00
parent a038ba7dce
commit c57d3e069a
2 changed files with 5 additions and 5 deletions

View File

@ -105,7 +105,7 @@ void CheckFunctions::invalidFunctionUsage()
continue;
const Token * const functionToken = tok;
const std::vector<const Token *> arguments = getArguments(tok);
for (unsigned int argnr = 1; argnr <= arguments.size(); ++argnr) {
for (int argnr = 1; argnr <= arguments.size(); ++argnr) {
const Token * const argtok = arguments[argnr-1];
// check <valid>...</valid>
@ -178,7 +178,7 @@ void CheckFunctions::invalidFunctionArgBoolError(const Token *tok, const std::st
reportError(tok, Severity::error, "invalidFunctionArgBool", errmsg.str(), CWE628, false);
}
void CheckFunctions::invalidFunctionArgStrError(const Token *tok, const std::string &functionName, unsigned int argnr)
void CheckFunctions::invalidFunctionArgStrError(const Token *tok, const std::string &functionName, nonneg int argnr)
{
std::ostringstream errmsg;
errmsg << "$symbol:" << functionName << '\n';
@ -289,7 +289,7 @@ void CheckFunctions::checkMathFunctions()
}
}
void CheckFunctions::mathfunctionCallWarning(const Token *tok, const unsigned int numParam)
void CheckFunctions::mathfunctionCallWarning(const Token *tok, const nonneg int numParam)
{
if (tok) {
if (numParam == 1)

View File

@ -105,9 +105,9 @@ public:
private:
void invalidFunctionArgError(const Token *tok, const std::string &functionName, int argnr, const ValueFlow::Value *invalidValue, const std::string &validstr);
void invalidFunctionArgBoolError(const Token *tok, const std::string &functionName, int argnr);
void invalidFunctionArgStrError(const Token *tok, const std::string &functionName, unsigned int argnr);
void invalidFunctionArgStrError(const Token *tok, const std::string &functionName, nonneg int argnr);
void ignoredReturnValueError(const Token* tok, const std::string& function);
void mathfunctionCallWarning(const Token *tok, const unsigned int numParam = 1);
void mathfunctionCallWarning(const Token *tok, const nonneg int numParam = 1);
void mathfunctionCallWarning(const Token *tok, const std::string& oldexp, const std::string& newexp);
void memsetZeroBytesError(const Token *tok);
void memsetFloatError(const Token *tok, const std::string &var_value);