Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Mert Can Altin committed Oct 4, 2024
1 parent e31ccd1 commit cad379f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
48 changes: 24 additions & 24 deletions test/js-native-api/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,20 @@

#ifdef NODE_ADDON_API_ENABLE_MAYBE
// In the basic environment, we cannot throw JS exceptions
#define NODE_API_CALL_BASE(env, the_call, ret_val) \
do { \
if ((the_call) != napi_ok) { \
FATALLY_FAIL_WITH_LAST_ERROR((env)); \
return ret_val; \
} \
#define NODE_API_CALL_BASE(env, the_call, ret_val) \
do { \
if ((the_call) != napi_ok) { \
FATALLY_FAIL_WITH_LAST_ERROR((env)); \
return ret_val; \
} \
} while (0)
#else
#define NODE_API_CALL_BASE(env, the_call, ret_val) \
do { \
if ((the_call) != napi_ok) { \
GET_AND_THROW_LAST_ERROR((env)); \
return ret_val; \
} \
#define NODE_API_CALL_BASE(env, the_call, ret_val) \
do { \
if ((the_call) != napi_ok) { \
GET_AND_THROW_LAST_ERROR((env)); \
return ret_val; \
} \
} while (0)
#endif

Expand All @@ -106,20 +106,20 @@
#define NODE_API_CALL_RETURN_VOID(env, the_call) \
NODE_API_CALL_BASE(env, the_call, NODE_API_RETVAL_NOTHING)

#define NODE_API_BASIC_CALL_RETURN_VOID(env, the_call) \
do { \
if ((the_call) != napi_ok) { \
FATALLY_FAIL_WITH_LAST_ERROR((env)); \
return NODE_API_RETVAL_NOTHING; \
} \
#define NODE_API_BASIC_CALL_RETURN_VOID(env, the_call) \
do { \
if ((the_call) != napi_ok) { \
FATALLY_FAIL_WITH_LAST_ERROR((env)); \
return NODE_API_RETVAL_NOTHING; \
} \
} while (0)

#define NODE_API_CHECK_STATUS(the_call) \
do { \
napi_status status = (the_call); \
if (status != napi_ok) { \
return status; \
} \
#define NODE_API_CHECK_STATUS(the_call) \
do { \
napi_status status = (the_call); \
if (status != napi_ok) { \
return status; \
} \
} while (0)

#define NODE_API_ASSERT_STATUS(env, assertion, message) \
Expand Down
8 changes: 4 additions & 4 deletions test/node-api/test_buffer/test_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ static int deleterCallCount = 0;
static void deleteTheText(node_api_basic_env env,
void* data,
void* finalize_hint) {
NODE_API_BASIC_ASSERT_RETURN_VOID(
data != NULL && strcmp(data, theText) == 0, "invalid data");
NODE_API_BASIC_ASSERT_RETURN_VOID(data != NULL && strcmp(data, theText) == 0,
"invalid data");

(void)finalize_hint;
free(data);
Expand All @@ -22,8 +22,8 @@ static void deleteTheText(node_api_basic_env env,
static void noopDeleter(node_api_basic_env env,
void* data,
void* finalize_hint) {
NODE_API_BASIC_ASSERT_RETURN_VOID(
data != NULL && strcmp(data, theText) == 0, "invalid data");
NODE_API_BASIC_ASSERT_RETURN_VOID(data != NULL && strcmp(data, theText) == 0,
"invalid data");
(void)finalize_hint;
deleterCallCount++;
}
Expand Down

0 comments on commit cad379f

Please sign in to comment.