From: Otto Moerbeek Date: Wed, 17 Dec 2025 14:07:27 +0000 (+0100) Subject: Avoid a shadowing case reported by g++-15 X-Git-Tag: rec-5.4.0-beta1~56^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e569468e54c76f36701d6a2ed31ebb3e944c2c2b;p=thirdparty%2Fpdns.git Avoid a shadowing case reported by g++-15 Signed-off-by: Otto Moerbeek --- diff --git a/pdns/recursordist/rec-cookiestore.cc b/pdns/recursordist/rec-cookiestore.cc index 8b660496bf..f3adafddaa 100644 --- a/pdns/recursordist/rec-cookiestore.cc +++ b/pdns/recursordist/rec-cookiestore.cc @@ -40,11 +40,11 @@ uint64_t CookieStore::dump(int fileDesc) const close(newfd); return 0; } - uint64_t count = 0; + uint64_t theCount = 0; fprintf(filePtr.get(), "; cookie dump follows\n; server\tlocal\tcookie\tsupport\tts\n"); for (const auto& entry : *this) { - count++; + theCount++; timebuf_t tmp; fprintf(filePtr.get(), "%s\t%s\t%s\t%s\t%s\n", entry.d_address.toStringWithPortExcept(53).c_str(), entry.d_localaddress.toString().c_str(), @@ -52,5 +52,5 @@ uint64_t CookieStore::dump(int fileDesc) const CookieEntry::toString(entry.d_support).c_str(), entry.d_lastused == std::numeric_limits::max() ? "Forever" : timestamp(entry.d_lastused, tmp)); } - return count; + return theCount; } diff --git a/pdns/recursordist/rec-nsspeeds.cc b/pdns/recursordist/rec-nsspeeds.cc index 7121fce224..7ba3df459a 100644 --- a/pdns/recursordist/rec-nsspeeds.cc +++ b/pdns/recursordist/rec-nsspeeds.cc @@ -85,7 +85,7 @@ size_t nsspeeds_t::getPB(const string& serverID, size_t maxSize, std::string& re full.add_int64(PBNSSpeedDump::required_int64_time, time(nullptr)); full.add_string(PBNSSpeedDump::required_string_type, "PBNSSpeedDump"); - size_t count = 0; + size_t theCount = 0; ret.reserve(estimate); for (const auto& entry : *this) { @@ -93,13 +93,13 @@ size_t nsspeeds_t::getPB(const string& serverID, size_t maxSize, std::string& re getPBEntry(message, entry); if (maxSize > 0 && ret.size() > maxSize) { message.rollback(); - log->info(Logr::Info, "Produced nsspeed dump (max size reached)", "size", Logging::Loggable(ret.size()), "count", Logging::Loggable(count)); - return count; + log->info(Logr::Info, "Produced nsspeed dump (max size reached)", "size", Logging::Loggable(ret.size()), "count", Logging::Loggable(theCount)); + return theCount; } - ++count; + ++theCount; } - log->info(Logr::Info, "Produced nsspeed dump", "size", Logging::Loggable(ret.size()), "count", Logging::Loggable(count)); - return count; + log->info(Logr::Info, "Produced nsspeed dump", "size", Logging::Loggable(ret.size()), "count", Logging::Loggable(theCount)); + return theCount; } template