Merge pull request #583 from Dmitry-Me/betterVariableName2

Better variable name
This commit is contained in:
amai2012 2015-04-02 09:20:24 +02:00
commit 111bcb1b87
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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) */