From 90eed9913a12ef5afec007b4d91f77301b66cc76 Mon Sep 17 00:00:00 2001 From: mrexodia Date: Mon, 9 Jan 2017 01:09:17 +0100 Subject: [PATCH] fixed Coverity errors --- btparser/lexer.cpp | 2 -- btparser/lexer.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/btparser/lexer.cpp b/btparser/lexer.cpp index 55c53d4..5121c17 100644 --- a/btparser/lexer.cpp +++ b/btparser/lexer.cpp @@ -96,8 +96,6 @@ bool Lexer::Test(const std::function & lexEnum, lexEnum(toks); } while(tok != tok_eof && tok != tok_error); - if(tok != tok_error && tok != tok_eof) - tok = reportError("lexer did not finish at the end of the file"); for(const auto & warning : mWarnings) if(output) lexEnum("\nwarning: " + warning); diff --git a/btparser/lexer.h b/btparser/lexer.h index c5046c6..975622c 100644 --- a/btparser/lexer.h +++ b/btparser/lexer.h @@ -37,7 +37,7 @@ public: struct TokenState { - Token Token; + Token Token = tok_eof; std::string IdentifierStr; //tok_identifier uint64_t NumberVal = 0; //tok_number std::string StringLit; //tok_stringlit