diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-08-16 15:54:51 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-08-16 15:55:48 +0200 |
commit | c484ec6c9b85ca4e331e395c564ae232fd0681dd (patch) | |
tree | be4837f43af4a7fb2c48753849bb3e7a9b776387 /src/httpserver.cpp | |
parent | d451d0bcf15d8025c3e963df033f918d646aff6a (diff) | |
parent | 36d326e8b0866df4e70f81c2aa0a2e19d544399c (diff) |
Merge #10645: Use nullptr (C++11) instead of zero (0) as the null pointer constant
36d326e8b Use nullptr instead of zero (0) as the null pointer constant (practicalswift)
Pull request description:
Use `nullptr` instead of zero (0) as the null pointer constant.
The road towards `nullptr` (C++11) is split into two PRs:
* `NULL` → `nullptr` is handled in PR #10483 (scripted)
* `0` → `nullptr` is handled in PR #10645 (manual, this PR)
By using the C++11 keyword `nullptr` we are guaranteed a prvalue of type `std::nullptr_t`.
For a more thorough discussion, see "A name for the null pointer: nullptr" (Sutter &
Stroustrup), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
Tree-SHA512: 5412404b40a94ea2d9fc8f81573559c4ffe559749301d486b09d41a7a736345ad602d08ac590930bb00a49692b6075520cf3d543e4da6ccd5b29fa9bcc3f15ea
Diffstat (limited to 'src/httpserver.cpp')
-rw-r--r-- | src/httpserver.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp index ba3b0d1a68..815d660288 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -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() |