Merge pull request #583 from Dmitry-Me/betterVariableName2
Better variable name
This commit is contained in:
commit
111bcb1b87
|
@ -2027,7 +2027,7 @@ const Token *CheckMemoryLeakInFunction::findleak(const Token *tokens)
|
||||||
|
|
||||||
|
|
||||||
// Check for memory leaks for a function variable.
|
// 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;
|
std::list<const Token *> callstack;
|
||||||
|
|
||||||
|
@ -2036,7 +2036,7 @@ void CheckMemoryLeakInFunction::checkScope(const Token *Tok1, const std::string
|
||||||
|
|
||||||
const Token *result;
|
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());
|
//tok->printOut((std::string("Checkmemoryleak: getcode result for: ") + varname).c_str());
|
||||||
|
|
||||||
const bool use_addr = bool(Token::findsimplematch(tok, "&use") != nullptr);
|
const bool use_addr = bool(Token::findsimplematch(tok, "&use") != nullptr);
|
||||||
|
|
|
@ -288,13 +288,13 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checking the variable varname
|
* Checking the variable varname
|
||||||
* @param Tok1 start token
|
* @param startTok start token
|
||||||
* @param varname name of variable (for error messages)
|
* @param varname name of variable (for error messages)
|
||||||
* @param varid variable id
|
* @param varid variable id
|
||||||
* @param classmember is the scope inside a class member function
|
* @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)"
|
* @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:
|
private:
|
||||||
/** Report all possible errors (for the --errorlist) */
|
/** Report all possible errors (for the --errorlist) */
|
||||||
|
|
Loading…
Reference in New Issue