Some small refactorizations
This commit is contained in:
parent
1a266315f1
commit
ee4a5843bb
|
@ -1355,11 +1355,11 @@ CheckIO::ArgumentInfo::ArgumentInfo(const Token * tok, const Settings *settings,
|
|||
: variableInfo(nullptr)
|
||||
, typeToken(nullptr)
|
||||
, functionInfo(nullptr)
|
||||
, tempToken(nullptr)
|
||||
, element(false)
|
||||
, _template(false)
|
||||
, address(false)
|
||||
, isCPP(_isCPP)
|
||||
, tempToken(nullptr)
|
||||
{
|
||||
if (tok) {
|
||||
if (tok->tokType() == Token::eString) {
|
||||
|
|
|
@ -2373,8 +2373,8 @@ void CheckMemoryLeakInClass::variable(const Scope *scope, const Token *tokVarnam
|
|||
if (Alloc != No && Alloc != alloc)
|
||||
alloc = CheckMemoryLeak::Many;
|
||||
|
||||
std::list<const Token *> callstack;
|
||||
if (alloc != CheckMemoryLeak::Many && Dealloc != CheckMemoryLeak::No && Dealloc != CheckMemoryLeak::Many && Dealloc != alloc) {
|
||||
std::list<const Token *> callstack;
|
||||
callstack.push_back(tok);
|
||||
mismatchAllocDealloc(callstack, classname + "::" + varname);
|
||||
}
|
||||
|
@ -2408,8 +2408,8 @@ void CheckMemoryLeakInClass::variable(const Scope *scope, const Token *tokVarnam
|
|||
if (Dealloc != CheckMemoryLeak::No && Dealloc != dealloc)
|
||||
dealloc = CheckMemoryLeak::Many;
|
||||
|
||||
std::list<const Token *> callstack;
|
||||
if (dealloc != CheckMemoryLeak::Many && Alloc != CheckMemoryLeak::No && Alloc != Many && Alloc != dealloc) {
|
||||
std::list<const Token *> callstack;
|
||||
callstack.push_back(tok);
|
||||
mismatchAllocDealloc(callstack, classname + "::" + varname);
|
||||
}
|
||||
|
|
|
@ -1160,7 +1160,7 @@ bool TemplateSimplifier::simplifyCalculations(Token *_tokens)
|
|||
result = (op1 >= op2) ? "1" : "0";
|
||||
else if (cmp == "<")
|
||||
result = (op1 < op2) ? "1" : "0";
|
||||
else if (cmp == ">")
|
||||
else
|
||||
result = (op1 > op2) ? "1" : "0";
|
||||
|
||||
tok->str(result);
|
||||
|
|
Loading…
Reference in New Issue