Fixed some complaints of PVS Studio
This commit is contained in:
parent
ed7d0b321b
commit
09e03fa6ef
|
@ -149,7 +149,7 @@ bool FileLister::isDirectory(const std::string &path)
|
||||||
|
|
||||||
bool FileLister::fileExists(const std::string &path)
|
bool FileLister::fileExists(const std::string &path)
|
||||||
{
|
{
|
||||||
return (MyFileExists(path) == TRUE);
|
return (MyFileExists(path) != FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -307,7 +307,7 @@ void CheckSizeof::sizeofVoid()
|
||||||
}
|
}
|
||||||
if (isMember) {
|
if (isMember) {
|
||||||
// Get 'struct.member' complete name (without spaces)
|
// Get 'struct.member' complete name (without spaces)
|
||||||
varname = tok2->stringifyList(tok->tokAt(index+1));
|
varname = tok2->stringifyList(tok->next());
|
||||||
varname.erase(remove_if(varname.begin(), varname.end(),
|
varname.erase(remove_if(varname.begin(), varname.end(),
|
||||||
static_cast<int (*)(int)>(std::isspace)), varname.end());
|
static_cast<int (*)(int)>(std::isspace)), varname.end());
|
||||||
}
|
}
|
||||||
|
|
|
@ -879,7 +879,7 @@ static bool valueFlowForLoop1(const Token *tok, unsigned int * const varid, Math
|
||||||
*num1 = *num2;
|
*num1 = *num2;
|
||||||
while (tok && tok->str() != ";")
|
while (tok && tok->str() != ";")
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
if (!num2tok || !Token::Match(tok, "; %varid% ++ ) {", vartok->varId()))
|
if (!Token::Match(tok, "; %varid% ++ ) {", vartok->varId()))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,21 +29,21 @@ class Settings;
|
||||||
namespace ValueFlow {
|
namespace ValueFlow {
|
||||||
class Value {
|
class Value {
|
||||||
public:
|
public:
|
||||||
Value(long long val = 0) : condition(0), intvalue(val), varId(0U), varvalue(val), conditional(false), inconclusive(false) {}
|
Value(long long val = 0) : intvalue(val), varvalue(val), condition(0), varId(0U), conditional(false), inconclusive(false) {}
|
||||||
Value(const Token *c, long long val) : condition(c), intvalue(val), varId(0U), varvalue(val), conditional(false), inconclusive(false) {}
|
Value(const Token *c, long long val) : intvalue(val), varvalue(val), condition(c), varId(0U), conditional(false), inconclusive(false) {}
|
||||||
|
|
||||||
/** Condition that this value depends on (TODO: replace with a 'callstack') */
|
|
||||||
const Token *condition;
|
|
||||||
|
|
||||||
/** int value */
|
/** int value */
|
||||||
long long intvalue;
|
long long intvalue;
|
||||||
|
|
||||||
/** For calculated values - varId that calculated value depends on */
|
|
||||||
unsigned int varId;
|
|
||||||
|
|
||||||
/** For calculated values - variable value that calculated value depends on */
|
/** For calculated values - variable value that calculated value depends on */
|
||||||
long long varvalue;
|
long long varvalue;
|
||||||
|
|
||||||
|
/** Condition that this value depends on (TODO: replace with a 'callstack') */
|
||||||
|
const Token *condition;
|
||||||
|
|
||||||
|
/** For calculated values - varId that calculated value depends on */
|
||||||
|
unsigned int varId;
|
||||||
|
|
||||||
/** Conditional value */
|
/** Conditional value */
|
||||||
bool conditional;
|
bool conditional;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue