aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/jumpbackwardnode.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2017-10-27 22:19:20 +0200
committerRenaud G <renaud@rolisteam.org>2017-10-29 03:30:46 +0100
commitf053853e87624a045438bacd4dd1494e91ae381f (patch)
treecbf98ae65d48f4158c3af73be6bd0a1fb9417335 /node/jumpbackwardnode.cpp
parenta543a6ca8ddc2826a4433044ed1a040acbbf36a3 (diff)
downloadOneRoll-f053853e87624a045438bacd4dd1494e91ae381f.tar.gz
OneRoll-f053853e87624a045438bacd4dd1494e91ae381f.zip
-c++11 update about for and nullptr.
Diffstat (limited to 'node/jumpbackwardnode.cpp')
-rw-r--r--node/jumpbackwardnode.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/node/jumpbackwardnode.cpp b/node/jumpbackwardnode.cpp
index b7af106..e860f99 100644
--- a/node/jumpbackwardnode.cpp
+++ b/node/jumpbackwardnode.cpp
@@ -23,8 +23,8 @@
JumpBackwardNode::JumpBackwardNode()
{
- m_previousNode=NULL;
- m_backwardNode = NULL;
+ m_previousNode=nullptr;
+ m_backwardNode = nullptr;
m_diceResult =new DiceResult();
m_result = m_diceResult;
}
@@ -51,7 +51,7 @@ void JumpBackwardNode::generateDotTree(QString& s)
s.append(toString(true));
s.append(";\n");
- if(NULL!=m_backwardNode)
+ if(nullptr!=m_backwardNode)
{
s.append(toString(false));
s.append(" -> ");
@@ -60,7 +60,7 @@ void JumpBackwardNode::generateDotTree(QString& s)
//m_backwardNode->generateDotTree(s);
}
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
s.append(toString(false));
s.append(" -> ");
@@ -72,9 +72,9 @@ void JumpBackwardNode::generateDotTree(QString& s)
{
s.append(toString(false));
s.append(" -> ");
- s.append("NULL;\n");
+ s.append("nullptr;\n");
- if(NULL!=m_result)
+ if(nullptr!=m_result)
{
s.append(toString(false));
s.append(" ->");
@@ -92,12 +92,12 @@ void JumpBackwardNode::run(ExecutionNode* previous)
ExecutionNode* parent = previous;
bool found=false;
//int i = 3;
- Result* result=NULL;
- while((NULL!=parent)&&(!found))
+ Result* result=nullptr;
+ while((nullptr!=parent)&&(!found))
{
result = parent->getResult();
- if(NULL!=result)
+ if(nullptr!=result)
{
//--i;
if(/*(i==0)&&*/(result->hasResultOfType(Result::DICE_LIST)))
@@ -108,7 +108,7 @@ void JumpBackwardNode::run(ExecutionNode* previous)
else
{
JumpBackwardNode* jpNode = dynamic_cast<JumpBackwardNode*>(parent);
- if(NULL!=jpNode)
+ if(nullptr!=jpNode)
{
found = true;
m_backwardNode = parent;
@@ -121,16 +121,16 @@ void JumpBackwardNode::run(ExecutionNode* previous)
}
}
- if(NULL==result)
+ if(nullptr==result)
{
m_errors.insert(DIE_RESULT_EXPECTED,QObject::tr(" The @ operator expects dice result. Please check the documentation to fix your command."));
}
else
{
DiceResult* diceResult = dynamic_cast<DiceResult*>(result);
- if(NULL!=diceResult)
+ if(nullptr!=diceResult)
{
- foreach(Die* die,diceResult->getResultList())
+ for(Die* die : diceResult->getResultList())
{
Die* tmpdie = new Die();
*tmpdie=*die;
@@ -141,11 +141,11 @@ void JumpBackwardNode::run(ExecutionNode* previous)
m_result->setPrevious(previous->getResult());
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
m_nextNode->run(this);
}
- if(NULL!=diceResult)
+ if(nullptr!=diceResult)
{
for(int i =0;i<diceResult->getResultList().size();++i)
{
@@ -163,7 +163,7 @@ void JumpBackwardNode::run(ExecutionNode* previous)
ExecutionNode* JumpBackwardNode::getCopy() const
{
JumpBackwardNode* node = new JumpBackwardNode();
- if(NULL!=m_nextNode)
+ if(nullptr!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}