From: Remi Gacogne Date: Mon, 4 Jun 2018 09:48:59 +0000 (+0200) Subject: Fix some shadowed variables reported by GCC with -Wshadow X-Git-Tag: dnsdist-1.3.1~45^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc058f6500afb3c73a3365842b853b24c5aecda0;p=pdns Fix some shadowed variables reported by GCC with -Wshadow --- diff --git a/pdns/dnssecinfra.cc b/pdns/dnssecinfra.cc index 7525eed64..9eec20c21 100644 --- a/pdns/dnssecinfra.cc +++ b/pdns/dnssecinfra.cc @@ -127,7 +127,6 @@ shared_ptr DNSCryptoKeyEngine::makeFromISCString(DNSKEYRecor std::string DNSCryptoKeyEngine::convertToISC() const { - typedef map stormap_t; storvector_t stormap = this->convertToISCVector(); ostringstream ret; ret<<"Private-key-format: v1.2\n"; diff --git a/pdns/lua-base4.cc b/pdns/lua-base4.cc index a46821367..6e8ef5107 100644 --- a/pdns/lua-base4.cc +++ b/pdns/lua-base4.cc @@ -179,10 +179,10 @@ void BaseLua4::prepareContext() { d_lw->registerFunction(DNSRecord::*)()>("getCA", [](const DNSRecord& dr) { boost::optional ret; - if(auto rec = std::dynamic_pointer_cast(dr.d_content)) - ret=rec->getCA(53); - else if(auto rec = std::dynamic_pointer_cast(dr.d_content)) - ret=rec->getCA(53); + if(auto arec = std::dynamic_pointer_cast(dr.d_content)) + ret=arec->getCA(53); + else if(auto aaaarec = std::dynamic_pointer_cast(dr.d_content)) + ret=aaaarec->getCA(53); return ret; }); d_lw->registerFunction("changeContent", [](DNSRecord& dr, const std::string& newContent) { dr.d_content = shared_ptr(DNSRecordContent::mastermake(dr.d_type, 1, newContent)); }); diff --git a/pdns/misc.cc b/pdns/misc.cc index 6efb3f6da..9e671aab8 100644 --- a/pdns/misc.cc +++ b/pdns/misc.cc @@ -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& fds, const int seconds, const int useconds, int* fd) { +int waitForMultiData(const set& fds, const int seconds, const int useconds, int* fdOut) { set realFDs; for (const auto& fd : fds) { if (fd >= 0 && realFDs.count(fd) == 0) { @@ -384,7 +384,7 @@ int waitForMultiData(const set& fds, const int seconds, const int useconds, } set::const_iterator it(pollinFDs.begin()); advance(it, random() % pollinFDs.size()); - *fd = *it; + *fdOut = *it; return 1; } diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 9ffab649f..133534652 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -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; diff --git a/pdns/recursor_cache.cc b/pdns/recursor_cache.cc index 8dc896d9e..7dea10c39 100644 --- a/pdns/recursor_cache.cc +++ b/pdns/recursor_cache.cc @@ -320,10 +320,8 @@ int MemRecursorCache::doWipeCache(const DNSName& name, bool sub, uint16_t qtype) { int count=0; d_cachecachevalid=false; - pair range; if(!sub) { - pair ecsIndexRange; auto& idx = d_cache.get(); auto range = idx.equal_range(name); for(auto& i=range.first; i != range.second; ) {