Better variable name
This commit is contained in:
parent
72b4809da0
commit
aa7d665e7a
|
@ -2027,7 +2027,7 @@ const Token *CheckMemoryLeakInFunction::findleak(const Token *tokens)
|
|||
|
||||
|
||||
// Check for memory leaks for a function variable.
|
||||
void CheckMemoryLeakInFunction::checkScope(const Token *Tok1, const std::string &varname, unsigned int varid, bool classmember, unsigned int sz)
|
||||
void CheckMemoryLeakInFunction::checkScope(const Token *startTok, const std::string &varname, unsigned int varid, bool classmember, unsigned int sz)
|
||||
{
|
||||
std::list<const Token *> callstack;
|
||||
|
||||
|
@ -2036,7 +2036,7 @@ void CheckMemoryLeakInFunction::checkScope(const Token *Tok1, const std::string
|
|||
|
||||
const Token *result;
|
||||
|
||||
Token *tok = getcode(Tok1, callstack, varid, alloctype, dealloctype, classmember, sz);
|
||||
Token *tok = getcode(startTok, callstack, varid, alloctype, dealloctype, classmember, sz);
|
||||
//tok->printOut((std::string("Checkmemoryleak: getcode result for: ") + varname).c_str());
|
||||
|
||||
const bool use_addr = bool(Token::findsimplematch(tok, "&use") != nullptr);
|
||||
|
|
|
@ -288,13 +288,13 @@ public:
|
|||
|
||||
/**
|
||||
* Checking the variable varname
|
||||
* @param Tok1 start token
|
||||
* @param startTok start token
|
||||
* @param varname name of variable (for error messages)
|
||||
* @param varid variable id
|
||||
* @param classmember is the scope inside a class member function
|
||||
* @param sz size of type.. if the variable is a "int *" then sz should be "sizeof(int)"
|
||||
*/
|
||||
void checkScope(const Token *Tok1, const std::string &varname, unsigned int varid, bool classmember, unsigned int sz);
|
||||
void checkScope(const Token *startTok, const std::string &varname, unsigned int varid, bool classmember, unsigned int sz);
|
||||
|
||||
private:
|
||||
/** Report all possible errors (for the --errorlist) */
|
||||
|
|
Loading…
Reference in New Issue