From 9a2c1e0615aad35bbd41ca3b5be6c401074cc801 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 19 Jun 2017 17:43:02 +0200 Subject: [PATCH] Use `auto` whenever possible with `DNSRecordContent::mastermake()` --- modules/bindbackend/binddnssec.cc | 2 +- modules/tinydnsbackend/tinydnsbackend.cc | 2 +- pdns/speedtest.cc | 4 ++-- pdns/ws-auth.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/bindbackend/binddnssec.cc b/modules/bindbackend/binddnssec.cc index 6f1981dd4a..8079faa8f2 100644 --- a/modules/bindbackend/binddnssec.cc +++ b/modules/bindbackend/binddnssec.cc @@ -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 tmp=std::dynamic_pointer_cast(DNSRecordContent::mastermake(QType::NSEC3PARAM, 1, value)); + auto tmp=std::dynamic_pointer_cast(DNSRecordContent::mastermake(QType::NSEC3PARAM, 1, value)); *ns3p = *tmp; if (ns3p->d_iterations > maxNSEC3Iterations) { diff --git a/modules/tinydnsbackend/tinydnsbackend.cc b/modules/tinydnsbackend/tinydnsbackend.cc index 83b473d936..92d203c037 100644 --- a/modules/tinydnsbackend/tinydnsbackend.cc +++ b/modules/tinydnsbackend/tinydnsbackend.cc @@ -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 drc = DNSRecordContent::mastermake(dr, pr); + auto drc = DNSRecordContent::mastermake(dr, pr); rr.content = drc->getZoneRepresentation(); DLOG(cerr<<"CONTENT: "< makeBigReferral() for(char c='a'; c<= 'm';++c) { pw.startRecord(DNSName("com"), QType::NS, 3600, 1, DNSResourceRecord::AUTHORITY); gtld[0]=c; - std::unique_ptr 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 drc = DNSRecordContent::makeunique(QType::A, 1, "1.2.3.4"); + auto drc = DNSRecordContent::makeunique(QType::A, 1, "1.2.3.4"); drc->toPacket(pw); } diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 5d3482fc1d..c4b65ca6de 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -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 drc(DNSRecordContent::makeunique(qtype.getCode(), QClass::IN, content)); + auto drc = DNSRecordContent::makeunique(qtype.getCode(), QClass::IN, content); return drc->getZoneRepresentation(noDot); } -- 2.47.2