]> git.ipfire.org Git - thirdparty/pdns.git/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>
Fri, 30 Sep 2016 20:58:08 +0000 (22:58 +0200)
pdns/calidns.cc
pdns/nameserver.cc
pdns/pdnsutil.cc

index 94b099ad23ec671db36405f44cecff771f8b1a9a..44e87e11a0f2876a83b3fece98cec03d50f1a791 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 5d1a123c0b7f2b50a13613c5c612a95fbea5a592..408ace66e9444cd54fd60c808de1428453e0326b 100644 (file)
@@ -3200,7 +3200,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++;
       }