]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Avoid a shadowing case reported by g++-15
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 17 Dec 2025 14:07:27 +0000 (15:07 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 17 Dec 2025 14:08:19 +0000 (15:08 +0100)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/recursordist/rec-cookiestore.cc
pdns/recursordist/rec-nsspeeds.cc

index 8b660496bf1695694cf264e1e7b9c8c9bc965082..f3adafddaaf876260cd75e25a73a5f83f212e7ab 100644 (file)
@@ -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<time_t>::max() ? "Forever" : timestamp(entry.d_lastused, tmp));
   }
-  return count;
+  return theCount;
 }
index 7121fce224bec3d4564a221fa8a590c383ae6f6b..7ba3df459a7d37f3935c44f4e7ceea54d76a561d 100644 (file)
@@ -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 <typename T>