diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-05-02 13:07:14 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-05-02 13:08:02 +0200 |
| commit | 86b800c6a299455580fe76e5fb43218f0222e179 (patch) | |
| tree | 9f0bb9c9d92eece4a5df29b183b6b3c8d6e11b62 /src | |
| parent | Merge #7807: Fixed miner test values, gave constants for less error-prone val... (diff) | |
| parent | auto_ptr → unique_ptr (diff) | |
| download | discoin-86b800c6a299455580fe76e5fb43218f0222e179.tar.xz discoin-86b800c6a299455580fe76e5fb43218f0222e179.zip | |
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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/chain.h | 2 | ||||
| -rw-r--r-- | src/httpserver.cpp | 4 | ||||
| -rw-r--r-- | src/miner.cpp | 2 | ||||
| -rw-r--r-- | src/rpc/mining.cpp | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/chain.h b/src/chain.h index 5b9605a80..017d4fe45 100644 --- a/src/chain.h +++ b/src/chain.h @@ -54,7 +54,7 @@ struct CDiskBlockPos }; -enum BlockStatus { +enum BlockStatus: uint32_t { //! Unused. BLOCK_VALID_UNKNOWN = 0, diff --git a/src/httpserver.cpp b/src/httpserver.cpp index ce1accb04..a98eff7c1 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -252,7 +252,7 @@ static std::string RequestMethodString(HTTPRequest::RequestMethod m) /** HTTP request callback */ static void http_request_cb(struct evhttp_request* req, void* arg) { - std::auto_ptr<HTTPRequest> hreq(new HTTPRequest(req)); + std::unique_ptr<HTTPRequest> hreq(new HTTPRequest(req)); LogPrint("http", "Received a %s request for %s from %s\n", RequestMethodString(hreq->GetRequestMethod()), hreq->GetURI(), hreq->GetPeer().ToString()); @@ -288,7 +288,7 @@ static void http_request_cb(struct evhttp_request* req, void* arg) // Dispatch to worker thread if (i != iend) { - std::auto_ptr<HTTPWorkItem> item(new HTTPWorkItem(hreq.release(), path, i->handler)); + std::unique_ptr<HTTPWorkItem> item(new HTTPWorkItem(hreq.release(), path, i->handler)); assert(workQueue); if (workQueue->Enqueue(item.get())) item.release(); /* if true, queue took ownership */ diff --git a/src/miner.cpp b/src/miner.cpp index ef8fd4db4..eaf29a767 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -74,7 +74,7 @@ int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParam CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const CScript& scriptPubKeyIn) { // Create new block - auto_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate()); + std::unique_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate()); if(!pblocktemplate.get()) return NULL; CBlock *pblock = &pblocktemplate->block; // pointer for convenience diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index b63ee2288..9a7d9d53a 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -111,7 +111,7 @@ UniValue generateBlocks(boost::shared_ptr<CReserveScript> coinbaseScript, int nG UniValue blockHashes(UniValue::VARR); while (nHeight < nHeightEnd) { - auto_ptr<CBlockTemplate> pblocktemplate(CreateNewBlock(Params(), coinbaseScript->reserveScript)); + std::unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlock(Params(), coinbaseScript->reserveScript)); if (!pblocktemplate.get()) throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block"); CBlock *pblock = &pblocktemplate->block; |