Coverity fix for libeval (CID #169327)

This commit is contained in:
Michael Geselbracht 2018-02-15 12:38:33 +01:00 committed by Maciej Suminski
parent 4a8a168079
commit 5d738dcb6d
2 changed files with 5 additions and 3 deletions

View File

@ -150,12 +150,12 @@ NumericEvaluator :: process(const char* s)
bClParseFinished = false;
Token tok;
numEval::TokenType parseTok;
do {
tok = getToken();
parse(tok.token, tok.value);
if (bClParseFinished || tok.token == ENDS) {
numEval::Parse(pClParser, 0, parseTok, this);
// Reset parser by passing zero as token ID, value is ignored.
numEval::Parse(pClParser, 0, tok.value, this);
break;
}
//usleep(200000);

View File

@ -114,7 +114,6 @@ public:
void enableTextInputStorage(bool w) { bClTextInputStorage = w; }
/* Used by the lemon parser */
void parse(int token, numEval::TokenType value);
void parseError(const char* s);
void parseOk();
void parseSetResult(double);
@ -162,6 +161,9 @@ protected:
/* Tokenizer: Next token/value taken from input string. */
Token getToken();
/* Used by processing loop */
void parse(int token, numEval::TokenType value);
private:
void* pClParser; // the current lemon parser state machine