diff options
| author | 2018-02-24 17:06:10 +0100 | |
|---|---|---|
| committer | 2018-02-24 17:06:10 +0100 | |
| commit | ff78f313abd4839b77f17255b79dd4499bce0512 (patch) | |
| tree | bca17428464e6184a34f382bf28b3c3204b16519 /node | |
| parent | 4eeb6ff50f3153c3e139507d99efdf2bc1b9314c (diff) | |
| download | OneRoll-ff78f313abd4839b77f17255b79dd4499bce0512.tar.gz OneRoll-ff78f313abd4839b77f17255b79dd4499bce0512.zip | |
-remove warnings
Diffstat (limited to 'node')
| -rw-r--r-- | node/dicerollernode.cpp | 2 | ||||
| -rw-r--r-- | node/keepdiceexecnode.cpp | 4 | ||||
| -rw-r--r-- | node/listsetrollnode.cpp | 2 | ||||
| -rw-r--r-- | node/splitnode.cpp | 3 | ||||
| -rw-r--r-- | node/variablenode.cpp | 7 | ||||
| -rw-r--r-- | node/variablenode.h | 2 |
6 files changed, 7 insertions, 13 deletions
diff --git a/node/dicerollernode.cpp b/node/dicerollernode.cpp index 1f501e5..70fd245 100644 --- a/node/dicerollernode.cpp +++ b/node/dicerollernode.cpp @@ -29,7 +29,7 @@ void DiceRollerNode::run(ExecutionNode* previous) { m_errors.insert(NO_DICE_TO_ROLL,QObject::tr("No dice to roll")); } - auto possibleValue = (m_max-m_min)+1; + auto possibleValue = static_cast<quint64>(abs((m_max-m_min)+1)); //qDebug() << possibleValue; if( possibleValue < m_diceCount && m_unique) { diff --git a/node/keepdiceexecnode.cpp b/node/keepdiceexecnode.cpp index a93cc11..547e343 100644 --- a/node/keepdiceexecnode.cpp +++ b/node/keepdiceexecnode.cpp @@ -49,7 +49,7 @@ void KeepDiceExecNode::run(ExecutionNode* previous) QList<Die*> diceList3= diceList.mid(0,m_numberOfDice); QList<Die*> diceList2; - foreach(Die* die,diceList3) + for(Die* die : diceList3) { Die* tmpdie = new Die(); *tmpdie=*die; @@ -59,7 +59,7 @@ void KeepDiceExecNode::run(ExecutionNode* previous) - if(m_numberOfDice > diceList.size()) + if(m_numberOfDice > static_cast<quint64>(diceList.size())) { m_errors.insert(TOO_MANY_DICE,QObject::tr(" You ask to keep %1 dice but the result only has %2").arg(m_numberOfDice).arg(diceList.size())); } diff --git a/node/listsetrollnode.cpp b/node/listsetrollnode.cpp index d7d4566..e6ffd00 100644 --- a/node/listsetrollnode.cpp +++ b/node/listsetrollnode.cpp @@ -65,7 +65,7 @@ void ListSetRollNode::run(ExecutionNode* previous) if(nullptr!=result) { quint64 diceCount = result->getResult(Result::SCALAR).toReal(); - if(diceCount > m_values.size() && m_unique) + if(diceCount > static_cast<quint64>(m_values.size()) && m_unique) { m_errors.insert(TOO_MANY_DICE,QObject::tr("More unique values asked than possible values (L operator)")); } diff --git a/node/splitnode.cpp b/node/splitnode.cpp index ed32fdd..d44bad5 100644 --- a/node/splitnode.cpp +++ b/node/splitnode.cpp @@ -47,7 +47,8 @@ void SplitNode::run(ExecutionNode* previous) { Die* tmpdie = new Die(); tmpdie->insertRollValue(value); - tmpdie->setFaces(oldDie->getFaces()); + tmpdie->setBase(oldDie->getBase()); + tmpdie->setMaxValue(oldDie->getMaxValue()); tmpdie->setValue(value); tmpdie->setOp(oldDie->getOp()); m_diceResult->insertResult(tmpdie); diff --git a/node/variablenode.cpp b/node/variablenode.cpp index f202246..9963af9 100644 --- a/node/variablenode.cpp +++ b/node/variablenode.cpp @@ -8,13 +8,6 @@ VariableNode::VariableNode() void VariableNode::run(ExecutionNode *previous) { m_previousNode = previous; - - if(m_index<0) - { - m_errors.insert(INVALID_INDEX,QObject::tr("Invalid index must be greater than 0 :%1").arg(m_index)); - return; - } - if(m_data->size()>m_index) { auto value= (*m_data)[m_index]; diff --git a/node/variablenode.h b/node/variablenode.h index 6e9cc78..1df9acd 100644 --- a/node/variablenode.h +++ b/node/variablenode.h @@ -26,7 +26,7 @@ public: void setData(std::vector<ExecutionNode *>* data); private: - qint64 m_index; + quint64 m_index; std::vector<ExecutionNode*>* m_data; }; |