]> granicus.if.org Git - pdns/commitdiff
fix a few 'types may not be defined in a for-range-declaration' warnings
authorKees Monshouwer <mind04@monshouwer.org>
Fri, 30 Sep 2016 20:50:57 +0000 (22:50 +0200)
committermind04 <mind04@monshouwer.org>
Wed, 5 Oct 2016 08:49:27 +0000 (10:49 +0200)
pdns/calidns.cc
pdns/nameserver.cc
pdns/pdnsutil.cc

index ae7084909929f9046dd0ab4952c5ae9355070348..a64112755b253ec92ba5ec67624113aa41282b64 100644 (file)
@@ -70,7 +70,7 @@ void* recvThread(const vector<Socket*>* 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 ) {
index a806adb307667df70097310a3acbe1d63f8a77fa..4a94b0e197a57fdacc295f3db0d1c6702c2b13ea 100644 (file)
@@ -321,7 +321,7 @@ DNSPacket *UDPNameserver::receive(DNSPacket *prefilled)
   int err;
   vector<struct pollfd> 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 ) {
index 18fdadf2b41c9b4909200833e082feff6adef54d..065b70fd8a6b0fb7bd9cc9be10cae91b4d67e0f2 100644 (file)
@@ -3150,7 +3150,7 @@ loadMainConfig(g_vm["config-dir"].as<string>());
     // move tsig keys
     std::vector<struct TSIGKey> 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++;
       }