From 7edbd99775416a32c88acf8e9379518436905f02 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 21 Nov 2020 15:19:45 +0100 Subject: Support gcc 10 and clang 11 --- cppbnf.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'cppbnf.cpp') diff --git a/cppbnf.cpp b/cppbnf.cpp index 7e8ec15..3fddb66 100644 --- a/cppbnf.cpp +++ b/cppbnf.cpp @@ -7,9 +7,6 @@ #include -#include -#include - using namespace std::string_literals; namespace { @@ -123,7 +120,7 @@ namespace { void resolveOptional(std::vector>& lists) { - for (int i = 0; i < lists.size(); i++) { + for (size_t i = 0; i < lists.size(); i++) { if (containsOptional(lists[i])) { auto insertList = resolveOptional(lists[i]); // replace element i with new list @@ -150,7 +147,7 @@ namespace { // vectorize terminal symbols for (auto& [symbol, lists] : bnf) { for (auto& list : lists) { - for (int i = 0; i < list.size(); i++) { + for (size_t i = 0; i < list.size(); i++) { if (list[i].size() > 1 && isTerminal(bnf, list[i])) { auto newList = vectorize(list[i]); list.erase(list.begin() + i); -- cgit v1.2.3