aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2018-11-09 23:47:26 +0100
committerRenaud G <renaud@rolisteam.org>2018-11-09 23:49:14 +0100
commit1d8bd391b1df4fd2f2f274828db14c9ce695eb8b (patch)
tree82c9f29105fd149bb8be8a0a514893fca736faa5
parent4a6b19b27866326fa069a422ed2c862ab9e9d4d2 (diff)
downloadOneRoll-1d8bd391b1df4fd2f2f274828db14c9ce695eb8b.tar.gz
OneRoll-1d8bd391b1df4fd2f2f274828db14c9ce695eb8b.zip
fix some warnings
-rw-r--r--diceparser.cpp2
-rw-r--r--result/diceresult.cpp5
2 files changed, 3 insertions, 4 deletions
diff --git a/diceparser.cpp b/diceparser.cpp
index 6182a89..daa8d9d 100644
--- a/diceparser.cpp
+++ b/diceparser.cpp
@@ -495,7 +495,6 @@ QStringList DiceParser::getAllDiceResult(bool& hasAlias)
void DiceParser::getDiceResultFromAllInstruction(QList<ExportedDiceResult>& resultList)
{
- int i = 0;
for(auto start : m_startNodes)
{
ExecutionNode* next = getLeafNode(start);
@@ -525,7 +524,6 @@ void DiceParser::getDiceResultFromAllInstruction(QList<ExportedDiceResult>& resu
void DiceParser::getLastDiceResult(QList<ExportedDiceResult>& diceValuesList,bool& homogeneous)
{
- int i = 0;
for(auto start : m_startNodes)
{
ExportedDiceResult diceValues;
diff --git a/result/diceresult.cpp b/result/diceresult.cpp
index 7894b60..c1089dd 100644
--- a/result/diceresult.cpp
+++ b/result/diceresult.cpp
@@ -114,6 +114,9 @@ qreal DiceResult::getScalarResult()
case Die::MINUS:
scalar-=tmp->getValue();
break;
+ case Die::POW:
+ scalar=static_cast<int>(pow(static_cast<double>(scalar),static_cast<double>(tmp->getValue())));
+ break;
case Die::DIVIDE:
case Die::INTEGER_DIVIDE:
if(tmp->getValue()!=0)
@@ -135,8 +138,6 @@ qreal DiceResult::getScalarResult()
}
return scalar;
}
-
- return 0;
}
Die::ArithmeticOperator DiceResult::getOperator() const