aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2015-08-28 08:35:33 +0200
committerRenaud G <renaud@rolisteam.org>2015-08-28 08:35:33 +0200
commitda1db7bc2436f94ab288d8da8d98a8209d3d2caa (patch)
tree36ef8347fd70144dbd8bbef7d41365a8c31f1a06 /node
parent41b9202ef9102cb94e5b3fdcf8ce760509abaa49 (diff)
downloadOneRoll-da1db7bc2436f94ab288d8da8d98a8209d3d2caa.tar.gz
OneRoll-da1db7bc2436f94ab288d8da8d98a8209d3d2caa.zip
fix cppcheck issue
Diffstat (limited to 'node')
-rw-r--r--node/keepdiceexecnode.cpp4
-rw-r--r--node/parenthesesnode.cpp1
-rw-r--r--node/scalaroperatornode.cpp2
-rw-r--r--node/sortresult.cpp7
4 files changed, 4 insertions, 10 deletions
diff --git a/node/keepdiceexecnode.cpp b/node/keepdiceexecnode.cpp
index a225ac4..a230107 100644
--- a/node/keepdiceexecnode.cpp
+++ b/node/keepdiceexecnode.cpp
@@ -42,10 +42,8 @@ m_previousNode = previous;
if(NULL!=previousDiceResult)
{
QList<Die*> diceList=previousDiceResult->getResultList();
- QList<Die*> diceList2=m_diceResult->getResultList();
+ QList<Die*> diceList2 = diceList.mid(0,m_numberOfDice);
-
- diceList2 = diceList.mid(0,m_numberOfDice);
foreach(Die* tmp,diceList.mid(m_numberOfDice,-1))
{
tmp->setHighlighted(false);
diff --git a/node/parenthesesnode.cpp b/node/parenthesesnode.cpp
index 2876147..f81fc1c 100644
--- a/node/parenthesesnode.cpp
+++ b/node/parenthesesnode.cpp
@@ -22,6 +22,7 @@
#include "parenthesesnode.h"
ParenthesesNode::ParenthesesNode()
+ : m_internalNode(NULL)
{
}
diff --git a/node/scalaroperatornode.cpp b/node/scalaroperatornode.cpp
index c5f91f9..d532df0 100644
--- a/node/scalaroperatornode.cpp
+++ b/node/scalaroperatornode.cpp
@@ -26,7 +26,7 @@
ScalarOperatorNode::ScalarOperatorNode()
- : m_internalNode(NULL),m_scalarResult(new ScalarResult())
+ : m_internalNode(NULL),m_scalarResult(new ScalarResult()),m_operator(PLUS)
{
m_scalarOperationList.insert('+',PLUS);
m_scalarOperationList.insert('-',MINUS);
diff --git a/node/sortresult.cpp b/node/sortresult.cpp
index 44a25f0..421beb3 100644
--- a/node/sortresult.cpp
+++ b/node/sortresult.cpp
@@ -54,14 +54,11 @@ void SortResultNode::run(ExecutionNode* node)
bool found = false;
int start = 0;
int end = diceList2.size();
- int distance = 0;
Die* tmp2 = NULL;
while(!found)
{
- distance = end-start;
+ int distance = end-start;
j = (start+end)/2;
-
-
if(distance == 0)
{
j=end;
@@ -78,9 +75,7 @@ void SortResultNode::run(ExecutionNode* node)
{
start=j+1;
}
-
}
-
}
diceList2.insert(j,tmp1);
}