From fd60a7cff7c7a27b19184eb1d4ecfd9739643aba Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 18 Dec 2017 10:49:29 -0800 Subject: [PATCH] [muparser] Remove unused fields from SToken --- muparser-2.2.5/include/muParserBytecode.h | 2 -- muparser-2.2.5/src/muParserBase.cpp | 2 +- muparser-2.2.5/src/muParserBytecode.cpp | 9 +++------ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/muparser-2.2.5/include/muParserBytecode.h b/muparser-2.2.5/include/muParserBytecode.h index 951282646..b0639fc21 100644 --- a/muparser-2.2.5/include/muParserBytecode.h +++ b/muparser-2.2.5/include/muParserBytecode.h @@ -40,14 +40,12 @@ namespace mu { struct SToken { ECmdCode Cmd; - int StackPos; union { struct // SValData { value_type *ptr; value_type data; - value_type data2; } Val; struct // SFunData diff --git a/muparser-2.2.5/src/muParserBase.cpp b/muparser-2.2.5/src/muParserBase.cpp index dbdbc8963..e49ce3bae 100644 --- a/muparser-2.2.5/src/muParserBase.cpp +++ b/muparser-2.2.5/src/muParserBase.cpp @@ -835,7 +835,7 @@ ValueOrError ParserBase::ExecuteRPN() const { Stack[++sidx] = *(pTok->Val.ptr); continue; case cmVAL: - Stack[++sidx] = pTok->Val.data2; + Stack[++sidx] = pTok->Val.data; continue; // Next is treatment of numeric functions diff --git a/muparser-2.2.5/src/muParserBytecode.cpp b/muparser-2.2.5/src/muParserBytecode.cpp index 48883469f..06efd6add 100644 --- a/muparser-2.2.5/src/muParserBytecode.cpp +++ b/muparser-2.2.5/src/muParserBytecode.cpp @@ -51,12 +51,10 @@ void ParserByteCode::AddVar(value_type *a_pVar) { ++m_iStackPos; m_iMaxStackSize = std::max(m_iMaxStackSize, (size_t)m_iStackPos); - // optimization does not apply SToken tok; tok.Cmd = cmVAR; tok.Val.ptr = a_pVar; - tok.Val.data = 1; - tok.Val.data2 = 0; + tok.Val.data = 0; m_vRPN.push_back(tok); } @@ -80,8 +78,7 @@ void ParserByteCode::AddVal(value_type a_fVal) { SToken tok; tok.Cmd = cmVAL; tok.Val.ptr = NULL; - tok.Val.data = 0; - tok.Val.data2 = a_fVal; + tok.Val.data = a_fVal; m_vRPN.push_back(tok); } @@ -250,7 +247,7 @@ void ParserByteCode::AsciiDump() { switch (m_vRPN[i].Cmd) { case cmVAL: mu::console() << _T("VAL \t"); - mu::console() << _T("[") << m_vRPN[i].Val.data2 << _T("]\n"); + mu::console() << _T("[") << m_vRPN[i].Val.data << _T("]\n"); break; case cmVAR: