From 4078a1c6bdf30ca6c2f27b6292b359bd626b73a8 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Thu, 8 Oct 2026 12:11:05 +0100 Subject: [PATCH 1/2] Remove unused variables --- src/xinspect.cpp | 4 ++-- test/test_interpreter.cpp | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/xinspect.cpp b/src/xinspect.cpp index 79ed24a8..40c83b56 100644 --- a/src/xinspect.cpp +++ b/src/xinspect.cpp @@ -134,7 +134,7 @@ namespace xcpp std::string tagfile = it->at("tagfile"); std::string filename = tagfiles_dir + "/" + tagfile; pugi::xml_document doc; - pugi::xml_parse_result result = doc.load_file(filename.c_str()); + (void) doc.load_file(filename.c_str()); class_member_predicate predicate{type_name, "function", method[2]}; auto node = doc.find_node(predicate); if (!node.empty()) @@ -169,7 +169,7 @@ namespace xcpp std::string tagfile = it->at("tagfile"); std::string filename = tagfiles_dir + "/" + tagfile; pugi::xml_document doc; - pugi::xml_parse_result result = doc.load_file(filename.c_str()); + (void) doc.load_file(filename.c_str()); for (auto c : check) { node_predicate predicate{c, find_string}; diff --git a/test/test_interpreter.cpp b/test/test_interpreter.cpp index 23de2c3b..d6e4301f 100644 --- a/test/test_interpreter.cpp +++ b/test/test_interpreter.cpp @@ -726,7 +726,7 @@ TEST_SUITE("xoptions") bool exceptionThrown = false; try { - bool isVerbose = (parser["--verbose"] == false); + (void)(parser["--verbose"] == false); } catch (const std::exception& e) { exceptionThrown = true; } @@ -840,7 +840,6 @@ TEST_SUITE("xsystem_apply") TEST_SUITE("xmagics_contains"){ TEST_CASE("bad_status_cell") { xcpp::xmagics_manager manager; - xcpp::xmagic_type magic = xcpp::xmagic_type::cell; // manager.register_magic("my_magic", xcpp::xmagic_type::cell); bool result = manager.contains("my_magic", xcpp::xmagic_type::cell); @@ -849,7 +848,6 @@ TEST_SUITE("xmagics_contains"){ TEST_CASE("bad_status_line") { xcpp::xmagics_manager manager; - xcpp::xmagic_type magic = xcpp::xmagic_type::line; // manager.register_magic("my_magic", xcpp::xmagic_type::cell); bool result = manager.contains("my_magic", xcpp::xmagic_type::line); From eda80d3a834c68913d6845b26b8f0f233a939212 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Wed, 14 Oct 2026 09:55:44 +0100 Subject: [PATCH 2/2] Try removing cast to void --- src/xinspect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xinspect.cpp b/src/xinspect.cpp index 40c83b56..2e971992 100644 --- a/src/xinspect.cpp +++ b/src/xinspect.cpp @@ -134,7 +134,7 @@ namespace xcpp std::string tagfile = it->at("tagfile"); std::string filename = tagfiles_dir + "/" + tagfile; pugi::xml_document doc; - (void) doc.load_file(filename.c_str()); + doc.load_file(filename.c_str()); class_member_predicate predicate{type_name, "function", method[2]}; auto node = doc.find_node(predicate); if (!node.empty()) @@ -169,7 +169,7 @@ namespace xcpp std::string tagfile = it->at("tagfile"); std::string filename = tagfiles_dir + "/" + tagfile; pugi::xml_document doc; - (void) doc.load_file(filename.c_str()); + doc.load_file(filename.c_str()); for (auto c : check) { node_predicate predicate{c, find_string};