Skip to content

Commit 86b800c

Browse files
committed
Merge #7964: Minor changes for c++11 consistency
07e4edb auto_ptr → unique_ptr (Wladimir J. van der Laan) 073225c chain: define enum used as bit field as uint32_t (Wladimir J. van der Laan)
2 parents 0ad1041 + 07e4edb commit 86b800c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/chain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct CDiskBlockPos
5454

5555
};
5656

57-
enum BlockStatus {
57+
enum BlockStatus: uint32_t {
5858
//! Unused.
5959
BLOCK_VALID_UNKNOWN = 0,
6060

src/httpserver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static std::string RequestMethodString(HTTPRequest::RequestMethod m)
252252
/** HTTP request callback */
253253
static void http_request_cb(struct evhttp_request* req, void* arg)
254254
{
255-
std::auto_ptr<HTTPRequest> hreq(new HTTPRequest(req));
255+
std::unique_ptr<HTTPRequest> hreq(new HTTPRequest(req));
256256

257257
LogPrint("http", "Received a %s request for %s from %s\n",
258258
RequestMethodString(hreq->GetRequestMethod()), hreq->GetURI(), hreq->GetPeer().ToString());
@@ -288,7 +288,7 @@ static void http_request_cb(struct evhttp_request* req, void* arg)
288288

289289
// Dispatch to worker thread
290290
if (i != iend) {
291-
std::auto_ptr<HTTPWorkItem> item(new HTTPWorkItem(hreq.release(), path, i->handler));
291+
std::unique_ptr<HTTPWorkItem> item(new HTTPWorkItem(hreq.release(), path, i->handler));
292292
assert(workQueue);
293293
if (workQueue->Enqueue(item.get()))
294294
item.release(); /* if true, queue took ownership */

src/miner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParam
7474
CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const CScript& scriptPubKeyIn)
7575
{
7676
// Create new block
77-
auto_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
77+
std::unique_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
7878
if(!pblocktemplate.get())
7979
return NULL;
8080
CBlock *pblock = &pblocktemplate->block; // pointer for convenience

src/rpc/mining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ UniValue generateBlocks(boost::shared_ptr<CReserveScript> coinbaseScript, int nG
111111
UniValue blockHashes(UniValue::VARR);
112112
while (nHeight < nHeightEnd)
113113
{
114-
auto_ptr<CBlockTemplate> pblocktemplate(CreateNewBlock(Params(), coinbaseScript->reserveScript));
114+
std::unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlock(Params(), coinbaseScript->reserveScript));
115115
if (!pblocktemplate.get())
116116
throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block");
117117
CBlock *pblock = &pblocktemplate->block;

0 commit comments

Comments
 (0)