From: bert hubert Date: Thu, 26 Nov 2015 19:26:46 +0000 (+0100) Subject: remove all the obviously translatable uses of BOOST_FOREACH X-Git-Tag: dnsdist-1.0.0-alpha1~176^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef7cd0215532e713dd47a5cb88963ad6761494f3;p=pdns remove all the obviously translatable uses of BOOST_FOREACH --- diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index a72067147..2912b7b5c 100644 --- a/modules/bindbackend/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -302,7 +302,7 @@ void Bind2Backend::getUpdatedMasters(vector *changedDomains) } SOAData soadata; - BOOST_FOREACH(DomainInfo& di, consider) { + for(DomainInfo& di : consider) { soadata.serial=0; try { this->getSOA(di.zone, soadata); // we might not *have* a SOA yet, but this might trigger a load of it @@ -343,7 +343,7 @@ void Bind2Backend::getAllDomains(vector *domains, bool include_disab }; } - BOOST_FOREACH(DomainInfo &di, *domains) { + for(DomainInfo &di : *domains) { this->getSOA(di.zone, soadata); di.serial=soadata.serial; } @@ -368,7 +368,7 @@ void Bind2Backend::getUnfreshSlaveInfos(vector *unfreshDomains) } } - BOOST_FOREACH(DomainInfo &sd, domains) { + for(DomainInfo &sd : domains) { SOAData soadata; soadata.refresh=0; soadata.serial=0; @@ -649,12 +649,12 @@ void Bind2Backend::fixupAuth(shared_ptr records) DNSName sqname; recordstorage_t nssets; - BOOST_FOREACH(const Bind2DNSRecord& bdr, *records) { + for(const Bind2DNSRecord& bdr : *records) { if(bdr.qtype==QType::NS) nssets.insert(bdr); } - BOOST_FOREACH(const Bind2DNSRecord& bdr, *records) { + for(const Bind2DNSRecord& bdr : *records) { bdr.auth=true; if(bdr.qtype == QType::DS) // as are delegation signer records @@ -754,7 +754,7 @@ void Bind2Backend::loadConfig(string* status) set oldnames, newnames; { ReadLock rl(&s_state_lock); - BOOST_FOREACH(const BB2DomainInfo& bbd, s_state) { + for(const BB2DomainInfo& bbd : s_state) { oldnames.insert(bbd.d_name); } } @@ -954,7 +954,7 @@ bool Bind2Backend::getBeforeAndAfterNamesAbsolute(uint32_t id, const std::string typedef recordstorage_t::index::type records_by_hashindex_t; records_by_hashindex_t& hashindex=boost::multi_index::get(*bbd.d_records.getWRITABLE()); // needlessly dangerous -// BOOST_FOREACH(const Bind2DNSRecord& bdr, hashindex) { +// for(const Bind2DNSRecord& bdr : hashindex) { // cerr<<"Hash: "<()); @@ -109,7 +109,7 @@ void GeoIPBackend::initialize() { DNSName qname = DNSName(recs->first.as()); vector rrs; - BOOST_FOREACH(YAML::Node item, recs->second) { + for(YAML::Node item : recs->second) { YAML::const_iterator rec = item.begin(); DNSResourceRecord rr; rr.domain_id = dom.id; @@ -645,7 +645,7 @@ void GeoIPBackend::rediscover(string* status) { bool GeoIPBackend::getDomainInfo(const DNSName& domain, DomainInfo &di) { ReadLock rl(&s_state_lock); - BOOST_FOREACH(GeoIPDomain dom, s_domains) { + for(GeoIPDomain dom : s_domains) { if (dom.domain == domain) { SOAData sd; this->getSOA(domain, sd); @@ -664,7 +664,7 @@ bool GeoIPBackend::getAllDomainMetadata(const DNSName& name, std::map& keys) { if (!d_dnssec) return false; ReadLock rl(&s_state_lock); - BOOST_FOREACH(GeoIPDomain dom, s_domains) { + for(GeoIPDomain dom : s_domains) { if (dom.domain == name) { regex_t reg; regmatch_t regm[5]; @@ -740,7 +740,7 @@ bool GeoIPBackend::removeDomainKey(const DNSName& name, unsigned int id) { WriteLock rl(&s_state_lock); ostringstream path; - BOOST_FOREACH(GeoIPDomain dom, s_domains) { + for(GeoIPDomain dom : s_domains) { if (dom.domain == name) { regex_t reg; regmatch_t regm[5]; @@ -774,7 +774,7 @@ int GeoIPBackend::addDomainKey(const DNSName& name, const KeyData& key) { WriteLock rl(&s_state_lock); int nextid=1; - BOOST_FOREACH(GeoIPDomain dom, s_domains) { + for(GeoIPDomain dom : s_domains) { if (dom.domain == name) { regex_t reg; regmatch_t regm[5]; @@ -807,7 +807,7 @@ int GeoIPBackend::addDomainKey(const DNSName& name, const KeyData& key) { bool GeoIPBackend::activateDomainKey(const DNSName& name, unsigned int id) { if (!d_dnssec) return false; WriteLock rl(&s_state_lock); - BOOST_FOREACH(GeoIPDomain dom, s_domains) { + for(GeoIPDomain dom : s_domains) { if (dom.domain == name) { regex_t reg; regmatch_t regm[5]; @@ -840,7 +840,7 @@ bool GeoIPBackend::activateDomainKey(const DNSName& name, unsigned int id) { bool GeoIPBackend::deactivateDomainKey(const DNSName& name, unsigned int id) { if (!d_dnssec) return false; WriteLock rl(&s_state_lock); - BOOST_FOREACH(GeoIPDomain dom, s_domains) { + for(GeoIPDomain dom : s_domains) { if (dom.domain == name) { regex_t reg; regmatch_t regm[5]; diff --git a/modules/mydnsbackend/mydnsbackend.hh b/modules/mydnsbackend/mydnsbackend.hh index 0c28203d9..360fe8d15 100644 --- a/modules/mydnsbackend/mydnsbackend.hh +++ b/modules/mydnsbackend/mydnsbackend.hh @@ -38,4 +38,4 @@ private: SSqlStatement* d_anyQuery_stmt; }; -#endif /* MYDNSBACKEND_HH */ \ No newline at end of file +#endif /* MYDNSBACKEND_HH */ diff --git a/modules/remotebackend/remotebackend.cc b/modules/remotebackend/remotebackend.cc index 35335d8c3..ae9bd6e7a 100644 --- a/modules/remotebackend/remotebackend.cc +++ b/modules/remotebackend/remotebackend.cc @@ -118,7 +118,7 @@ int RemoteBackend::build() { stringtok(parts, opts, ","); // find out some options and parse them while we're at it - BOOST_FOREACH(std::string opt, parts) { + for(std::string opt : parts) { std::string key,val; // make sure there is something else than air in the option... if (opt.find_first_not_of(" ") == std::string::npos) continue; @@ -363,7 +363,7 @@ bool RemoteBackend::setDomainMetadata(const DNSName& name, const std::string& ki JSON_ADD_MEMBER_DNSNAME(parameters, "name", name, query.GetAllocator()); JSON_ADD_MEMBER(parameters, "kind", kind.c_str(), query.GetAllocator()); val.SetArray(); - BOOST_FOREACH(std::string value, meta) { + for(std::string value : meta) { val.PushBack(value.c_str(), query.GetAllocator()); } parameters.AddMember("value", val, query.GetAllocator()); diff --git a/modules/remotebackend/test-remotebackend.cc b/modules/remotebackend/test-remotebackend.cc index bf5e7c9e7..b1bc9b457 100644 --- a/modules/remotebackend/test-remotebackend.cc +++ b/modules/remotebackend/test-remotebackend.cc @@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(test_method_getDomainKeys) { // but not fatal if (keys.size() > 1) { // check that we have two keys - BOOST_FOREACH(DNSBackend::KeyData &kd, keys) { + for(DNSBackend::KeyData &kd : keys) { BOOST_CHECK(kd.id > 0); BOOST_CHECK(kd.flags == 256 || kd.flags == 257); BOOST_CHECK(kd.active == true); diff --git a/pdns/arguments.cc b/pdns/arguments.cc index 82bf9dfb8..de2a2fb59 100644 --- a/pdns/arguments.cc +++ b/pdns/arguments.cc @@ -451,7 +451,7 @@ bool ArgvMap::file(const char *fname, bool lax, bool included) if (!included && !params["include-dir"].empty()) { std::vector extraConfigs; gatherIncludes(extraConfigs); - BOOST_FOREACH(const std::string& fn, extraConfigs) { + for(const std::string& fn : extraConfigs) { if (!file(fn.c_str(), lax, true)) { L << Logger::Error << fn << " could not be parsed" << std::endl; throw ArgException(fn + " could not be parsed"); diff --git a/pdns/auth-carbon.cc b/pdns/auth-carbon.cc index c9aa54ad5..dab3c713e 100644 --- a/pdns/auth-carbon.cc +++ b/pdns/auth-carbon.cc @@ -44,7 +44,7 @@ try hostname=tmp; boost::replace_all(hostname, ".", "_"); } - BOOST_FOREACH(const string& entry, entries) { + for(const string& entry : entries) { str<<"pdns."<getQueueSize(); // this does locking and other things, so don't get smart diff --git a/pdns/dbdnsseckeeper.cc b/pdns/dbdnsseckeeper.cc index 1c97c1b5e..83d2d99f3 100644 --- a/pdns/dbdnsseckeeper.cc +++ b/pdns/dbdnsseckeeper.cc @@ -59,7 +59,7 @@ bool DNSSECKeeper::isSecuredZone(const DNSName& zone) keyset_t keys = getKeys(zone); // does the cache - BOOST_FOREACH(keyset_t::value_type& val, keys) { + for(keyset_t::value_type& val : keys) { if(val.second.active) { return true; } @@ -142,7 +142,7 @@ DNSSECPrivateKey DNSSECKeeper::getKeyById(const DNSName& zname, unsigned int id) { vector keys; d_keymetadb->getDomainKeys(zname, 0, keys); - BOOST_FOREACH(const DNSBackend::KeyData& kd, keys) { + for(const DNSBackend::KeyData& kd : keys) { if(kd.id != id) continue; @@ -381,7 +381,7 @@ DNSSECKeeper::keyset_t DNSSECKeeper::getKeys(const DNSName& zone, boost::tribool if(iter != s_keycache.end() && iter->d_ttd > now) { keyset_t ret; - BOOST_FOREACH(const keyset_t::value_type& value, iter->d_keys) { + for(const keyset_t::value_type& value : iter->d_keys) { if(boost::indeterminate(allOrKeyOrZone) || allOrKeyOrZone == value.second.keyOrZone) ret.push_back(value); } @@ -393,7 +393,7 @@ DNSSECKeeper::keyset_t DNSSECKeeper::getKeys(const DNSName& zone, boost::tribool d_keymetadb->getDomainKeys(zone, 0, dbkeyset); - BOOST_FOREACH(DNSBackend::KeyData& kd, dbkeyset) + for(DNSBackend::KeyData& kd : dbkeyset) { DNSSECPrivateKey dpk; @@ -472,7 +472,7 @@ bool DNSSECKeeper::TSIGGrantsAccess(const DNSName& zone, const DNSName& keyname) d_keymetadb->getDomainMetadata(zone, "TSIG-ALLOW-AXFR", allowed); - BOOST_FOREACH(const string& dbkey, allowed) { + for(const string& dbkey : allowed) { if(DNSName(dbkey)==keyname) return true; } @@ -486,7 +486,7 @@ bool DNSSECKeeper::getTSIGForAccess(const DNSName& zone, const string& master, D keyname->trimToLabels(0); // XXX FIXME this should check for a specific master! - BOOST_FOREACH(const string& dbkey, keynames) { + for(const string& dbkey : keynames) { *keyname=DNSName(dbkey); return true; } diff --git a/pdns/dnsbulktest.cc b/pdns/dnsbulktest.cc index d6abc139d..1c0985168 100644 --- a/pdns/dnsbulktest.cc +++ b/pdns/dnsbulktest.cc @@ -164,7 +164,7 @@ struct SendReceive // cerr<<"Slow: "<d_packetsize=val.first.d_class; diff --git a/pdns/dnsscope.cc b/pdns/dnsscope.cc index 8dd175862..ff5cba0d0 100644 --- a/pdns/dnsscope.cc +++ b/pdns/dnsscope.cc @@ -60,7 +60,7 @@ public: servfails+=rhs.servfails; drops+=rhs.drops; - BOOST_FOREACH(const remotes_t::value_type& rem, rhs.remotes) { + for(const remotes_t::value_type& rem : rhs.remotes) { remotes[rem.first]+=rem.second; } return *this; @@ -93,7 +93,7 @@ StatNode::Stat StatNode::print(int depth, Stat newstat, bool silent) const if(children.size()>1024 && !silent) { cout<1024); } if(!silent || children.size()>1) @@ -122,7 +122,7 @@ void StatNode::visit(visitor_t visitor, Stat &newstat, int depth) const Stat selfstat(childstat); - BOOST_FOREACH(const children_t::value_type& child, children) { + for(const children_t::value_type& child : children) { child.second.visit(visitor, childstat, depth+8); } @@ -158,7 +158,7 @@ void StatNode::submit(deque& labels, const std::string& domain, int rcod if(labels.empty()) return; // cerr<<"Submit called for domain='"< 0.8 && node->children.size()>100) { cout<fullname<<", servfails: "<children.size()<fullname<<"\t"< val.second.d_answercount) @@ -558,7 +558,7 @@ try ofstream load(g_vm["load-stats"].as().c_str()); if(!load) throw runtime_error("Error writing load statistics to "+g_vm["load-stats"].as()); - BOOST_FOREACH(pcounts_t::value_type& val, pcounts) { + for(pcounts_t::value_type& val : pcounts) { load<convertToISCVector(); ostringstream ret; ret<<"Private-key-format: v1.2\n"; - BOOST_FOREACH(const stormap_t::value_type& value, stormap) { + for(const stormap_t::value_type& value : stormap) { if(value.first != "Algorithm" && value.first != "PIN" && value.first != "Slot" && value.first != "Engine" && value.first != "Label") @@ -144,14 +144,14 @@ bool DNSCryptoKeyEngine::testAll() { bool ret=true; - BOOST_FOREACH(const allmakers_t::value_type& value, getAllMakers()) + for(const allmakers_t::value_type& value : getAllMakers()) { - BOOST_FOREACH(maker_t* creator, value.second) { + for(maker_t* creator : value.second) { - BOOST_FOREACH(maker_t* signer, value.second) { + for(maker_t* signer : value.second) { // multi_map bestSigner, bestVerifier; - BOOST_FOREACH(maker_t* verifier, value.second) { + for(maker_t* verifier : value.second) { try { /* pair res=*/ testMakers(value.first, creator, signer, verifier); } @@ -171,12 +171,12 @@ bool DNSCryptoKeyEngine::testOne(int algo) { bool ret=true; - BOOST_FOREACH(maker_t* creator, getAllMakers()[algo]) { + for(maker_t* creator : getAllMakers()[algo]) { - BOOST_FOREACH(maker_t* signer, getAllMakers()[algo]) { + for(maker_t* signer : getAllMakers()[algo]) { // multi_map bestSigner, bestVerifier; - BOOST_FOREACH(maker_t* verifier, getAllMakers()[algo]) { + for(maker_t* verifier : getAllMakers()[algo]) { try { /* pair res=*/testMakers(algo, creator, signer, verifier); } @@ -279,7 +279,7 @@ DNSCryptoKeyEngine* DNSCryptoKeyEngine::makeFromPublicKeyString(unsigned int alg DNSCryptoKeyEngine* DNSCryptoKeyEngine::makeFromPEMString(DNSKEYRecordContent& drc, const std::string& raw) { - BOOST_FOREACH(makers_t::value_type& val, getMakers()) + for(makers_t::value_type& val : getMakers()) { DNSCryptoKeyEngine* ret=0; try { @@ -309,7 +309,7 @@ string getMessageForRRSET(const DNSName& qname, const RRSIGRecordContent& rrc, v toHash.append(const_cast(rrc).serialize(DNSName(), true, true)); toHash.resize(toHash.size() - rrc.d_signature.length()); // chop off the end, don't sign the signature! - BOOST_FOREACH(shared_ptr& add, signRecords) { + for(shared_ptr& add : signRecords) { toHash.append(qname.toDNSString()); // FIXME400 tolower? uint16_t tmp=htons(rrc.d_type); toHash.append((char*)&tmp, 2); diff --git a/pdns/dnssecsigner.cc b/pdns/dnssecsigner.cc index 52beb9370..962824024 100644 --- a/pdns/dnssecsigner.cc +++ b/pdns/dnssecsigner.cc @@ -57,7 +57,7 @@ int getRRSIGsForRRSET(DNSSECKeeper& dk, const DNSName& signer, const DNSName sig set algoHasKSK, algoHasZSK; vector signingKeys; - BOOST_FOREACH(DNSSECKeeper::keyset_t::value_type& keymeta, keys) { + for(DNSSECKeeper::keyset_t::value_type& keymeta : keys) { if(keymeta.second.active) { if(keymeta.second.keyOrZone) algoHasKSK.insert(keymeta.first.d_algorithm); @@ -66,7 +66,7 @@ int getRRSIGsForRRSET(DNSSECKeeper& dk, const DNSName& signer, const DNSName sig } } - BOOST_FOREACH(DNSSECKeeper::keyset_t::value_type& keymeta, keys) { + for(DNSSECKeeper::keyset_t::value_type& keymeta : keys) { if(!keymeta.second.active) continue; @@ -83,7 +83,7 @@ int getRRSIGsForRRSET(DNSSECKeeper& dk, const DNSName& signer, const DNSName sig signingKeys.push_back(keymeta.first); } - BOOST_FOREACH(DNSSECPrivateKey& dpk, signingKeys) { + for(DNSSECPrivateKey& dpk : signingKeys) { fillOutRRSIG(dpk, signQName, rrc, toSign); rrcs.push_back(rrc); } @@ -118,7 +118,7 @@ void addSignature(DNSSECKeeper& dk, UeberBackend& db, const DNSName& signer, con rr.ttl=signTTL; rr.auth=false; rr.d_place = signPlace; - BOOST_FOREACH(RRSIGRecordContent& rrc, rrcs) { + for(RRSIGRecordContent& rrc : rrcs) { rr.content = rrc.getZoneRepresentation(); outsigned.push_back(rr); } diff --git a/pdns/dnstcpbench.cc b/pdns/dnstcpbench.cc index 4b9ee08d0..a2ce90245 100644 --- a/pdns/dnstcpbench.cc +++ b/pdns/dnstcpbench.cc @@ -280,13 +280,13 @@ try typedef map counts_t; counts_t counts; - BOOST_FOREACH(const BenchQuery& bq, g_queries) { + for(const BenchQuery& bq : g_queries) { counts[bq.answerSecond]++; udpspeeds(bq.udpUsec); tcpspeeds(bq.tcpUsec); } - BOOST_FOREACH(const counts_t::value_type& val, counts) { + for(const counts_t::value_type& val : counts) { qps(val.second); } diff --git a/pdns/dnswriter.cc b/pdns/dnswriter.cc index 9205108f4..f1b06965e 100644 --- a/pdns/dnswriter.cc +++ b/pdns/dnswriter.cc @@ -160,7 +160,7 @@ void DNSPacketWriter::xfrText(const string& text, bool) return; } vector segments = segmentDNSText(text); - BOOST_FOREACH(const string& str, segments) { + for(const string& str : segments) { d_record.push_back(str.length()); d_record.insert(d_record.end(), str.c_str(), str.c_str() + str.length()); } diff --git a/pdns/dynhandler.cc b/pdns/dynhandler.cc index d8701a2e8..472fd692a 100644 --- a/pdns/dynhandler.cc +++ b/pdns/dynhandler.cc @@ -183,7 +183,7 @@ string DLRSizesHandler(const vector&parts, Utility::pid_t ppid) respsizes_t respsizes = g_rs.getSizeResponseCounts(); ostringstream os; boost::format fmt("%d\t%d\n"); - BOOST_FOREACH(const respsizes_t::value_type& val, respsizes) { + for(const respsizes_t::value_type& val : respsizes) { os << (fmt % val.first % val.second).str(); } return os.str(); @@ -196,7 +196,7 @@ string DLRemotesHandler(const vector&parts, Utility::pid_t ppid) totals_t totals = S.getRing("remotes"); string ret; boost::format fmt("%s\t%d\n"); - BOOST_FOREACH(totals_t::value_type& val, totals) { + for(totals_t::value_type& val : totals) { ret += (fmt % val.first % val.second).str(); } return ret; diff --git a/pdns/gss_context.cc b/pdns/gss_context.cc index 8ea3747c8..e817c40fb 100644 --- a/pdns/gss_context.cc +++ b/pdns/gss_context.cc @@ -436,7 +436,7 @@ bool gss_add_signature(const DNSName& context, const std::string& message, std:: GssContext gssctx(context); if (!gssctx.valid()) { L<& items) Document doc; doc.SetObject(); typedef map items_t; - BOOST_FOREACH(const items_t::value_type& val, items) { + for(const items_t::value_type& val : items) { doc.AddMember(val.first.c_str(), val.second.c_str(), doc.GetAllocator()); } return makeStringFromDocument(doc); diff --git a/pdns/lua-auth.cc b/pdns/lua-auth.cc index 672161780..2be0c3ac3 100644 --- a/pdns/lua-auth.cc +++ b/pdns/lua-auth.cc @@ -177,7 +177,7 @@ static int ldp_addRecords(lua_State *L) { DNSPacket *p=ldp_checkDNSPacket(L); vector rrs; popResourceRecordsTable(L, DNSName("BOGUS"), rrs); - BOOST_FOREACH(const DNSRecord& dr, rrs) { + for(const DNSRecord& dr : rrs) { p->addRecord(DNSResourceRecord(dr)); } return 0; diff --git a/pdns/lua-recursor.cc b/pdns/lua-recursor.cc index 2726f4053..b5c9bd972 100644 --- a/pdns/lua-recursor.cc +++ b/pdns/lua-recursor.cc @@ -85,7 +85,7 @@ int followCNAMERecords(vector& ret, const QType& qtype) { vector resolved; string target; // XXX DNSNAME PAIN - BOOST_FOREACH(DNSRecord& rr, ret) { + for(DNSRecord& rr : ret) { if(rr.d_type == QType::CNAME) { target=std::dynamic_pointer_cast(rr.d_content)->getTarget().toString(); break; @@ -99,7 +99,7 @@ int followCNAMERecords(vector& ret, const QType& qtype) int rcode=directResolve(target, qtype, 1, resolved); // 1 == class - BOOST_FOREACH(const DNSRecord& rr, resolved) + for(const DNSRecord& rr : resolved) { ret.push_back(rr); } @@ -114,7 +114,7 @@ int getFakeAAAARecords(const std::string& qname, const std::string& prefix, vect ComboAddress prefixAddress(prefix); - BOOST_FOREACH(DNSRecord& rr, ret) + for(DNSRecord& rr : ret) { if(rr.d_type == QType::A && rr.d_place==DNSResourceRecord::ANSWER) { ComboAddress ipv4(std::dynamic_pointer_cast(rr.d_content)->getCA()); @@ -149,7 +149,7 @@ int getFakePTRRecords(const DNSName& qname, const std::string& prefix, vector rfds= d_rfds; - BOOST_FOREACH(struct pollfd &pfd, rfds) { + for(struct pollfd &pfd : rfds) { pfd.events = POLLIN; pfd.revents = 0; } @@ -337,7 +337,7 @@ DNSPacket *UDPNameserver::receive(DNSPacket *prefilled) unixDie("Unable to poll for new UDP events"); } - BOOST_FOREACH(struct pollfd &pfd, rfds) { + for(struct pollfd &pfd : rfds) { if(pfd.revents & POLLIN) { sock=pfd.fd; if((len=recvmsg(sock, &msgh, 0)) < 0 ) { diff --git a/pdns/pkcs11signers.cc b/pdns/pkcs11signers.cc index 8db7a2667..e42f12520 100644 --- a/pdns/pkcs11signers.cc +++ b/pdns/pkcs11signers.cc @@ -385,13 +385,13 @@ class Pkcs11Token { privAttr = new CK_ATTRIBUTE[privAttributes.size()]; k = 0; - BOOST_FOREACH(P11KitAttribute& attribute, pubAttributes) { + for(P11KitAttribute& attribute : pubAttributes) { attribute.rattr(pubAttr+k); k++; } k = 0; - BOOST_FOREACH(P11KitAttribute& attribute, privAttributes) { + for(P11KitAttribute& attribute : privAttributes) { attribute.rattr(privAttr+k); k++; } @@ -508,7 +508,7 @@ class Pkcs11Token { attr = new CK_ATTRIBUTE[attributes.size()]; k = 0; - BOOST_FOREACH(const P11KitAttribute& attribute, attributes) { + for(const P11KitAttribute& attribute : attributes) { attribute.rattr(attr+k); k++; } @@ -557,7 +557,7 @@ class Pkcs11Token { attr = new CK_ATTRIBUTE[attributes.size()]; k = 0; - BOOST_FOREACH(P11KitAttribute &attribute, attributes) { + for(P11KitAttribute &attribute : attributes) { attribute.wattr(attr+k); k++; } diff --git a/pdns/pubsuffix.hh b/pdns/pubsuffix.hh index 530a0e262..abf9570aa 100644 --- a/pdns/pubsuffix.hh +++ b/pdns/pubsuffix.hh @@ -1,3 +1,3 @@ #ifndef PDNS_PUBSUFFIX_HH extern const char* g_pubsuffix; -#endif \ No newline at end of file +#endif diff --git a/pdns/rec-carbon.cc b/pdns/rec-carbon.cc index d27a7c2a3..bb92a37b6 100644 --- a/pdns/rec-carbon.cc +++ b/pdns/rec-carbon.cc @@ -47,7 +47,7 @@ try hostname=tmp; boost::replace_all(hostname, ".", "_"); } - BOOST_FOREACH(const all_t::value_type& val, all) { + for(const all_t::value_type& val : all) { str<<"pdns."< extraConfigs; ::arg().gatherIncludes(extraConfigs); - BOOST_FOREACH(const std::string& fn, extraConfigs) { + for(const std::string& fn : extraConfigs) { ::arg().preParseFile(fn.c_str(), "forward-zones", ::arg()["forward-zones"]); ::arg().preParseFile(fn.c_str(), "forward-zones-file", ::arg()["forward-zones-file"]); ::arg().preParseFile(fn.c_str(), "forward-zones-recurse", ::arg()["forward-zones-recurse"]); diff --git a/pdns/resolver.cc b/pdns/resolver.cc index 2ea39e430..691380b28 100644 --- a/pdns/resolver.cc +++ b/pdns/resolver.cc @@ -272,7 +272,7 @@ bool Resolver::tryGetSOASerial(DNSName *domain, uint32_t *theirSerial, uint32_t *theirInception = *theirExpire = 0; bool gotSOA=false; - BOOST_FOREACH(const MOADNSParser::answers_t::value_type& drc, mdp.d_answers) { + for(const MOADNSParser::answers_t::value_type& drc : mdp.d_answers) { if(drc.first.d_type == QType::SOA) { shared_ptr src=std::dynamic_pointer_cast(drc.first.d_content); *theirSerial=src->d_st.serial; @@ -466,7 +466,7 @@ int AXFRRetriever::getChunk(Resolver::res_t &res, vector* records) // if(err) throw ResolverException("AXFR chunk error: " + RCode::to_s(err)); - BOOST_FOREACH(const MOADNSParser::answers_t::value_type& answer, mdp.d_answers) + for(const MOADNSParser::answers_t::value_type& answer : mdp.d_answers) if (answer.first.d_type == QType::SOA) d_soacount++; @@ -482,7 +482,7 @@ int AXFRRetriever::getChunk(Resolver::res_t &res, vector* records) // string theirMac; bool checkTSIG = false; - BOOST_FOREACH(const MOADNSParser::answers_t::value_type& answer, mdp.d_answers) { + for(const MOADNSParser::answers_t::value_type& answer : mdp.d_answers) { if (answer.first.d_type == QType::SOA) // A SOA is either the first or the last record. We need to check TSIG if that's the case. checkTSIG = true; diff --git a/pdns/responsestats.cc b/pdns/responsestats.cc index a310e1abf..c9634c583 100644 --- a/pdns/responsestats.cc +++ b/pdns/responsestats.cc @@ -68,7 +68,7 @@ string ResponseStats::getQTypeReport() qtypenums_t qtypenums = getQTypeResponseCounts(); ostringstream os; boost::format fmt("%s\t%d\n"); - BOOST_FOREACH(const qtypenums_t::value_type& val, qtypenums) { + for(const qtypenums_t::value_type& val : qtypenums) { os << (fmt %DNSRecordContent::NumberToType( val.first) % val.second).str(); } return os.str(); diff --git a/pdns/rfc2136handler.cc b/pdns/rfc2136handler.cc index fecb1487c..87cbbe21d 100644 --- a/pdns/rfc2136handler.cc +++ b/pdns/rfc2136handler.cc @@ -411,7 +411,7 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, DNSName shorter; string hashed; - BOOST_FOREACH(const DNSName& qname, qnames) { + for(const DNSName& qname : qnames) { shorter = qname; int ddepth = 0; do { diff --git a/pdns/saxfr.cc b/pdns/saxfr.cc index bac91e49a..3f1a2422f 100644 --- a/pdns/saxfr.cc +++ b/pdns/saxfr.cc @@ -140,7 +140,7 @@ try pwtkey.startRecord(gssctx.getLabel(), QType::TKEY, 3600, QClass::ANY, DNSResourceRecord::ADDITIONAL, false); tkrc.toPacket(pwtkey); pwtkey.commit(); - BOOST_FOREACH(const string& msg, gssctx.getErrorStrings()) { + for(const string& msg : gssctx.getErrorStrings()) { cerr<& re } L<& rrs = dp->getRRS(); - BOOST_FOREACH(DNSResourceRecord& rr, rrs) { + for(DNSResourceRecord& rr : rrs) { if(rr.qtype.getCode() == QType::SOA && rr.qname == qname) { string kind; dk.getSoaEdit(qname, kind); diff --git a/pdns/signingpipe.cc b/pdns/signingpipe.cc index e0e32e321..4fb12e27c 100644 --- a/pdns/signingpipe.cc +++ b/pdns/signingpipe.cc @@ -98,12 +98,12 @@ ChunkedSigningPipe::~ChunkedSigningPipe() delete d_rrsetToSign; if(!d_mustSign) return; - BOOST_FOREACH(int fd, d_sockets) { + for(int fd : d_sockets) { close(fd); // this will trigger all threads to exit } void* res; - BOOST_FOREACH(pthread_t& tid, d_tids) { + for(pthread_t& tid : d_tids) { pthread_join(tid, &res); } //cout<<"Did: "<& v, d_chunks) { + for(const std::vector& v : d_chunks) { sum += v.size(); } return sum; @@ -320,7 +320,7 @@ vector ChunkedSigningPipe::getChunk(bool final) d_final = true; flushToSign(); - BOOST_FOREACH(int fd, d_sockets) { + for(int fd : d_sockets) { shutdown(fd, SHUT_WR); // perhaps this transmits EOF the other side //cerr<<"shutdown of "< nonterm; - BOOST_FOREACH(DNSResourceRecord& rr, rrs) { + for(DNSResourceRecord& rr : rrs) { if(!isPresigned) { if (rr.qtype.getCode() == QType::RRSIG) @@ -540,7 +540,7 @@ void CommunicatorClass::slaveRefresh(PacketHandler *P) d_potentialsupermasters.clear(); } - BOOST_FOREACH(DNSPacket& dp, trysuperdomains) { + for(DNSPacket& dp : trysuperdomains) { int res; res=P->trySuperMasterSynchronous(&dp); if(res>=0) { @@ -560,7 +560,7 @@ void CommunicatorClass::slaveRefresh(PacketHandler *P) Lock l(&d_lock); domains_by_name_t& nameindex=boost::multi_index::get(d_suckdomains); - BOOST_FOREACH(DomainInfo& di, rdomains) { + for(DomainInfo& di : rdomains) { std::vector localaddr; SuckRequest sr; sr.domain=di.zone; @@ -637,7 +637,7 @@ void CommunicatorClass::slaveRefresh(PacketHandler *P) L<getDomainInfo(di.zone, di)) { diff --git a/pdns/statbag.cc b/pdns/statbag.cc index 8799c7ff0..88f964652 100644 --- a/pdns/statbag.cc +++ b/pdns/statbag.cc @@ -62,7 +62,7 @@ string StatBag::directory() } - BOOST_FOREACH(const funcstats_t::value_type& val, d_funcstats) { + for(const funcstats_t::value_type& val : d_funcstats) { o << val.first<<"="<StatBag::getEntries() i++) ret.push_back(i->first); - BOOST_FOREACH(const funcstats_t::value_type& val, d_funcstats) { + for(const funcstats_t::value_type& val : d_funcstats) { ret.push_back(val.first); } @@ -245,7 +245,7 @@ vector > StatBag::getRing(const string &name) typedef pair stor_t; vector raw =d_comborings[name].get(); vector > ret; - BOOST_FOREACH(const stor_t& stor, raw) { + for(const stor_t& stor : raw) { ret.push_back(make_pair(stor.first.ca.toString(), stor.second)); } return ret; diff --git a/pdns/test-base32_cc.cc b/pdns/test-base32_cc.cc index 24be0ca44..9f03ce5d6 100644 --- a/pdns/test-base32_cc.cc +++ b/pdns/test-base32_cc.cc @@ -26,7 +26,7 @@ BOOST_AUTO_TEST_CASE(test_record_types) { (case_t(std::string("foobar"), std::string("cpnmuoj1e8======"))) ; - BOOST_FOREACH(const case_t& val, cases) { + for(const case_t& val : cases) { std::string res; res = toBase32Hex(val.get<0>()); BOOST_CHECK_EQUAL(res, val.get<1>()); diff --git a/pdns/test-base64_cc.cc b/pdns/test-base64_cc.cc index 60a915f07..9e9d53f69 100644 --- a/pdns/test-base64_cc.cc +++ b/pdns/test-base64_cc.cc @@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE(test_Base64_Encode) { ("eSHBt7Xx5F7A4HFtabXEzDLD01bnSiG","ZVNIQnQ3WHg1RjdBNEhGdGFiWEV6RExEMDFiblNpRw==") ("dq4KydZjmcoQQ45VYBP2EDR8FqKaMul0","ZHE0S3lkWmptY29RUTQ1VllCUDJFRFI4RnFLYU11bDA="); - BOOST_FOREACH(const cases_t::value_type& val, cases) { + for(const cases_t::value_type& val : cases) { std::string encoded = Base64Encode(val.first), decoded; BOOST_CHECK_EQUAL(encoded, val.second); decoded.clear(); diff --git a/pdns/test-dnsrecords_cc.cc b/pdns/test-dnsrecords_cc.cc index 36f959d5d..adcc32c81 100644 --- a/pdns/test-dnsrecords_cc.cc +++ b/pdns/test-dnsrecords_cc.cc @@ -170,7 +170,7 @@ BOOST_AUTO_TEST_CASE(test_record_types) { int n=0; int lq=-1; - BOOST_FOREACH(const cases_t::value_type& val, cases) { + for(const cases_t::value_type& val : cases) { QType q(val.get<0>()); if (lq != q.getCode()) n = 0; lq = q.getCode(); @@ -252,7 +252,7 @@ BOOST_AUTO_TEST_CASE(test_record_types_bad_values) { int n=0; int lq=-1; - BOOST_FOREACH(const cases_t::value_type& val, cases) { + for(const cases_t::value_type& val : cases) { QType q(val.get<0>()); if (lq != q.getCode()) n = 0; lq = q.getCode(); diff --git a/pdns/test-misc_hh.cc b/pdns/test-misc_hh.cc index c27166071..4b220f878 100644 --- a/pdns/test-misc_hh.cc +++ b/pdns/test-misc_hh.cc @@ -71,7 +71,7 @@ BOOST_AUTO_TEST_CASE(test_pdns_ilexicographical_compare) { (case_t(std::string("Abc"), std::string("abc"), false)) ; - BOOST_FOREACH(const case_t& val, cases) { + for(const case_t& val : cases) { bool res; res = pdns_ilexicographical_compare(val.get<0>(), val.get<1>()); BOOST_CHECK_EQUAL(res, val.get<2>()); @@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(test_pdns_iequals) { (case_t(std::string("Abc"), std::string("abc"), true)) ; - BOOST_FOREACH(const case_t& val, cases) { + for(const case_t& val : cases) { bool res; res = pdns_iequals(val.get<0>(), val.get<1>()); BOOST_CHECK_EQUAL(res, val.get<2>()); diff --git a/pdns/test-sha_hh.cc b/pdns/test-sha_hh.cc index e860bac25..c88e4229e 100644 --- a/pdns/test-sha_hh.cc +++ b/pdns/test-sha_hh.cc @@ -25,7 +25,7 @@ BOOST_AUTO_TEST_CASE(test_sha1summer) { (case_t("abc", "a9 99 3e 36 47 06 81 6a ba 3e 25 71 78 50 c2 6c 9c d0 d8 9d ")) (case_t("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "84 98 3e 44 1c 3b d2 6e ba ae 4a a1 f9 51 29 e5 e5 46 70 f1 ")); - BOOST_FOREACH(case_t& val, cases) { + for(case_t& val : cases) { SHA1Summer s; s.feed(val.get<0>()); BOOST_CHECK_EQUAL(makeHexDump(s.get()), val.get<1>()); @@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE(test_sha256summer) { (case_t("abc", "ba 78 16 bf 8f 01 cf ea 41 41 40 de 5d ae 22 23 b0 03 61 a3 96 17 7a 9c b4 10 ff 61 f2 00 15 ad ")) (case_t("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "24 8d 6a 61 d2 06 38 b8 e5 c0 26 93 0c 3e 60 39 a3 3c e4 59 64 ff 21 67 f6 ec ed d4 19 db 06 c1 ")); - BOOST_FOREACH(case_t& val, cases) { + for(case_t& val : cases) { SHA256Summer s; s.feed(val.get<0>()); BOOST_CHECK_EQUAL(makeHexDump(s.get()), val.get<1>()); @@ -49,7 +49,7 @@ BOOST_AUTO_TEST_CASE(test_sha384summer) { (case_t("abc", "cb 00 75 3f 45 a3 5e 8b b5 a0 3d 69 9a c6 50 07 27 2c 32 ab 0e de d1 63 1a 8b 60 5a 43 ff 5b ed 80 86 07 2b a1 e7 cc 23 58 ba ec a1 34 c8 25 a7 ")) (case_t("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "33 91 fd dd fc 8d c7 39 37 07 a6 5b 1b 47 09 39 7c f8 b1 d1 62 af 05 ab fe 8f 45 0d e5 f3 6b c6 b0 45 5a 85 20 bc 4e 6f 5f e9 5b 1f e3 c8 45 2b ")); - BOOST_FOREACH(case_t& val, cases) { + for(case_t& val : cases) { SHA384Summer s; s.feed(val.get<0>()); BOOST_CHECK_EQUAL(makeHexDump(s.get()), val.get<1>()); @@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE(test_sha512summer) { (case_t("abc", "dd af 35 a1 93 61 7a ba cc 41 73 49 ae 20 41 31 12 e6 fa 4e 89 a9 7e a2 0a 9e ee e6 4b 55 d3 9a 21 92 99 2a 27 4f c1 a8 36 ba 3c 23 a3 fe eb bd 45 4d 44 23 64 3c e8 0e 2a 9a c9 4f a5 4c a4 9f ")) (case_t("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "20 4a 8f c6 dd a8 2f 0a 0c ed 7b eb 8e 08 a4 16 57 c1 6e f4 68 b2 28 a8 27 9b e3 31 a7 03 c3 35 96 fd 15 c1 3b 1b 07 f9 aa 1d 3b ea 57 78 9c a0 31 ad 85 c7 a7 1d d7 03 54 ec 63 12 38 ca 34 45 ")); - BOOST_FOREACH(case_t& val, cases) { + for(case_t& val : cases) { SHA512Summer s; s.feed(val.get<0>()); BOOST_CHECK_EQUAL(makeHexDump(s.get()), val.get<1>()); diff --git a/pdns/ueberbackend.cc b/pdns/ueberbackend.cc index 6de8c33ea..308d44d3d 100644 --- a/pdns/ueberbackend.cc +++ b/pdns/ueberbackend.cc @@ -93,7 +93,7 @@ bool UeberBackend::getDomainInfo(const DNSName &domain, DomainInfo &di) bool UeberBackend::createDomain(const DNSName &domain) { - BOOST_FOREACH(DNSBackend* mydb, backends) { + for(DNSBackend* mydb : backends) { if(mydb->createDomain(domain)) { return true; } @@ -104,7 +104,7 @@ bool UeberBackend::createDomain(const DNSName &domain) int UeberBackend::addDomainKey(const DNSName& name, const DNSBackend::KeyData& key) { int ret; - BOOST_FOREACH(DNSBackend* db, backends) { + for(DNSBackend* db : backends) { if((ret = db->addDomainKey(name, key)) >= 0) return ret; } @@ -112,7 +112,7 @@ int UeberBackend::addDomainKey(const DNSName& name, const DNSBackend::KeyData& k } bool UeberBackend::getDomainKeys(const DNSName& name, unsigned int kind, std::vector& keys) { - BOOST_FOREACH(DNSBackend* db, backends) { + for(DNSBackend* db : backends) { if(db->getDomainKeys(name, kind, keys)) return true; } @@ -121,7 +121,7 @@ bool UeberBackend::getDomainKeys(const DNSName& name, unsigned int kind, std::ve bool UeberBackend::getAllDomainMetadata(const DNSName& name, std::map >& meta) { - BOOST_FOREACH(DNSBackend* db, backends) { + for(DNSBackend* db : backends) { if(db->getAllDomainMetadata(name, meta)) return true; } @@ -130,7 +130,7 @@ bool UeberBackend::getAllDomainMetadata(const DNSName& name, std::map& meta) { - BOOST_FOREACH(DNSBackend* db, backends) { + for(DNSBackend* db : backends) { if(db->getDomainMetadata(name, kind, meta)) return true; } @@ -139,7 +139,7 @@ bool UeberBackend::getDomainMetadata(const DNSName& name, const std::string& kin bool UeberBackend::setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector& meta) { - BOOST_FOREACH(DNSBackend* db, backends) { + for(DNSBackend* db : backends) { if(db->setDomainMetadata(name, kind, meta)) return true; } @@ -148,7 +148,7 @@ bool UeberBackend::setDomainMetadata(const DNSName& name, const std::string& kin bool UeberBackend::activateDomainKey(const DNSName& name, unsigned int id) { - BOOST_FOREACH(DNSBackend* db, backends) { + for(DNSBackend* db : backends) { if(db->activateDomainKey(name, id)) return true; } @@ -157,7 +157,7 @@ bool UeberBackend::activateDomainKey(const DNSName& name, unsigned int id) bool UeberBackend::deactivateDomainKey(const DNSName& name, unsigned int id) { - BOOST_FOREACH(DNSBackend* db, backends) { + for(DNSBackend* db : backends) { if(db->deactivateDomainKey(name, id)) return true; } @@ -166,7 +166,7 @@ bool UeberBackend::deactivateDomainKey(const DNSName& name, unsigned int id) bool UeberBackend::removeDomainKey(const DNSName& name, unsigned int id) { - BOOST_FOREACH(DNSBackend* db, backends) { + for(DNSBackend* db : backends) { if(db->removeDomainKey(name, id)) return true; } @@ -176,7 +176,7 @@ bool UeberBackend::removeDomainKey(const DNSName& name, unsigned int id) bool UeberBackend::getTSIGKey(const DNSName& name, DNSName* algorithm, string* content) { - BOOST_FOREACH(DNSBackend* db, backends) { + for(DNSBackend* db : backends) { if(db->getTSIGKey(name, algorithm, content)) return true; } @@ -186,7 +186,7 @@ bool UeberBackend::getTSIGKey(const DNSName& name, DNSName* algorithm, string* c bool UeberBackend::setTSIGKey(const DNSName& name, const DNSName& algorithm, const string& content) { - BOOST_FOREACH(DNSBackend* db, backends) { + for(DNSBackend* db : backends) { if(db->setTSIGKey(name, algorithm, content)) return true; } @@ -195,7 +195,7 @@ bool UeberBackend::setTSIGKey(const DNSName& name, const DNSName& algorithm, con bool UeberBackend::deleteTSIGKey(const DNSName& name) { - BOOST_FOREACH(DNSBackend* db, backends) { + for(DNSBackend* db : backends) { if(db->deleteTSIGKey(name)) return true; } @@ -204,7 +204,7 @@ bool UeberBackend::deleteTSIGKey(const DNSName& name) bool UeberBackend::getTSIGKeys(std::vector< struct TSIGKey > &keys) { - BOOST_FOREACH(DNSBackend* db, backends) { + for(DNSBackend* db : backends) { db->getTSIGKeys(keys); } return true; diff --git a/pdns/ws-api.cc b/pdns/ws-api.cc index 6f5026fbb..e708f4ab8 100644 --- a/pdns/ws-api.cc +++ b/pdns/ws-api.cc @@ -123,7 +123,7 @@ void apiServerConfig(HttpRequest* req, HttpResponse* resp) { string value; Document doc; doc.SetArray(); - BOOST_FOREACH(const string& item, items) { + for(const string& item : items) { Value jitem; jitem.SetObject(); jitem.AddMember("type", "ConfigSetting", doc.GetAllocator()); @@ -179,7 +179,7 @@ static string logGrep(const string& q, const string& fname, const string& prefix Document doc; doc.SetArray(); if(!lines.empty()) { - BOOST_FOREACH(const string& line, lines) { + for(const string& line : lines) { doc.PushBack(line.c_str(), doc.GetAllocator()); } } @@ -204,7 +204,7 @@ void apiServerStatistics(HttpRequest* req, HttpResponse* resp) { Document doc; doc.SetArray(); typedef map items_t; - BOOST_FOREACH(const items_t::value_type& item, items) { + for(const items_t::value_type& item : items) { Value jitem; jitem.SetObject(); jitem.AddMember("type", "StatisticItem", doc.GetAllocator()); diff --git a/pdns/ws-recursor.cc b/pdns/ws-recursor.cc index af39651c6..7a996677d 100644 --- a/pdns/ws-recursor.cc +++ b/pdns/ws-recursor.cc @@ -120,7 +120,7 @@ static void apiServerConfigAllowFrom(HttpRequest* req, HttpResponse* resp) vector entries; t_allowFrom->toStringVector(&entries); - BOOST_FOREACH(const string& entry, entries) { + for(const string& entry : entries) { Value jentry(entry.c_str(), document.GetAllocator()); // copy jlist.PushBack(jentry, document.GetAllocator()); } @@ -154,7 +154,7 @@ static void fillZone(const DNSName& zonename, HttpResponse* resp) doc.AddMember("kind", zone.d_servers.empty() ? "Native" : "Forwarded", doc.GetAllocator()); Value servers; servers.SetArray(); - BOOST_FOREACH(const ComboAddress& server, zone.d_servers) { + for(const ComboAddress& server : zone.d_servers) { Value value(server.toStringWithPort().c_str(), doc.GetAllocator()); servers.PushBack(value, doc.GetAllocator()); } @@ -164,7 +164,7 @@ static void fillZone(const DNSName& zonename, HttpResponse* resp) Value records; records.SetArray(); - BOOST_FOREACH(const SyncRes::AuthDomain::records_t::value_type& dr, zone.d_records) { + for(const SyncRes::AuthDomain::records_t::value_type& dr : zone.d_records) { Value object; object.SetObject(); Value jname(dr.d_name.toString().c_str(), doc.GetAllocator()); // copy @@ -300,7 +300,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) Document doc; doc.SetArray(); - BOOST_FOREACH(const SyncRes::domainmap_t::value_type& val, *t_sstorage->domainmap) { + for(const SyncRes::domainmap_t::value_type& val : *t_sstorage->domainmap) { const SyncRes::AuthDomain& zone = val.second; Value jdi; jdi.SetObject(); @@ -315,7 +315,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) jdi.AddMember("kind", zone.d_servers.empty() ? "Native" : "Forwarded", doc.GetAllocator()); Value servers; servers.SetArray(); - BOOST_FOREACH(const ComboAddress& server, zone.d_servers) { + for(const ComboAddress& server : zone.d_servers) { Value value(server.toStringWithPort().c_str(), doc.GetAllocator()); servers.PushBack(value, doc.GetAllocator()); } @@ -371,7 +371,7 @@ static void apiServerSearchData(HttpRequest* req, HttpResponse* resp) { Document doc; doc.SetArray(); - BOOST_FOREACH(const SyncRes::domainmap_t::value_type& val, *t_sstorage->domainmap) { + for(const SyncRes::domainmap_t::value_type& val : *t_sstorage->domainmap) { string zoneId = apiZoneNameToId(val.first); if (pdns_ci_find(val.first.toString(), q) != string::npos) { Value object; @@ -391,7 +391,7 @@ static void apiServerSearchData(HttpRequest* req, HttpResponse* resp) { const SyncRes::AuthDomain& zone = val.second; - BOOST_FOREACH(const SyncRes::AuthDomain::records_t::value_type& rr, zone.d_records) { + for(const SyncRes::AuthDomain::records_t::value_type& rr : zone.d_records) { if (pdns_ci_find(rr.d_name.toString(), q) == string::npos && pdns_ci_find(rr.d_content->getZoneRepresentation(), q) == string::npos) continue; @@ -472,7 +472,7 @@ void RecursorWebServer::jsonstat(HttpRequest* req, HttpResponse *resp) typedef map counts_t; counts_t counts; unsigned int total=0; - BOOST_FOREACH(const query_t& q, queries) { + for(const query_t& q : queries) { total++; if(filter) counts[make_pair(getRegisteredName(q.first), q.second)]++; @@ -491,7 +491,7 @@ void RecursorWebServer::jsonstat(HttpRequest* req, HttpResponse *resp) Value entries; entries.SetArray(); unsigned int tot=0, totIncluded=0; - BOOST_FOREACH(const rcounts_t::value_type& q, rcounts) { + for(const rcounts_t::value_type& q : rcounts) { Value arr; arr.SetArray(); @@ -527,7 +527,7 @@ void RecursorWebServer::jsonstat(HttpRequest* req, HttpResponse *resp) typedef map counts_t; counts_t counts; unsigned int total=0; - BOOST_FOREACH(const ComboAddress& q, queries) { + for(const ComboAddress& q : queries) { total++; counts[q]++; } @@ -544,7 +544,7 @@ void RecursorWebServer::jsonstat(HttpRequest* req, HttpResponse *resp) Value entries; entries.SetArray(); unsigned int tot=0, totIncluded=0; - BOOST_FOREACH(const rcounts_t::value_type& q, rcounts) { + for(const rcounts_t::value_type& q : rcounts) { totIncluded-=q.first; Value arr; diff --git a/pdns/zone2sql.cc b/pdns/zone2sql.cc index 512a953c5..0b26a7575 100644 --- a/pdns/zone2sql.cc +++ b/pdns/zone2sql.cc @@ -129,7 +129,7 @@ static void emitDomain(const string& domain, const vector *masters = 0) if(g_mode==POSTGRES || g_mode==MYSQL || g_mode==SQLITE) { string mstrs; if (masters != 0 && ! masters->empty()) { - BOOST_FOREACH(const string& mstr, *masters) { + for(const string& mstr : *masters) { mstrs.append(mstr); mstrs.append(1, ' '); }