diff options
Diffstat (limited to 'src/core/lib/iomgr/closure.cc')
-rw-r--r-- | src/core/lib/iomgr/closure.cc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/core/lib/iomgr/closure.cc b/src/core/lib/iomgr/closure.cc index 60e99d0e4e..09257d258c 100644 --- a/src/core/lib/iomgr/closure.cc +++ b/src/core/lib/iomgr/closure.cc @@ -43,7 +43,7 @@ grpc_closure* grpc_closure_init(grpc_closure* closure, grpc_iomgr_cb_func cb, closure->scheduler = scheduler; #ifndef NDEBUG closure->scheduled = false; - closure->file_initiated = NULL; + closure->file_initiated = nullptr; closure->line_initiated = 0; closure->run = false; closure->file_created = file; @@ -53,18 +53,18 @@ grpc_closure* grpc_closure_init(grpc_closure* closure, grpc_iomgr_cb_func cb, } void grpc_closure_list_init(grpc_closure_list* closure_list) { - closure_list->head = closure_list->tail = NULL; + closure_list->head = closure_list->tail = nullptr; } bool grpc_closure_list_append(grpc_closure_list* closure_list, grpc_closure* closure, grpc_error* error) { - if (closure == NULL) { + if (closure == nullptr) { GRPC_ERROR_UNREF(error); return false; } closure->error_data.error = error; - closure->next_data.next = NULL; - bool was_empty = (closure_list->head == NULL); + closure->next_data.next = nullptr; + bool was_empty = (closure_list->head == nullptr); if (was_empty) { closure_list->head = closure; } else { @@ -76,7 +76,7 @@ bool grpc_closure_list_append(grpc_closure_list* closure_list, void grpc_closure_list_fail_all(grpc_closure_list* list, grpc_error* forced_failure) { - for (grpc_closure* c = list->head; c != NULL; c = c->next_data.next) { + for (grpc_closure* c = list->head; c != nullptr; c = c->next_data.next) { if (c->error_data.error == GRPC_ERROR_NONE) { c->error_data.error = GRPC_ERROR_REF(forced_failure); } @@ -85,20 +85,20 @@ void grpc_closure_list_fail_all(grpc_closure_list* list, } bool grpc_closure_list_empty(grpc_closure_list closure_list) { - return closure_list.head == NULL; + return closure_list.head == nullptr; } void grpc_closure_list_move(grpc_closure_list* src, grpc_closure_list* dst) { - if (src->head == NULL) { + if (src->head == nullptr) { return; } - if (dst->head == NULL) { + if (dst->head == nullptr) { *dst = *src; } else { dst->tail->next_data.next = src->head; dst->tail = src->tail; } - src->head = src->tail = NULL; + src->head = src->tail = nullptr; } typedef struct { @@ -143,7 +143,7 @@ void grpc_closure_run(grpc_exec_ctx* exec_ctx, grpc_closure* c, grpc_error* error) { #endif GPR_TIMER_BEGIN("grpc_closure_run", 0); - if (c != NULL) { + if (c != nullptr) { #ifndef NDEBUG c->file_initiated = file; c->line_initiated = line; @@ -165,7 +165,7 @@ void grpc_closure_sched(grpc_exec_ctx* exec_ctx, grpc_closure* c, grpc_error* error) { #endif GPR_TIMER_BEGIN("grpc_closure_sched", 0); - if (c != NULL) { + if (c != nullptr) { #ifndef NDEBUG if (c->scheduled) { gpr_log(GPR_ERROR, @@ -195,7 +195,7 @@ void grpc_closure_list_sched(const char* file, int line, void grpc_closure_list_sched(grpc_exec_ctx* exec_ctx, grpc_closure_list* list) { #endif grpc_closure* c = list->head; - while (c != NULL) { + while (c != nullptr) { grpc_closure* next = c->next_data.next; #ifndef NDEBUG if (c->scheduled) { @@ -215,5 +215,5 @@ void grpc_closure_list_sched(grpc_exec_ctx* exec_ctx, grpc_closure_list* list) { c->scheduler->vtable->sched(exec_ctx, c, c->error_data.error); c = next; } - list->head = list->tail = NULL; + list->head = list->tail = nullptr; } |