aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/transport/connectivity_state.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-11-10 09:53:21 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-11-10 09:53:21 -0800
commit4782d92b2d4fab261b5520a29d79ba97fea9ce7b (patch)
treed060fc1c4093583abc9348cc69a64b52d065f6e3 /src/core/lib/transport/connectivity_state.cc
parent1ef989cd50cdfb172e99c552a67e3ed5f350e5cc (diff)
s/NULL/nullptr
Diffstat (limited to 'src/core/lib/transport/connectivity_state.cc')
-rw-r--r--src/core/lib/transport/connectivity_state.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/lib/transport/connectivity_state.cc b/src/core/lib/transport/connectivity_state.cc
index bdaf0243f9..55f4236d57 100644
--- a/src/core/lib/transport/connectivity_state.cc
+++ b/src/core/lib/transport/connectivity_state.cc
@@ -48,7 +48,7 @@ void grpc_connectivity_state_init(grpc_connectivity_state_tracker* tracker,
const char* name) {
gpr_atm_no_barrier_store(&tracker->current_state_atm, init_state);
tracker->current_error = GRPC_ERROR_NONE;
- tracker->watchers = NULL;
+ tracker->watchers = nullptr;
tracker->name = gpr_strdup(name);
}
@@ -94,7 +94,7 @@ grpc_connectivity_state grpc_connectivity_state_get(
gpr_log(GPR_DEBUG, "CONWATCH: %p %s: get %s", tracker, tracker->name,
grpc_connectivity_state_name(cur));
}
- if (error != NULL) {
+ if (error != nullptr) {
*error = GRPC_ERROR_REF(tracker->current_error);
}
return cur;
@@ -102,7 +102,7 @@ grpc_connectivity_state grpc_connectivity_state_get(
bool grpc_connectivity_state_has_watchers(
grpc_connectivity_state_tracker* connectivity_state) {
- return connectivity_state->watchers != NULL;
+ return connectivity_state->watchers != nullptr;
}
bool grpc_connectivity_state_notify_on_state_change(
@@ -112,7 +112,7 @@ bool grpc_connectivity_state_notify_on_state_change(
(grpc_connectivity_state)gpr_atm_no_barrier_load(
&tracker->current_state_atm);
if (GRPC_TRACER_ON(grpc_connectivity_state_trace)) {
- if (current == NULL) {
+ if (current == nullptr) {
gpr_log(GPR_DEBUG, "CONWATCH: %p %s: unsubscribe notify=%p", tracker,
tracker->name, notify);
} else {
@@ -121,17 +121,17 @@ bool grpc_connectivity_state_notify_on_state_change(
grpc_connectivity_state_name(cur), notify);
}
}
- if (current == NULL) {
+ if (current == nullptr) {
grpc_connectivity_state_watcher* w = tracker->watchers;
- if (w != NULL && w->notify == notify) {
+ if (w != nullptr && w->notify == notify) {
GRPC_CLOSURE_SCHED(exec_ctx, notify, GRPC_ERROR_CANCELLED);
tracker->watchers = w->next;
gpr_free(w);
return false;
}
- while (w != NULL) {
+ while (w != nullptr) {
grpc_connectivity_state_watcher* rm_candidate = w->next;
- if (rm_candidate != NULL && rm_candidate->notify == notify) {
+ if (rm_candidate != nullptr && rm_candidate->notify == notify) {
GRPC_CLOSURE_SCHED(exec_ctx, notify, GRPC_ERROR_CANCELLED);
w->next = w->next->next;
gpr_free(rm_candidate);
@@ -189,7 +189,7 @@ void grpc_connectivity_state_set(grpc_exec_ctx* exec_ctx,
}
GPR_ASSERT(cur != GRPC_CHANNEL_SHUTDOWN);
gpr_atm_no_barrier_store(&tracker->current_state_atm, state);
- while ((w = tracker->watchers) != NULL) {
+ while ((w = tracker->watchers) != nullptr) {
*w->current = state;
tracker->watchers = w->next;
if (GRPC_TRACER_ON(grpc_connectivity_state_trace)) {