aboutsummaryrefslogtreecommitdiff
path: root/src/torcontrol.cpp
diff options
context:
space:
mode:
authorMarcoFalke <[email protected]>2017-08-16 15:54:51 +0200
committerMarcoFalke <[email protected]>2017-08-16 15:55:48 +0200
commitc484ec6c9b85ca4e331e395c564ae232fd0681dd (patch)
treebe4837f43af4a7fb2c48753849bb3e7a9b776387 /src/torcontrol.cpp
parentMerge #11056: disable jni in builds (diff)
parentUse nullptr instead of zero (0) as the null pointer constant (diff)
downloaddiscoin-c484ec6c9b85ca4e331e395c564ae232fd0681dd.tar.xz
discoin-c484ec6c9b85ca4e331e395c564ae232fd0681dd.zip
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/torcontrol.cpp')
-rw-r--r--src/torcontrol.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp
index e8bc3e5e7..6b96c24af 100644
--- a/src/torcontrol.cpp
+++ b/src/torcontrol.cpp
@@ -121,7 +121,7 @@ private:
};
TorControlConnection::TorControlConnection(struct event_base *_base):
- base(_base), b_conn(0)
+ base(_base), b_conn(nullptr)
{
}
@@ -227,7 +227,7 @@ bool TorControlConnection::Disconnect()
{
if (b_conn)
bufferevent_free(b_conn);
- b_conn = 0;
+ b_conn = nullptr;
return true;
}
@@ -476,7 +476,7 @@ TorController::~TorController()
{
if (reconnect_ev) {
event_free(reconnect_ev);
- reconnect_ev = 0;
+ reconnect_ev = nullptr;
}
if (service.IsValid()) {
RemoveLocal(service);
@@ -770,7 +770,7 @@ void StopTorControl()
if (gBase) {
torControlThread.join();
event_base_free(gBase);
- gBase = 0;
+ gBase = nullptr;
}
}