From 69f15df80596fe50c0b9734a39d705a2a7870a9e Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Sat, 3 Aug 2019 18:55:11 -0700 Subject: [PATCH] fix two warnings that show up with Apple clang++ & -std=c++2a, including one where we called empty() on a string (uselessly) instead of the clear() that was obviously intended --- src/core/file_unix.cpp | 3 +-- src/twparser/yylex.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/file_unix.cpp b/src/core/file_unix.cpp index 9950c46..0a83703 100644 --- a/src/core/file_unix.cpp +++ b/src/core/file_unix.cpp @@ -275,8 +275,7 @@ void cFile::Close() //throw(eFile) mpData->mpCurrStream = NULL; } - - mpData->mFileName.empty(); + mpData->mFileName.clear(); } bool cFile::IsOpen(void) const diff --git a/src/twparser/yylex.cpp b/src/twparser/yylex.cpp index a94cc57..27cf803 100644 --- a/src/twparser/yylex.cpp +++ b/src/twparser/yylex.cpp @@ -831,8 +831,8 @@ yy_scan::yylex() yyst = yy_next[yybase]; yy_jammed: ; state[++i] = (yy_state_t) yyst; - } while (!(yyst == (unsigned int)yy_endst || YY_INTERACTIVE && - yy_base[yyst] > yy_nxtmax && yy_default[yyst] == yy_endst)); + } while (!(yyst == (unsigned int)yy_endst || (YY_INTERACTIVE && + (yy_base[yyst] > yy_nxtmax) && (yy_default[yyst] == yy_endst)))); YY_DEBUG("\n", yyst, i); if (yyst != (unsigned int)yy_endst)