]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Use `auto` whenever possible with `DNSRecordContent::mastermake()` 5380/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 19 Jun 2017 15:43:02 +0000 (17:43 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 19 Jun 2017 15:43:02 +0000 (17:43 +0200)
modules/bindbackend/binddnssec.cc
modules/tinydnsbackend/tinydnsbackend.cc
pdns/speedtest.cc
pdns/ws-auth.cc

index 6f1981dd4aafdb50f0b4f0dafd09c506edd615ea..8079faa8f2801a97e711b6a26ed683696de1a79a 100644 (file)
@@ -168,7 +168,7 @@ bool Bind2Backend::getNSEC3PARAM(const DNSName& name, NSEC3PARAMRecordContent* n
 
   static int maxNSEC3Iterations=::arg().asNum("max-nsec3-iterations");
   if(ns3p) {
-    std::shared_ptr<NSEC3PARAMRecordContent> tmp=std::dynamic_pointer_cast<NSEC3PARAMRecordContent>(DNSRecordContent::mastermake(QType::NSEC3PARAM, 1, value));
+    auto tmp=std::dynamic_pointer_cast<NSEC3PARAMRecordContent>(DNSRecordContent::mastermake(QType::NSEC3PARAM, 1, value));
     *ns3p = *tmp;
 
     if (ns3p->d_iterations > maxNSEC3Iterations) {
index 83b473d936f8ff909aca00a81390fd1829e09bfc..92d203c037081a902379368459cab2114f4980c3 100644 (file)
@@ -300,7 +300,7 @@ bool TinyDNSBackend::get(DNSResourceRecord &rr)
         dr.d_type = rr.qtype.getCode();
         dr.d_clen = val.size()-pr.d_pos;
 
-        std::shared_ptr<DNSRecordContent> drc = DNSRecordContent::mastermake(dr, pr);
+        auto drc = DNSRecordContent::mastermake(dr, pr);
         rr.content = drc->getZoneRepresentation();
         DLOG(cerr<<"CONTENT: "<<rr.content<<endl);
       }
index 5c8e0677dadf83b8e51a52188e230ff4a8852a6e..6675260bb9275e63065c1f3241713aec70baa7b0 100644 (file)
@@ -229,14 +229,14 @@ vector<uint8_t> makeBigReferral()
   for(char c='a'; c<= 'm';++c) {
     pw.startRecord(DNSName("com"), QType::NS, 3600, 1, DNSResourceRecord::AUTHORITY);
     gtld[0]=c;
-    std::unique_ptr<DNSRecordContent> drc = DNSRecordContent::makeunique(QType::NS, 1, gtld);
+    auto drc = DNSRecordContent::makeunique(QType::NS, 1, gtld);
     drc->toPacket(pw);
   }
 
   for(char c='a'; c<= 'k';++c) {
     gtld[0]=c;
     pw.startRecord(DNSName(gtld), QType::A, 3600, 1, DNSResourceRecord::ADDITIONAL);
-    std::unique_ptr<DNSRecordContent> drc = DNSRecordContent::makeunique(QType::A, 1, "1.2.3.4");
+    auto drc = DNSRecordContent::makeunique(QType::A, 1, "1.2.3.4");
     drc->toPacket(pw);
   }
 
index 5d3482fc1d7b3b448a776a3b6aa999b4d62a2d86..c4b65ca6de85c22de557fc496488a6c319a7ad76 100644 (file)
@@ -287,7 +287,7 @@ void AuthWebServer::indexfunction(HttpRequest* req, HttpResponse* resp)
 /** Helper to build a record content as needed. */
 static inline string makeRecordContent(const QType& qtype, const string& content, bool noDot) {
   // noDot: for backend storage, pass true. for API users, pass false.
-  std::unique_ptr<DNSRecordContent> drc(DNSRecordContent::makeunique(qtype.getCode(), QClass::IN, content));
+  auto drc = DNSRecordContent::makeunique(qtype.getCode(), QClass::IN, content);
   return drc->getZoneRepresentation(noDot);
 }