diff --git a/cli/filelister.cpp b/cli/filelister.cpp index ab7e52777..481359695 100644 --- a/cli/filelister.cpp +++ b/cli/filelister.cpp @@ -149,7 +149,7 @@ bool FileLister::isDirectory(const std::string &path) bool FileLister::fileExists(const std::string &path) { - return (MyFileExists(path) == TRUE); + return (MyFileExists(path) != FALSE); } diff --git a/lib/checksizeof.cpp b/lib/checksizeof.cpp index fa7d35c60..4427b19ae 100644 --- a/lib/checksizeof.cpp +++ b/lib/checksizeof.cpp @@ -307,7 +307,7 @@ void CheckSizeof::sizeofVoid() } if (isMember) { // 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(), static_cast(std::isspace)), varname.end()); } diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 1f66c6cbf..3366ea366 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -879,7 +879,7 @@ static bool valueFlowForLoop1(const Token *tok, unsigned int * const varid, Math *num1 = *num2; while (tok && tok->str() != ";") tok = tok->next(); - if (!num2tok || !Token::Match(tok, "; %varid% ++ ) {", vartok->varId())) + if (!Token::Match(tok, "; %varid% ++ ) {", vartok->varId())) return false; return true; } diff --git a/lib/valueflow.h b/lib/valueflow.h index 259211afc..b3ddbe793 100644 --- a/lib/valueflow.h +++ b/lib/valueflow.h @@ -29,21 +29,21 @@ class Settings; namespace ValueFlow { class Value { public: - Value(long long val = 0) : condition(0), intvalue(val), varId(0U), varvalue(val), conditional(false), inconclusive(false) {} - Value(const Token *c, long long val) : condition(c), intvalue(val), varId(0U), varvalue(val), conditional(false), inconclusive(false) {} - - /** Condition that this value depends on (TODO: replace with a 'callstack') */ - const Token *condition; + Value(long long val = 0) : intvalue(val), varvalue(val), condition(0), varId(0U), conditional(false), inconclusive(false) {} + Value(const Token *c, long long val) : intvalue(val), varvalue(val), condition(c), varId(0U), conditional(false), inconclusive(false) {} /** int value */ 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 */ 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 */ bool conditional;