diff options
| author | 2016-01-30 16:53:38 +0100 | |
|---|---|---|
| committer | 2016-01-30 16:53:38 +0100 | |
| commit | d0382d1e01646c6bc634ed08fe1c9aa009470432 (patch) | |
| tree | 73cd39cc0b7a4874169ba8ce08481a58d56302a6 | |
| parent | 5a134dfc687551f0df25b52a37ad2e4467cd23be (diff) | |
| download | OneRoll-d0382d1e01646c6bc634ed08fe1c9aa009470432.tar.gz OneRoll-d0382d1e01646c6bc634ed08fe1c9aa009470432.zip | |
Cppcheck warning for ifnode.
| -rw-r--r-- | diceparser.cpp | 24 | ||||
| -rw-r--r-- | node/ifnode.cpp | 1 | ||||
| -rw-r--r-- | node/ifnode.h | 1 |
3 files changed, 14 insertions, 12 deletions
diff --git a/diceparser.cpp b/diceparser.cpp index ebd163d..8d96d5a 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -977,23 +977,25 @@ bool DiceParser::readIfInstruction(QString& str,ExecutionNode*& trueNode,Executi { str=str.remove(0,1); ExecutionNode* node; - bool hasExpresion = readExpression(str,node); - if(str.startsWith('}')) + if(readExpression(str,node)) { - trueNode = node; - str=str.remove(0,1); - if(str.startsWith('{')) + if(str.startsWith('}')) { + trueNode = node; str=str.remove(0,1); - ExecutionNode* node2; - readExpression(str,node2); - if(str.startsWith('}')) + if(str.startsWith('{')) { - falseNode=node2; - return true; + str=str.remove(0,1); + ExecutionNode* node2; + readExpression(str,node2); + if(str.startsWith('}')) + { + falseNode=node2; + return true; + } } + return true; } - return true; } } return false; diff --git a/node/ifnode.cpp b/node/ifnode.cpp index 5543a93..864faf1 100644 --- a/node/ifnode.cpp +++ b/node/ifnode.cpp @@ -21,6 +21,7 @@ #include "result/diceresult.h" IfNode::IfNode() + : m_validator(NULL),m_true(NULL),m_false(NULL) { //m_result = new DiceResult(); } diff --git a/node/ifnode.h b/node/ifnode.h index 56b23fa..6f8bbcf 100644 --- a/node/ifnode.h +++ b/node/ifnode.h @@ -44,7 +44,6 @@ protected: ExecutionNode *getLeafNode(ExecutionNode *node); protected: - DiceResult* m_diceResult; Validator* m_validator; ExecutionNode* m_true; |