[muparser] Remove unused fields from SToken

This commit is contained in:
ridiculousfish 2017-12-18 10:49:29 -08:00
parent 732b32c8b4
commit fd60a7cff7
3 changed files with 4 additions and 9 deletions

View file

@ -40,14 +40,12 @@
namespace mu { namespace mu {
struct SToken { struct SToken {
ECmdCode Cmd; ECmdCode Cmd;
int StackPos;
union { union {
struct // SValData struct // SValData
{ {
value_type *ptr; value_type *ptr;
value_type data; value_type data;
value_type data2;
} Val; } Val;
struct // SFunData struct // SFunData

View file

@ -835,7 +835,7 @@ ValueOrError ParserBase::ExecuteRPN() const {
Stack[++sidx] = *(pTok->Val.ptr); Stack[++sidx] = *(pTok->Val.ptr);
continue; continue;
case cmVAL: case cmVAL:
Stack[++sidx] = pTok->Val.data2; Stack[++sidx] = pTok->Val.data;
continue; continue;
// Next is treatment of numeric functions // Next is treatment of numeric functions

View file

@ -51,12 +51,10 @@ void ParserByteCode::AddVar(value_type *a_pVar) {
++m_iStackPos; ++m_iStackPos;
m_iMaxStackSize = std::max(m_iMaxStackSize, (size_t)m_iStackPos); m_iMaxStackSize = std::max(m_iMaxStackSize, (size_t)m_iStackPos);
// optimization does not apply
SToken tok; SToken tok;
tok.Cmd = cmVAR; tok.Cmd = cmVAR;
tok.Val.ptr = a_pVar; tok.Val.ptr = a_pVar;
tok.Val.data = 1; tok.Val.data = 0;
tok.Val.data2 = 0;
m_vRPN.push_back(tok); m_vRPN.push_back(tok);
} }
@ -80,8 +78,7 @@ void ParserByteCode::AddVal(value_type a_fVal) {
SToken tok; SToken tok;
tok.Cmd = cmVAL; tok.Cmd = cmVAL;
tok.Val.ptr = NULL; tok.Val.ptr = NULL;
tok.Val.data = 0; tok.Val.data = a_fVal;
tok.Val.data2 = a_fVal;
m_vRPN.push_back(tok); m_vRPN.push_back(tok);
} }
@ -250,7 +247,7 @@ void ParserByteCode::AsciiDump() {
switch (m_vRPN[i].Cmd) { switch (m_vRPN[i].Cmd) {
case cmVAL: case cmVAL:
mu::console() << _T("VAL \t"); 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; break;
case cmVAR: case cmVAR: