diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2017-11-28 18:04:49 +0100 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2017-12-01 07:45:05 +0100 |
commit | 12c8b4d15471cb6211b39c3a2ca5b10fa4b9f12b (patch) | |
tree | 6f8f3cab35a507305d7ddc938e3cac84dd7711b1 /src | |
parent | e32bbbf4d7adfdb22822c39991ea0e972a0a3453 (diff) | |
download | android-node-v8-12c8b4d15471cb6211b39c3a2ca5b10fa4b9f12b.tar.gz android-node-v8-12c8b4d15471cb6211b39c3a2ca5b10fa4b9f12b.tar.bz2 android-node-v8-12c8b4d15471cb6211b39c3a2ca5b10fa4b9f12b.zip |
tools: add cpplint rule for NULL usage
This commit is a suggestion for adding a rule for NULL usages in the
code base. This will currently report a number of errors which could be
ignored using // NOLINT (readability/null_usage)
PR-URL: https://github.com/nodejs/node/pull/17373
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/node.h | 15 | ||||
-rw-r--r-- | src/node_api.h | 2 | ||||
-rw-r--r-- | src/node_win32_etw_provider-inl.h | 2 |
3 files changed, 10 insertions, 9 deletions
diff --git a/src/node.h b/src/node.h index 9ce8664c98..e6f47aa300 100644 --- a/src/node.h +++ b/src/node.h @@ -501,13 +501,13 @@ extern "C" NODE_EXTERN void node_module_register(void* mod); { \ NODE_MODULE_VERSION, \ flags, \ - NULL, \ + NULL, /* NOLINT (readability/null_usage) */ \ __FILE__, \ (node::addon_register_func) (regfunc), \ - NULL, \ + NULL, /* NOLINT (readability/null_usage) */ \ NODE_STRINGIFY(modname), \ priv, \ - NULL \ + NULL /* NOLINT (readability/null_usage) */ \ }; \ NODE_C_CTOR(_register_ ## modname) { \ node_module_register(&_module); \ @@ -520,13 +520,13 @@ extern "C" NODE_EXTERN void node_module_register(void* mod); { \ NODE_MODULE_VERSION, \ flags, \ - NULL, \ + NULL, /* NOLINT (readability/null_usage) */ \ __FILE__, \ - NULL, \ + NULL, /* NOLINT (readability/null_usage) */ \ (node::addon_context_register_func) (regfunc), \ NODE_STRINGIFY(modname), \ priv, \ - NULL \ + NULL /* NOLINT (readability/null_usage) */ \ }; \ NODE_C_CTOR(_register_ ## modname) { \ node_module_register(&_module); \ @@ -534,9 +534,10 @@ extern "C" NODE_EXTERN void node_module_register(void* mod); } #define NODE_MODULE(modname, regfunc) \ - NODE_MODULE_X(modname, regfunc, NULL, 0) + NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) #define NODE_MODULE_CONTEXT_AWARE(modname, regfunc) \ + /* NOLINTNEXTLINE (readability/null_usage) */ \ NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0) /* diff --git a/src/node_api.h b/src/node_api.h index 8e5eef8a47..ee0ad3518e 100644 --- a/src/node_api.h +++ b/src/node_api.h @@ -100,7 +100,7 @@ typedef struct { EXTERN_C_END #define NAPI_MODULE(modname, regfunc) \ - NAPI_MODULE_X(modname, regfunc, NULL, 0) + NAPI_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) #define NAPI_AUTO_LENGTH SIZE_MAX diff --git a/src/node_win32_etw_provider-inl.h b/src/node_win32_etw_provider-inl.h index 3c90bee67d..98a28f14f4 100644 --- a/src/node_win32_etw_provider-inl.h +++ b/src/node_win32_etw_provider-inl.h @@ -115,7 +115,7 @@ extern int events_enabled; DWORD status = event_write(node_provider, \ &eventDescriptor, \ 0, \ - NULL); \ + NULL); // NOLINT (readability/null_usage) \ CHECK_EQ(status, ERROR_SUCCESS); |