From: Kees Monshouwer Date: Fri, 30 Sep 2016 20:50:57 +0000 (+0200) Subject: fix a few 'types may not be defined in a for-range-declaration' warnings X-Git-Tag: auth-4.0.2~19^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8a45917df8f177acd64666a74e9f01679cec9b6;p=pdns fix a few 'types may not be defined in a for-range-declaration' warnings --- diff --git a/pdns/calidns.cc b/pdns/calidns.cc index ae7084909..a64112755 100644 --- a/pdns/calidns.cc +++ b/pdns/calidns.cc @@ -70,7 +70,7 @@ void* recvThread(const vector* sockets) unixDie("Unable to poll for new UDP events"); } - for(struct pollfd &pfd : fds) { + for(auto &pfd : fds) { if(pfd.revents & POLLIN) { if((err=recvmmsg(pfd.fd, &buf[0], buf.size(), MSG_WAITFORONE, 0)) < 0 ) { diff --git a/pdns/nameserver.cc b/pdns/nameserver.cc index a806adb30..4a94b0e19 100644 --- a/pdns/nameserver.cc +++ b/pdns/nameserver.cc @@ -321,7 +321,7 @@ DNSPacket *UDPNameserver::receive(DNSPacket *prefilled) int err; vector rfds= d_rfds; - for(struct pollfd &pfd : rfds) { + for(auto &pfd : rfds) { pfd.events = POLLIN; pfd.revents = 0; } @@ -335,7 +335,7 @@ DNSPacket *UDPNameserver::receive(DNSPacket *prefilled) unixDie("Unable to poll for new UDP events"); } - for(struct pollfd &pfd : rfds) { + for(auto &pfd : rfds) { if(pfd.revents & POLLIN) { sock=pfd.fd; if((len=recvmsg(sock, &msgh, 0)) < 0 ) { diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 18fdadf2b..065b70fd8 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -3150,7 +3150,7 @@ loadMainConfig(g_vm["config-dir"].as()); // move tsig keys std::vector tkeys; if (src->getTSIGKeys(tkeys)) { - for(const struct TSIGKey& tk: tkeys) { + for(auto& tk: tkeys) { if (!tgt->setTSIGKey(tk.name, tk.algorithm, tk.key)) throw PDNSException("Failed to feed TSIG key"); ntk++; }