Skip to content

Commit 24b0f73

Browse files
committed
scripted-diff: replace MakeUnique with std::make_unique
-BEGIN VERIFY SCRIPT- sed -i 's/MakeUnique/std::make_unique/' src/*.cpp src/*/*.cpp src/*/*/*.cpp src/wallet/wallet.h -END VERIFY SCRIPT-
1 parent 60d3629 commit 24b0f73

File tree

14 files changed

+17
-17
lines changed

14 files changed

+17
-17
lines changed

src/httprpc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ bool StartHTTPRPC()
234234
RegisterHTTPHandler("/wallet/", false, HTTPReq_JSONRPC);
235235
#endif
236236
assert(EventBase());
237-
httpRPCTimerInterface = MakeUnique<HTTPRPCTimerInterface>(EventBase());
237+
httpRPCTimerInterface = std::make_unique<HTTPRPCTimerInterface>(EventBase());
238238
RPCSetTimerInterface(httpRPCTimerInterface.get());
239239
return true;
240240
}

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ bool AppInitMain()
13441344
// need to reindex later.
13451345

13461346
assert(!g_connman);
1347-
g_connman = MakeUnique<CConnman>(GetRand(std::numeric_limits<uint64_t>::max()), GetRand(std::numeric_limits<uint64_t>::max()));
1347+
g_connman = std::make_unique<CConnman>(GetRand(std::numeric_limits<uint64_t>::max()), GetRand(std::numeric_limits<uint64_t>::max()));
13481348
CConnman& connman = *g_connman;
13491349

13501350
peerLogic.reset(new PeerLogicValidation(&connman));

src/interfaces/handler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class HandlerImpl : public Handler
2727

2828
std::unique_ptr<Handler> MakeHandler(boost::signals2::connection connection)
2929
{
30-
return MakeUnique<HandlerImpl>(std::move(connection));
30+
return std::make_unique<HandlerImpl>(std::move(connection));
3131
}
3232

3333
} // namespace interfaces

src/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@ bool CConnman::Start(CScheduler& scheduler, std::string& strNodeError, Options c
19831983

19841984
if (semOutbound == nullptr) {
19851985
// initialize semaphore
1986-
semOutbound = MakeUnique<CSemaphore>(std::min((nMaxOutbound + nMaxFeeler), nMaxConnections));
1986+
semOutbound = std::make_unique<CSemaphore>(std::min((nMaxOutbound + nMaxFeeler), nMaxConnections));
19871987
}
19881988

19891989
if (pnodeLocalHost == nullptr) {
@@ -2330,7 +2330,7 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
23302330
nNextLocalAddrSend = 0;
23312331
nNextAddrSend = 0;
23322332
fRelayTxes = false;
2333-
pfilter = MakeUnique<CBloomFilter>();
2333+
pfilter = std::make_unique<CBloomFilter>();
23342334
timeLastMempoolReq = 0;
23352335
nPingNonceSent = 0;
23362336
nPingUsecStart = 0;

src/qt/pivx/masternodeswidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ void MasterNodesWidget::onStartAllClicked(int type)
259259
if (isLoading) {
260260
inform(tr("Background task is being executed, please wait"));
261261
} else {
262-
std::unique_ptr<WalletModel::UnlockContext> pctx = MakeUnique<WalletModel::UnlockContext>(walletModel->requestUnlock());
262+
std::unique_ptr<WalletModel::UnlockContext> pctx = std::make_unique<WalletModel::UnlockContext>(walletModel->requestUnlock());
263263
if (!pctx->isValid()) {
264264
warn(tr("Start ALL masternodes failed"), tr("Wallet unlock cancelled"));
265265
return;

src/qt/pivx/send.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ void SendWidget::ProcessSend(QList<SendCoinsRecipient>& recipients, bool hasShie
421421
}
422422
}
423423

424-
auto ptrUnlockedContext = MakeUnique<WalletModel::UnlockContext>(walletModel->requestUnlock());
424+
auto ptrUnlockedContext = std::make_unique<WalletModel::UnlockContext>(walletModel->requestUnlock());
425425
if (!ptrUnlockedContext->isValid()) {
426426
// Unlock wallet was cancelled
427427
inform(tr("Cannot send, wallet locked"));

src/qt/pivx/topbar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ void TopBar::showUpgradeDialog(const QString& message)
544544
{
545545
QString title = tr("Wallet Upgrade");
546546
if (ask(title, message)) {
547-
std::unique_ptr<WalletModel::UnlockContext> pctx = MakeUnique<WalletModel::UnlockContext>(walletModel->requestUnlock());
547+
std::unique_ptr<WalletModel::UnlockContext> pctx = std::make_unique<WalletModel::UnlockContext>(walletModel->requestUnlock());
548548
if (!pctx->isValid()) {
549549
warn(tr("Upgrade Wallet"), tr("Wallet unlock cancelled"));
550550
return;

src/rpc/mining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ UniValue generate(const JSONRPCRequest& request)
123123
EnsureWalletIsUnlocked(pwallet);
124124
} else {
125125
// Coinbase key
126-
reservekey = MakeUnique<CReserveKey>(pwallet);
126+
reservekey = std::make_unique<CReserveKey>(pwallet);
127127
CPubKey pubkey;
128128
if (!reservekey->GetReservedKey(pubkey)) throw JSONRPCError(RPC_INTERNAL_ERROR, "Error: Cannot get key from keypool");
129129
coinbaseScript = GetScriptForDestination(pubkey.GetID());

src/test/fuzz/fuzz.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static bool read_stdin(std::vector<uint8_t>& data)
2525

2626
static void initialize()
2727
{
28-
const static auto verify_handle = MakeUnique<ECCVerifyHandle>();
28+
const static auto verify_handle = std::make_unique<ECCVerifyHandle>();
2929
SelectParams(CBaseChainParams::MAIN);
3030
}
3131

src/test/net_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ BOOST_AUTO_TEST_CASE(ipv4_peer_with_ipv6_addrMe_test)
198198
in_addr ipv4AddrPeer;
199199
ipv4AddrPeer.s_addr = 0xa0b0c001;
200200
CAddress addr = CAddress(CService(ipv4AddrPeer, 7777), NODE_NETWORK);
201-
std::unique_ptr<CNode> pnode = MakeUnique<CNode>(0, NODE_NETWORK, 0, INVALID_SOCKET, addr, 0, 0, std::string{}, false);
201+
std::unique_ptr<CNode> pnode = std::make_unique<CNode>(0, NODE_NETWORK, 0, INVALID_SOCKET, addr, 0, 0, std::string{}, false);
202202
pnode->fSuccessfullyConnected.store(true);
203203

204204
// the peer claims to be reaching us via IPv6

0 commit comments

Comments
 (0)