diff options
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/analysis.cpp | 2 | ||||
-rw-r--r-- | src/analysis/declaration.cpp | 2 | ||||
-rw-r--r-- | src/analysis/expression.cpp | 28 | ||||
-rw-r--r-- | src/analysis/function.cpp | 6 | ||||
-rw-r--r-- | src/analysis/ref.cpp | 2 | ||||
-rw-r--r-- | src/analysis/statement.cpp | 2 |
6 files changed, 21 insertions, 21 deletions
diff --git a/src/analysis/analysis.cpp b/src/analysis/analysis.cpp index 490bb66..80d34d4 100644 --- a/src/analysis/analysis.cpp +++ b/src/analysis/analysis.cpp @@ -362,7 +362,7 @@ void analyseNode(Node *node, const WalkItem &wi, WalkItem &wo) if (!node) return; - if (command == Command::DumpNullPointers) + if (checkCommand(DumpNullPointers)) { Log::log("%s %s: ", node->nodeTypeName.c_str(), diff --git a/src/analysis/declaration.cpp b/src/analysis/declaration.cpp index aaea8a2..88b74bf 100644 --- a/src/analysis/declaration.cpp +++ b/src/analysis/declaration.cpp @@ -39,7 +39,7 @@ void analyseVarDecl(VarDeclNode *node A_UNUSED, WalkItem &wo A_UNUSED) { // need atleast one arg for check - if (command == FindArgs) + if (checkCommand(FindArgs)) return; // reportParmDeclNullPointer(node, node->initial, wi); diff --git a/src/analysis/expression.cpp b/src/analysis/expression.cpp index e907792..20bc821 100644 --- a/src/analysis/expression.cpp +++ b/src/analysis/expression.cpp @@ -106,7 +106,7 @@ std::string getComponentRefVariable(Node *node) void analyseModifyExpr(ModifyExprNode *node, const WalkItem &wi, WalkItem &wo) { // need atleast one arg for check - if (node->args.empty() || command == FindArgs) + if (node->args.empty() || checkCommand(FindArgs)) return; Node *arg = skipNop(node->args[0]); @@ -139,7 +139,7 @@ void analysePointerPlusExpr(PointerPlusExprNode *node, WalkItem &wo A_UNUSED) { // need atleast one arg for check - if (node->args.empty() || command == FindArgs) + if (node->args.empty() || checkCommand(FindArgs)) return; reportParmDeclNullPointer(node, node->args[0], wi); @@ -150,7 +150,7 @@ void analyseAddrExpr(AddrExprNode *node, WalkItem &wo A_UNUSED) { // need atleast one arg for check - if (node->args.empty() || command == FindArgs) + if (node->args.empty() || checkCommand(FindArgs)) return; // do not report code like func1(ptr) or push_back(ptr) @@ -181,7 +181,7 @@ void analyseReturnExpr(ReturnExprNode *node A_UNUSED, void analyseNeExpr(NeExprNode *node, const WalkItem &wi, WalkItem &wo) { // need two args for check - if (node->args.size() < 2 || command == FindArgs) + if (node->args.size() < 2 || checkCommand(FindArgs)) return; // PARM_DECL or VAR_DECL? @@ -210,7 +210,7 @@ void analyseNeExpr(NeExprNode *node, const WalkItem &wi, WalkItem &wo) void analyseEqExpr(EqExprNode *node, const WalkItem &wi, WalkItem &wo) { // need two args for check - if (node->args.size() < 2 || command == FindArgs) + if (node->args.size() < 2 || checkCommand(FindArgs)) return; // PARM_DECL or VAR_DECL ? @@ -297,7 +297,7 @@ void analyseAndCondition(Node *node, Node *node1, Node *node2, const WalkItem &w void analyseTruthOrIfExpr(TruthOrIfExprNode *node, const WalkItem &wi, WalkItem &wo) { // need two args for check - if (node->args.size() < 2 || command == FindArgs) + if (node->args.size() < 2 || checkCommand(FindArgs)) return; analyseOrCondition(node, node->args[0], node->args[1], wi, wo); @@ -306,7 +306,7 @@ void analyseTruthOrIfExpr(TruthOrIfExprNode *node, const WalkItem &wi, WalkItem void analyseTruthOrExpr(TruthOrExprNode *node, const WalkItem &wi, WalkItem &wo) { // need two args for check - if (node->args.size() < 2 || command == FindArgs) + if (node->args.size() < 2 || checkCommand(FindArgs)) return; analyseOrCondition(node, node->args[0], node->args[1], wi, wo); @@ -315,7 +315,7 @@ void analyseTruthOrExpr(TruthOrExprNode *node, const WalkItem &wi, WalkItem &wo) void analyseTruthAndIfExpr(TruthAndIfExprNode *node, const WalkItem &wi, WalkItem &wo) { // need two args for check - if (node->args.size() < 2 || command == FindArgs) + if (node->args.size() < 2 || checkCommand(FindArgs)) return; analyseAndCondition(node, node->args[0], node->args[1], wi, wo); @@ -324,7 +324,7 @@ void analyseTruthAndIfExpr(TruthAndIfExprNode *node, const WalkItem &wi, WalkIte void analyseTruthAndExpr(TruthAndExprNode *node, const WalkItem &wi, WalkItem &wo) { // need two args for check - if (node->args.size() < 2 || command == FindArgs) + if (node->args.size() < 2 || checkCommand(FindArgs)) return; analyseAndCondition(node, node->args[0], node->args[1], wi, wo); @@ -336,7 +336,7 @@ void analyseTruthAndExpr(TruthAndExprNode *node, const WalkItem &wi, WalkItem &w void analyseCondExpr(CondExprNode *node, const WalkItem &wi, WalkItem &wo) { // need tree args for check - if (node->args.size() < 3 || command == FindArgs) + if (node->args.size() < 3 || checkCommand(FindArgs)) return; analyseCondition(node, @@ -351,7 +351,7 @@ void analyseCondExpr(CondExprNode *node, const WalkItem &wi, WalkItem &wo) void analyseCompoundExpr(CompoundExprNode *node, const WalkItem &wi, WalkItem &wo) { // need one arg for check - if (node->args.size() < 1 || command == FindArgs) + if (node->args.size() < 1 || checkCommand(FindArgs)) return; const size_t sz = node->args.size(); @@ -384,7 +384,7 @@ void analyseCompoundExpr(CompoundExprNode *node, const WalkItem &wi, WalkItem &w void analyseBindExpr(BindExprNode *node, const WalkItem &wi, WalkItem &wo) { const size_t sz = node->args.size(); - if (sz < 1 || command == FindArgs) + if (sz < 1 || checkCommand(FindArgs)) return; WalkItem wi2 = wi; @@ -417,7 +417,7 @@ void analyseBindExpr(BindExprNode *node, const WalkItem &wi, WalkItem &wo) void analyseDeclExpr(DeclExprNode *node, const WalkItem &wi, WalkItem &wo) { // need one arg for check - if (node->args.empty() || command == FindArgs) + if (node->args.empty() || checkCommand(FindArgs)) return; Node *node1 = skipNop(node->args[0]); @@ -559,7 +559,7 @@ void analyseInitExpr(InitExprNode* node, WalkItem &wo) { // need one arg for check - if (node->args.size() < 2 || command == FindArgs) + if (node->args.size() < 2 || checkCommand(FindArgs)) return; // var1 = var2 diff --git a/src/analysis/function.cpp b/src/analysis/function.cpp index ff0f186..df6d733 100644 --- a/src/analysis/function.cpp +++ b/src/analysis/function.cpp @@ -103,7 +103,7 @@ void getPossibleNullParameters(FunctionDeclNode *node, WalkItem &wi) getFunctionArgTypes(node, types); getFunctionParamsNonNullAttributes(node, nonNull); - if (command == Command::FindArgs) + if (checkCommand(FindArgs)) Log::log("%s: ", node->label.c_str()); size_t sz = node->args.size(); @@ -119,7 +119,7 @@ void getPossibleNullParameters(FunctionDeclNode *node, WalkItem &wi) continue; if (nonNull.find(f + 1) == nonNull.end()) { - if (command == Command::FindArgs) + if (checkCommand(FindArgs)) { Log::log("%s %s, ", type->nodeTypeName.c_str(), @@ -128,7 +128,7 @@ void getPossibleNullParameters(FunctionDeclNode *node, WalkItem &wi) wi.checkNullVars.insert(name->label); } } - if (command == Command::FindArgs) + if (checkCommand(FindArgs)) Log::log("\n"); } diff --git a/src/analysis/ref.cpp b/src/analysis/ref.cpp index 27de78c..2a1aa54 100644 --- a/src/analysis/ref.cpp +++ b/src/analysis/ref.cpp @@ -44,7 +44,7 @@ void analyseComponentRef(ComponentRefNode *node, WalkItem &wo A_UNUSED) { // need atleast one arg for check - if (!node->object || command == FindArgs) + if (!node->object || checkCommand(FindArgs)) return; Node *arg = skipNop(node->object); diff --git a/src/analysis/statement.cpp b/src/analysis/statement.cpp index cdfcc2a..1bedd7f 100644 --- a/src/analysis/statement.cpp +++ b/src/analysis/statement.cpp @@ -135,7 +135,7 @@ void analyseCondition(Node *node, void analyseIfStmt(IfStmtNode *node, const WalkItem &wi, WalkItem &wo) { // need condition node - if (!node->condition || command == FindArgs) + if (!node->condition || checkCommand(FindArgs)) return; analyseCondition(node, |