Skip to content

Commit

Permalink
clang-tidy: use make functions
Browse files Browse the repository at this point in the history
Found with modernize-make-*

Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Jan 9, 2024
1 parent abb11ca commit 2a104e8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/bindbackend/binddnssec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void Bind2Backend::setupDNSSEC()
if (getArg("dnssec-db").empty() || d_hybrid)
return;
try {
d_dnssecdb = shared_ptr<SSQLite3>(new SSQLite3(getArg("dnssec-db"), getArg("dnssec-db-journal-mode")));
d_dnssecdb = std::make_shared<SSQLite3>(getArg("dnssec-db"), getArg("dnssec-db-journal-mode"));
setupStatements();
}
catch (SSqlException& se) {
Expand Down
2 changes: 1 addition & 1 deletion modules/ldapbackend/powerldap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ PowerLDAP::SearchResult::Ptr PowerLDAP::search(const string& base, int scope, co
throw LDAPException("Starting LDAP search: " + getError(rc));
}

return SearchResult::Ptr(new SearchResult(msgid, d_ld));
return std::make_unique<SearchResult>(msgid, d_ld);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions pdns/dynloader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int main(int argc, char **argv)
string command = commands[0];
shared_ptr<DynMessenger> D;
if(::arg()["remote-address"].empty())
D=shared_ptr<DynMessenger>(new DynMessenger(socketname));
D = std::make_shared<DynMessenger>(socketname);
else {
uint16_t port;
try {
Expand All @@ -121,7 +121,7 @@ int main(int argc, char **argv)
exit(99);
}

D=shared_ptr<DynMessenger>(new DynMessenger(ComboAddress(::arg()["remote-address"], port), ::arg()["secret"]));
D = std::make_shared<DynMessenger>(ComboAddress(::arg()["remote-address"], port), ::arg()["secret"]);
}

string message;
Expand Down
2 changes: 1 addition & 1 deletion pdns/saxfr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ try
throw PDNSException("tcp read failed");

len=ntohs(len);
std::unique_ptr<char[]> creply(new char[len]);
auto creply = std::make_unique<char[]>(len);
int n=0;
int numread;
while(n<len) {
Expand Down

0 comments on commit 2a104e8

Please sign in to comment.