diff --git a/muparser-2.2.5/include/muParserTokenReader.h b/muparser-2.2.5/include/muParserTokenReader.h index d91766a8b..597c9809f 100644 --- a/muparser-2.2.5/include/muParserTokenReader.h +++ b/muparser-2.2.5/include/muParserTokenReader.h @@ -121,25 +121,25 @@ class ParserTokenReader final { ParserBase *m_pParser; string_type m_strFormula; - int m_iPos; - int m_iSynFlags; - bool m_bIgnoreUndefVar; + int m_iPos = 0; + int m_iSynFlags = 0; + bool m_bIgnoreUndefVar = false; - const funmap_type *m_pFunDef; - const funmap_type *m_pPostOprtDef; - const funmap_type *m_pInfixOprtDef; - const funmap_type *m_pOprtDef; - const valmap_type *m_pConstDef; - const strmap_type *m_pStrVarDef; - varmap_type *m_pVarDef; ///< The only non const pointer to parser internals - facfun_type m_pFactory; - void *m_pFactoryData; + const funmap_type *m_pFunDef = nullptr; + const funmap_type *m_pPostOprtDef = nullptr; + const funmap_type *m_pInfixOprtDef = nullptr; + const funmap_type *m_pOprtDef = nullptr; + const valmap_type *m_pConstDef = nullptr; + const strmap_type *m_pStrVarDef = nullptr; + varmap_type *m_pVarDef = nullptr; ///< The only non const pointer to parser internals + facfun_type m_pFactory = nullptr; + void *m_pFactoryData = nullptr; std::list m_vIdentFun; ///< Value token identification function varmap_type m_UsedVar; - value_type m_fZero; ///< Dummy value of zero, referenced by undefined variables - int m_iBrackets; + value_type m_fZero = 0; ///< Dummy value of zero, referenced by undefined variables + int m_iBrackets = 0; token_type m_lastTok; - char_type m_cArgSep; ///< The character used for separating function arguments + char_type m_cArgSep = ','; ///< The character used for separating function arguments }; } // namespace mu diff --git a/muparser-2.2.5/src/muParserTokenReader.cpp b/muparser-2.2.5/src/muParserTokenReader.cpp index 57ead44e3..3471e8fa4 100644 --- a/muparser-2.2.5/src/muParserTokenReader.cpp +++ b/muparser-2.2.5/src/muParserTokenReader.cpp @@ -47,29 +47,9 @@ namespace mu { \post #m_pParser==a_pParser \param a_pParent Parent parser object of the token reader. */ -ParserTokenReader::ParserTokenReader(ParserBase *a_pParent) - : m_pParser(a_pParent), - m_strFormula(), - m_iPos(0), - m_iSynFlags(0), - m_bIgnoreUndefVar(false), - m_pFunDef(NULL), - m_pPostOprtDef(NULL), - m_pInfixOprtDef(NULL), - m_pOprtDef(NULL), - m_pConstDef(NULL), - m_pStrVarDef(NULL), - m_pVarDef(NULL), - m_pFactory(NULL), - m_pFactoryData(NULL), - m_vIdentFun(), - m_UsedVar(), - m_fZero(0), - m_iBrackets(0), - m_lastTok(), - m_cArgSep(',') { - assert(m_pParser); - SetParent(m_pParser); +ParserTokenReader::ParserTokenReader(ParserBase *a_pParent) { + assert(a_pParent && "Missing parent"); + SetParent(a_pParent); } //---------------------------------------------------------------------------