Use nullptr instead of zero (0) as the null pointer constant

This commit is contained in:
practicalswift
2017-06-21 21:10:00 +02:00
parent d451d0bcf1
commit 36d326e8b0
16 changed files with 41 additions and 41 deletions

View File

@@ -164,13 +164,13 @@ struct HTTPPathHandler
/** HTTP module state */
//! libevent event loop
static struct event_base* eventBase = 0;
static struct event_base* eventBase = nullptr;
//! HTTP server
struct evhttp* eventHTTP = 0;
struct evhttp* eventHTTP = nullptr;
//! List of subnets to allow RPC connections from
static std::vector<CSubNet> rpc_allow_subnets;
//! Work queue for handling longer requests off the event loop thread
static WorkQueue<HTTPClosure>* workQueue = 0;
static WorkQueue<HTTPClosure>* workQueue = nullptr;
//! Handlers for (sub)paths
std::vector<HTTPPathHandler> pathHandlers;
//! Bound listening sockets
@@ -495,11 +495,11 @@ void StopHTTPServer()
}
if (eventHTTP) {
evhttp_free(eventHTTP);
eventHTTP = 0;
eventHTTP = nullptr;
}
if (eventBase) {
event_base_free(eventBase);
eventBase = 0;
eventBase = nullptr;
}
LogPrint(BCLog::HTTP, "Stopped HTTP server\n");
}
@@ -601,9 +601,9 @@ void HTTPRequest::WriteReply(int nStatus, const std::string& strReply)
evbuffer_add(evb, strReply.data(), strReply.size());
HTTPEvent* ev = new HTTPEvent(eventBase, true,
std::bind(evhttp_send_reply, req, nStatus, (const char*)nullptr, (struct evbuffer *)nullptr));
ev->trigger(0);
ev->trigger(nullptr);
replySent = true;
req = 0; // transferred back to main thread
req = nullptr; // transferred back to main thread
}
CService HTTPRequest::GetPeer()