From f8a45917df8f177acd64666a74e9f01679cec9b6 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Fri, 30 Sep 2016 22:50:57 +0200 Subject: [PATCH] fix a few 'types may not be defined in a for-range-declaration' warnings --- pdns/calidns.cc | 2 +- pdns/nameserver.cc | 4 ++-- pdns/pdnsutil.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pdns/calidns.cc b/pdns/calidns.cc index ae70849099..a64112755b 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 a806adb307..4a94b0e197 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 18fdadf2b4..065b70fd8a 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++; } -- 2.47.2