From bb6b87a2685c0d71b5c38be33c100f85ac0b9cee Mon Sep 17 00:00:00 2001 From: Renaud G Date: Thu, 25 Jul 2019 09:59:29 +0200 Subject: Rework of the component to be a proper lib --- node/executionnode.h | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'node/executionnode.h') diff --git a/node/executionnode.h b/node/executionnode.h index e8eca1f..62bc5a5 100644 --- a/node/executionnode.h +++ b/node/executionnode.h @@ -1,8 +1,8 @@ #ifndef EXECUTIONNODE_H #define EXECUTIONNODE_H +#include "diceparserhelper.h" #include "result/result.h" -#include /** * @brief The ExecutionNode class @@ -10,21 +10,6 @@ class ExecutionNode { public: - enum DICE_ERROR_CODE - { - NO_DICE_ERROR, - DIE_RESULT_EXPECTED, - BAD_SYNTAXE, - ENDLESS_LOOP_ERROR, - DIVIDE_BY_ZERO, - NOTHING_UNDERSTOOD, - NO_DICE_TO_ROLL, - TOO_MANY_DICE, - NO_VARIBALE, - INVALID_INDEX, - UNEXPECTED_CHARACTER, - NO_PREVIOUS_ERROR - }; /** * @brief ExecutionNode */ @@ -72,7 +57,7 @@ public: * @brief getErrorList * @return */ - virtual QMap getExecutionErrorMap(); + virtual QMap getExecutionErrorMap(); /** * @brief generateDotTree @@ -109,7 +94,7 @@ protected: /** * @brief m_errors */ - QMap m_errors; + QMap m_errors; QString m_id; }; -- cgit v1.2.3-70-g09d2 From 62ff4aad384c248b62f88a3e38d2e51043c5bb20 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sun, 28 Jul 2019 01:46:48 +0200 Subject: initialize pointer on nullptr --- node/executionnode.h | 2 +- node/paintnode.h | 1 + operationcondition.h | 2 +- result/result.h | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) (limited to 'node/executionnode.h') diff --git a/node/executionnode.h b/node/executionnode.h index 62bc5a5..6321c83 100644 --- a/node/executionnode.h +++ b/node/executionnode.h @@ -86,7 +86,7 @@ protected: /** * @brief m_result */ - Result* m_result; + Result* m_result= nullptr; /** * @brief m_nextNode */ diff --git a/node/paintnode.h b/node/paintnode.h index 2675285..2283f83 100644 --- a/node/paintnode.h +++ b/node/paintnode.h @@ -55,6 +55,7 @@ public: protected: QList m_colors; + DiceResult* m_diceResult= nullptr; }; #endif diff --git a/operationcondition.h b/operationcondition.h index 8b5a411..b324f6b 100644 --- a/operationcondition.h +++ b/operationcondition.h @@ -54,7 +54,7 @@ private: qint64 valueToScalar() const; private: - ConditionOperator m_operator; + ConditionOperator m_operator= Modulo; BooleanCondition* m_boolean= nullptr; // qint64 m_value; ExecutionNode* m_value= nullptr; diff --git a/result/result.h b/result/result.h index a34c74f..76f3a8c 100644 --- a/result/result.h +++ b/result/result.h @@ -90,7 +90,7 @@ protected: QString m_id; private: - Result* m_previous; /// @brief + Result* m_previous= nullptr; /// @brief }; #endif // RESULT_H -- cgit v1.2.3-70-g09d2