From b00dc3e1308b962caf7da95b0fec0550a95d8a38 Mon Sep 17 00:00:00 2001 From: sail3r <82087684+sail3r@users.noreply.github.com> Date: Sun, 15 Nov 2026 18:24:46 +1300 Subject: [PATCH] outline, textproc: drop locals left unused by earlier refactors mcp-cpp builds without warning flags of its own, and hosts that compile it (agentty) pass none, so these never surfaced. Under -Wall -Wextra they are: - outline.cpp:128 and :643, `const auto& re = outline_pattern();` 31ba132 moved matching into outline_line_matches/outline_line_is_def, which call outline_pattern() themselves; the two callers kept a reference they no longer read. outline_pattern() is still used by those helpers. - textproc.cpp:454 (run_extract), `int scanned` 876d0bb replaced the shared atomic total with per-share counts. The summed `scanned` is printed by run_aggregate, but run_extract only needs `capped`, so its sum was written and never read. No behaviour change: the regex is a function-local static either way, and `capped` is computed the same way. Not touched: data.cpp's Step{Kind} initialisers trip -Wmissing-field-initializers, but leaving `key` default-constructed is intended there (the same warning that agentty and maya turn off). --- src/tools/outline.cpp | 2 -- src/tools/textproc.cpp | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/tools/outline.cpp b/src/tools/outline.cpp index 5de0790..2b8bd13 100644 --- a/src/tools/outline.cpp +++ b/src/tools/outline.cpp @@ -125,7 +125,6 @@ namespace { std::format_to(std::back_inserter(out), "[L{}] {}\n", line_no, trimmed); ++emitted; }; - const auto& re = outline_pattern(); for (std::size_t i = 0; i <= content.size(); ++i) { if (i == content.size() || content[i] == '\n') { ++line_no; @@ -640,7 +639,6 @@ symbol_range(std::string_view content, std::string_view symbol, [[nodiscard]] std::string render_nested(std::string_view content, std::size_t max_entries, int& total_defs) { - const auto& re = outline_pattern(); // Collect (indent_cols, line_no, signature) for each matching line. struct Row { int cols; int line; std::string sig; }; std::vector rows; diff --git a/src/tools/textproc.cpp b/src/tools/textproc.cpp index c8d07c6..659d013 100644 --- a/src/tools/textproc.cpp +++ b/src/tools/textproc.cpp @@ -451,9 +451,8 @@ ExecResult run_extract(const Call& call, const ExtractArgs& a) { "or widen `glob`.", std::nullopt}; std::ostringstream out; - int scanned = 0; bool capped = false; - for (int c : counted) { scanned += c; capped = capped || c >= share_cap; } + for (int c : counted) capped = capped || c >= share_cap; // ── count mode: value → occurrences, desc ───────────────────────────── if (a.count) {