From 74528a8571b2ecf3676d811c7a6584441059ee7f Mon Sep 17 00:00:00 2001 From: rturrado <68099809+rturrado@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:20:11 +0100 Subject: [PATCH 1/2] Fix warning: unused parameter 'context' [-Wunused-parameter]. Signed-off-by: Roberto Turrado Camblor --- runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp b/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp index 4d7448a89b..f9b89c41b0 100644 --- a/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp +++ b/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp @@ -155,7 +155,7 @@ void XPathLexer::action(RuleContext *context, size_t ruleIndex, size_t actionInd } } -void XPathLexer::IDAction(antlr4::RuleContext *context, size_t actionIndex) { +void XPathLexer::IDAction(antlr4::RuleContext */*context*/, size_t actionIndex) { switch (actionIndex) { case 0: if (isupper(getText()[0])) From 6d138373e74de6b6882e70ef0ddbdd152e8901ae Mon Sep 17 00:00:00 2001 From: Roberto Turrado Camblor Date: Mon, 11 Dec 2023 17:23:35 +0100 Subject: [PATCH 2/2] =?UTF-8?q?README.md:=20fixed=20typo.=20Changed=20`def?= =?UTF-8?q?ualt`=20to=20`default`.=20UnbufferedCharStream.cpp:=20fixed=20w?= =?UTF-8?q?arning:=20comparison=20of=20integers=20of=20different=20signs:?= =?UTF-8?q?=20'value=5Ftype'=20(aka=20'char32=5Ft')=20and=20'int=5Ftype'?= =?UTF-8?q?=20(aka=20'int')=20[-Wsign-compare].=20Vocabulary.cpp:=20fixed?= =?UTF-8?q?=20=20warning:=20=E2=80=98antlr4::dfa::Vocabulary::EMPTY=5FVOCA?= =?UTF-8?q?BULARY=E2=80=99=20is=20deprecated:=20Use=20the=20default=20cons?= =?UTF-8?q?tructor=20of=20Vocabulary=20instead.=20[-Wdeprecated-declaratio?= =?UTF-8?q?ns].?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rturrado <68099809+rturrado@users.noreply.github.com> --- runtime/Cpp/cmake/README.md | 2 +- runtime/Cpp/runtime/src/UnbufferedCharStream.cpp | 2 +- runtime/Cpp/runtime/src/Vocabulary.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/Cpp/cmake/README.md b/runtime/Cpp/cmake/README.md index aac713a77d..60c5cf7136 100644 --- a/runtime/Cpp/cmake/README.md +++ b/runtime/Cpp/cmake/README.md @@ -133,7 +133,7 @@ ANTLR4_TAG - branch/tag used for building antlr4 library `ANTLR4_TAG` is set to master branch by default to keep the antlr4 library up to date. However, this will require a rebuild after every `clean` is called. Set `ANTLR4_TAG` to a desired commit hash value to avoid rebuilding after every `clean` and keep the build stable, at the cost of not automatically updating to latest commit. -By defualt the ANTLR C++ runtime source is cloned from GitHub. However, users may specify `ANTLR4_ZIP_REPOSITORY` in order to download source as a zip file from [ANTLR downloads](http://www.antlr.org/download.html) (under *C++ Target*) or other locations. For example, this variable could list a zip file included in your the project directory. This is useful for maintaining a canonical source tree for each new build. +By default the ANTLR C++ runtime source is cloned from GitHub. However, users may specify `ANTLR4_ZIP_REPOSITORY` in order to download source as a zip file from [ANTLR downloads](http://www.antlr.org/download.html) (under *C++ Target*) or other locations. For example, this variable could list a zip file included in your the project directory. This is useful for maintaining a canonical source tree for each new build. Visual C++ compiler users may want to additionally define `ANTLR4_WITH_STATIC_CRT` before including the file. Set `ANTLR4_WITH_STATIC_CRT` to true if ANTLR4 C++ runtime library should be compiled with `/MT` flag, otherwise will be compiled with `/MD` flag. This variable has a default value of `OFF`. Changing `ANTLR4_WITH_STATIC_CRT` after building the library may require reinitialization of CMake or `clean` for the library to get rebuilt. diff --git a/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp b/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp index fd234de099..c78448e96d 100755 --- a/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp +++ b/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp @@ -98,7 +98,7 @@ size_t UnbufferedCharStream::LA(ssize_t i) { return EOF; } - if (_data[static_cast(index)] == std::char_traits::eof()) { + if (_data[static_cast(index)] == std::char_traits::eof()) { return EOF; } diff --git a/runtime/Cpp/runtime/src/Vocabulary.cpp b/runtime/Cpp/runtime/src/Vocabulary.cpp index 0f783d5d79..b94c0e2ab9 100755 --- a/runtime/Cpp/runtime/src/Vocabulary.cpp +++ b/runtime/Cpp/runtime/src/Vocabulary.cpp @@ -9,7 +9,7 @@ using namespace antlr4::dfa; -const Vocabulary Vocabulary::EMPTY_VOCABULARY; +const Vocabulary Vocabulary{}; Vocabulary::Vocabulary(std::vector literalNames, std::vector symbolicNames) : Vocabulary(std::move(literalNames), std::move(symbolicNames), {}) {