From cad379fa2bb8bd09b215ad86589097b941bc402a Mon Sep 17 00:00:00 2001 From: Mert Can Altin Date: Fri, 4 Oct 2024 20:16:45 +0300 Subject: [PATCH] lint --- test/js-native-api/common.h | 48 ++++++++++++------------- test/node-api/test_buffer/test_buffer.c | 8 ++--- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/test/js-native-api/common.h b/test/js-native-api/common.h index 912a2c7911caa6..41c39f9fdaf9d5 100644 --- a/test/js-native-api/common.h +++ b/test/js-native-api/common.h @@ -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 @@ -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) \ diff --git a/test/node-api/test_buffer/test_buffer.c b/test/node-api/test_buffer/test_buffer.c index f62ce8787de4cb..cb9ad7bb5d72a9 100644 --- a/test/node-api/test_buffer/test_buffer.c +++ b/test/node-api/test_buffer/test_buffer.c @@ -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); @@ -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++; }