Fixed some "is passed by value" errors from cppcheck source.
This commit is contained in:
parent
a6c809226e
commit
9828117aff
|
@ -275,7 +275,7 @@ CheckMemoryLeak::AllocType CheckMemoryLeak::getDeallocationType(const Token *tok
|
|||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void CheckMemoryLeak::memoryLeak(const Token *tok, const std::string varname, AllocType alloctype, bool all)
|
||||
void CheckMemoryLeak::memoryLeak(const Token *tok, const std::string &varname, AllocType alloctype, bool all)
|
||||
{
|
||||
if (alloctype == CheckMemoryLeak::File ||
|
||||
alloctype == CheckMemoryLeak::Pipe ||
|
||||
|
@ -1662,7 +1662,7 @@ const Token *CheckMemoryLeakInFunction::findleak(const Token *tokens, bool all)
|
|||
|
||||
|
||||
// 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 *Tok1, const std::string &varname, unsigned int varid, bool classmember, unsigned int sz)
|
||||
{
|
||||
std::list<const Token *> callstack;
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
/** What type of allocation are used.. the "Many" means that several types of allocation and deallocation are used */
|
||||
enum AllocType { No, Malloc, gMalloc, New, NewArray, File, Fd, Pipe, Dir, Many };
|
||||
|
||||
void memoryLeak(const Token *tok, const std::string varname, AllocType alloctype, bool all);
|
||||
void memoryLeak(const Token *tok, const std::string &varname, AllocType alloctype, bool all);
|
||||
|
||||
/**
|
||||
* Get type of deallocation at given position
|
||||
|
@ -245,7 +245,7 @@ private:
|
|||
* @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 *Tok1, const std::string &varname, unsigned int varid, bool classmember, unsigned int sz);
|
||||
|
||||
void getErrorMessages()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue