From d92816a5f55cea9b67b7aab306eb1109af6dcbbe Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 22 Mar 2026 17:02:40 +0000 Subject: Add missing -Wshadow --- src/ingestor.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/ingestor.cpp') diff --git a/src/ingestor.cpp b/src/ingestor.cpp index fb592d7..eb3be09 100644 --- a/src/ingestor.cpp +++ b/src/ingestor.cpp @@ -43,8 +43,8 @@ namespace WebStat { std::optional operator()(const std::optional & value) const { - return value.transform([this](auto && value) { - return (*this)(value); + return value.transform([this](auto && contained) { + return (*this)(contained); }); } }; @@ -69,18 +69,18 @@ namespace WebStat { Ingestor * Ingestor::currentIngestor = nullptr; - Ingestor::Ingestor(const utsname & host, IngestorSettings settings) : + Ingestor::Ingestor(const utsname & host, IngestorSettings givenSettings) : Ingestor {host, std::make_shared( - settings.dbMax, settings.dbKeep, settings.dbType, settings.dbConnStr), - std::move(settings)} + givenSettings.dbMax, givenSettings.dbKeep, givenSettings.dbType, givenSettings.dbConnStr), + std::move(givenSettings)} { } - Ingestor::Ingestor(const utsname & host, DB::ConnectionPoolPtr dbpl, IngestorSettings settings) : - settings {std::move(settings)}, dbpool {std::move(dbpl)}, ingestParkedLines {&Ingestor::jobIngestParkedLines}, - purgeOldLogs {&Ingestor::jobPurgeOldLogs}, hostnameId {crc32(host.nodename)}, curl {curl_multi_init()}, - mainThread {std::this_thread::get_id()} + Ingestor::Ingestor(const utsname & host, DB::ConnectionPoolPtr dbpl, IngestorSettings givenSettings) : + settings {std::move(givenSettings)}, dbpool {std::move(dbpl)}, + ingestParkedLines {&Ingestor::jobIngestParkedLines}, purgeOldLogs {&Ingestor::jobPurgeOldLogs}, + hostnameId {crc32(host.nodename)}, curl {curl_multi_init()}, mainThread {std::this_thread::get_id()} { auto dbconn = dbpool->get(); auto ins = dbconn->modify(SQL::HOST_UPSERT, SQL::HOST_UPSERT_OPTS); @@ -337,7 +337,7 @@ namespace WebStat { void Ingestor::jobIngestParkedLines(FILE * lines, size_t count) { - for (size_t line = 0; line < count; ++line) { + for (size_t lineNo = 0; lineNo < count; ++lineNo) { if (auto line = scn::scan(lines, "{:[^\n]}\n")) { linesRead++; queuedLines.emplace_back(std::move(line->value())); @@ -376,9 +376,9 @@ namespace WebStat { auto next = rtn.begin(); visit( [this, &next](const X & entity) { - auto addNewIfReqd = [&next, this](auto && entity) mutable { - if (!existingEntities.contains(std::get<0>(entity))) { - *next++ = entity; + auto addNewIfReqd = [&next, this](auto && entityToAdd) mutable { + if (!existingEntities.contains(std::get<0>(entityToAdd))) { + *next++ = entityToAdd; } return 0; }; -- cgit v1.3