Some small refactorizations

This commit is contained in:
PKEuS 2015-08-15 19:46:31 +02:00
parent 1a266315f1
commit ee4a5843bb
3 changed files with 4 additions and 4 deletions

View File

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

View File

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

View File

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