Skip to content

Commit

Permalink
napi: Remove regfunc cast from NAPI_MODULE (nodejs#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasongin authored Mar 17, 2017
1 parent 93fe9fb commit 7f0d031
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/node_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct napi_module {
NAPI_MODULE_VERSION, \
flags, \
__FILE__, \
(node::napi_addon_register_func)regfunc, \
regfunc, \
#modname, \
priv, \
{0}, \
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/1_hello_world/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void Method(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;
napi_property_descriptor desc = DECLARE_NAPI_METHOD("hello", Method);
status = napi_define_properties(env, exports, 1, &desc);
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/2_function_arguments/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void Add(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;
napi_property_descriptor addDescriptor = DECLARE_NAPI_METHOD("add", Add);
status = napi_define_properties(env, exports, 1, &addDescriptor);
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/3_callbacks/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void RunCallbackWithRecv(napi_env env, const napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;
napi_property_descriptor desc[2] = {
DECLARE_NAPI_METHOD("RunCallback", RunCallback),
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/4_object_factory/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void CreateObject(napi_env env, const napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;
napi_property_descriptor desc = DECLARE_NAPI_METHOD("exports", CreateObject);
status = napi_define_properties(env, module, 1, &desc);
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/5_function_factory/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void CreateFunction(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;
napi_property_descriptor desc =
DECLARE_NAPI_METHOD("exports", CreateFunction);
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/6_object_wrap/binding.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "myobject.h"

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
MyObject::Init(env, exports);
}

Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/7_factory_wrap/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void CreateObject(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

status = MyObject::Init(env);
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/8_passing_wrapped/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void Add(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

MyObject::Init(env);
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_array/test_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void New(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

napi_property_descriptor descriptors[] = {
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_buffer/test_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void staticBuffer(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_value theValue;

NAPI_CALL(env, napi_create_string_utf8(env,
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_constructor/test_constructor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void New(napi_env env, napi_callback_info info) {
if (status != napi_ok) return;
}

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

napi_value number;
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_error/test_error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void checkError(napi_env e, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

napi_property_descriptor descriptors[] = {
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_exception/test_exception.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void wasPending(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

napi_property_descriptor descriptors[] = {
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_function/test_function.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void Test(napi_env env, napi_callback_info info) {
if (status != napi_ok) return;
}

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

napi_value fn;
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_instanceof/test_instanceof.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void doInstanceOf(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

napi_property_descriptor descriptors[] = {
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_number/test_number.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void Test(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

napi_property_descriptor descriptors[] = {
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_object/test_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void Inflate(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

napi_property_descriptor descriptors[] = {
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_properties/test_properties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void Echo(napi_env env, napi_callback_info info) {
if (status != napi_ok) return;
}

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

napi_value number;
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_string/test_string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void Utf8Length(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

napi_property_descriptor properties[] = {
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_symbol/test_symbol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void New(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

napi_property_descriptor properties[] = {
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/test_typedarray/test_typedarray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void External(napi_env env, napi_callback_info info) {
#define DECLARE_NAPI_METHOD(name, func) \
{ name, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module) {
void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_status status;

napi_property_descriptor descriptors[] = {
Expand Down

0 comments on commit 7f0d031

Please sign in to comment.