diff options
author | ZYSzys <17367077526@163.com> | 2019-02-04 15:38:51 +0800 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-02-07 07:22:38 +0100 |
commit | 93e0c6ae8997e0ded6013078efd0ccc652ca2595 (patch) | |
tree | 335126a828eb71730196f0df21998a3eaf0f5328 /src/node_api.cc | |
parent | 2a212549dc0517f1700db90d66ed5cf09e9513b8 (diff) | |
download | node-new-93e0c6ae8997e0ded6013078efd0ccc652ca2595.tar.gz |
src: use NULL check macros to check nullptr
PR-URL: https://github.com/nodejs/node/pull/25916
Refs: https://github.com/nodejs/node/pull/20914
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'src/node_api.cc')
-rw-r--r-- | src/node_api.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/node_api.cc b/src/node_api.cc index 7d843c08f5..ff2e12f571 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -1043,8 +1043,8 @@ napi_create_threadsafe_function(napi_env env, napi_status napi_get_threadsafe_function_context(napi_threadsafe_function func, void** result) { - CHECK(func != nullptr); - CHECK(result != nullptr); + CHECK_NOT_NULL(func); + CHECK_NOT_NULL(result); *result = reinterpret_cast<v8impl::ThreadSafeFunction*>(func)->Context(); return napi_ok; @@ -1054,32 +1054,32 @@ napi_status napi_call_threadsafe_function(napi_threadsafe_function func, void* data, napi_threadsafe_function_call_mode is_blocking) { - CHECK(func != nullptr); + CHECK_NOT_NULL(func); return reinterpret_cast<v8impl::ThreadSafeFunction*>(func)->Push(data, is_blocking); } napi_status napi_acquire_threadsafe_function(napi_threadsafe_function func) { - CHECK(func != nullptr); + CHECK_NOT_NULL(func); return reinterpret_cast<v8impl::ThreadSafeFunction*>(func)->Acquire(); } napi_status napi_release_threadsafe_function(napi_threadsafe_function func, napi_threadsafe_function_release_mode mode) { - CHECK(func != nullptr); + CHECK_NOT_NULL(func); return reinterpret_cast<v8impl::ThreadSafeFunction*>(func)->Release(mode); } napi_status napi_unref_threadsafe_function(napi_env env, napi_threadsafe_function func) { - CHECK(func != nullptr); + CHECK_NOT_NULL(func); return reinterpret_cast<v8impl::ThreadSafeFunction*>(func)->Unref(); } napi_status napi_ref_threadsafe_function(napi_env env, napi_threadsafe_function func) { - CHECK(func != nullptr); + CHECK_NOT_NULL(func); return reinterpret_cast<v8impl::ThreadSafeFunction*>(func)->Ref(); } |