]> granicus.if.org Git - pdns/commitdiff
Fix some shadowed variables reported by GCC with -Wshadow
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 4 Jun 2018 09:48:59 +0000 (11:48 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 4 Jun 2018 09:48:59 +0000 (11:48 +0200)
pdns/dnssecinfra.cc
pdns/lua-base4.cc
pdns/misc.cc
pdns/pdns_recursor.cc
pdns/recursor_cache.cc

index 7525eed6419f713c7738383a58c860d84d030c40..9eec20c21e30a158881279219f078a958937c24c 100644 (file)
@@ -127,7 +127,6 @@ shared_ptr<DNSCryptoKeyEngine> DNSCryptoKeyEngine::makeFromISCString(DNSKEYRecor
 
 std::string DNSCryptoKeyEngine::convertToISC() const
 {
-  typedef map<string, string> stormap_t;
   storvector_t stormap = this->convertToISCVector();
   ostringstream ret;
   ret<<"Private-key-format: v1.2\n";
index a46821367a40139d238d6f5e56372df50890a4a3..6e8ef5107e267bc091b36ab753bb0e73aa1279aa 100644 (file)
@@ -179,10 +179,10 @@ void BaseLua4::prepareContext() {
   d_lw->registerFunction<boost::optional<ComboAddress>(DNSRecord::*)()>("getCA", [](const DNSRecord& dr) {
       boost::optional<ComboAddress> ret;
 
-      if(auto rec = std::dynamic_pointer_cast<ARecordContent>(dr.d_content))
-        ret=rec->getCA(53);
-      else if(auto rec = std::dynamic_pointer_cast<AAAARecordContent>(dr.d_content))
-        ret=rec->getCA(53);
+      if(auto arec = std::dynamic_pointer_cast<ARecordContent>(dr.d_content))
+        ret=arec->getCA(53);
+      else if(auto aaaarec = std::dynamic_pointer_cast<AAAARecordContent>(dr.d_content))
+        ret=aaaarec->getCA(53);
       return ret;
     });
   d_lw->registerFunction<void(DNSRecord::*)(const std::string&)>("changeContent", [](DNSRecord& dr, const std::string& newContent) { dr.d_content = shared_ptr<DNSRecordContent>(DNSRecordContent::mastermake(dr.d_type, 1, newContent)); });
index 6efb3f6da0ef7c970b5480a48d98912023c38deb..9e671aab85c0703b9fa5cbdc6398f997c765736f 100644 (file)
@@ -351,7 +351,7 @@ int waitForRWData(int fd, bool waitForRead, int seconds, int useconds, bool* err
 }
 
 // returns -1 in case of error, 0 if no data is available, 1 if there is. In the first two cases, errno is set
-int waitForMultiData(const set<int>& fds, const int seconds, const int useconds, int* fd) {
+int waitForMultiData(const set<int>& fds, const int seconds, const int useconds, int* fdOut) {
   set<int> realFDs;
   for (const auto& fd : fds) {
     if (fd >= 0 && realFDs.count(fd) == 0) {
@@ -384,7 +384,7 @@ int waitForMultiData(const set<int>& fds, const int seconds, const int useconds,
   }
   set<int>::const_iterator it(pollinFDs.begin());
   advance(it, random() % pollinFDs.size());
-  *fd = *it;
+  *fdOut = *it;
   return 1;
 }
 
index 9ffab649ff52d4f40eb499d5b10d994493311f7f..133534652fcd4ee68e3d144834f0b013c1cfcdc3 100644 (file)
@@ -2022,7 +2022,7 @@ static void handleNewUDPQuestion(int fd, FDMultiplexer::funcparam_t& var)
   fromaddr.sin6.sin6_family=AF_INET6; // this makes sure fromaddr is big enough
   fillMSGHdr(&msgh, &iov, cbuf, sizeof(cbuf), &data[0], data.size(), &fromaddr);
 
-  for(size_t counter = 0; counter < s_maxUDPQueriesPerRound; counter++)
+  for(size_t queriesCounter = 0; queriesCounter < s_maxUDPQueriesPerRound; queriesCounter++)
   if((len=recvmsg(fd, &msgh, 0)) >= 0) {
 
     firstQuery = false;
index 8dc896d9e7c4621b29f3d2ac352c4874481417d6..7dea10c3921cfeba81d8518629f6fd9a7227bd97 100644 (file)
@@ -320,10 +320,8 @@ int MemRecursorCache::doWipeCache(const DNSName& name, bool sub, uint16_t qtype)
 {
   int count=0;
   d_cachecachevalid=false;
-  pair<cache_t::iterator, cache_t::iterator> range;
 
   if(!sub) {
-    pair<ecsIndex_t::iterator, ecsIndex_t::iterator> ecsIndexRange;
     auto& idx = d_cache.get<NameOnlyHashedTag>();
     auto range = idx.equal_range(name);
     for(auto& i=range.first; i != range.second; ) {