Skip to content

Commit

Permalink
Formatted C++ Files According to the clang-format file. (electron#33158)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-Hopkinson authored and bavulapati committed Apr 29, 2022
1 parent fb9dc40 commit a2c541a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions spec-main/fixtures/native-addon/uv-dlopen/foo.cpp
@@ -1,2 +1 @@
extern "C"
void foo() { }
extern "C" void foo() {}
12 changes: 8 additions & 4 deletions spec-main/fixtures/native-addon/uv-dlopen/main.cpp
Expand Up @@ -8,22 +8,26 @@ napi_value TestLoadLibrary(napi_env env, napi_callback_info info) {
napi_value argv;
napi_status status;
status = napi_get_cb_info(env, info, &argc, &argv, NULL, NULL);
if (status != napi_ok) napi_fatal_error(NULL, 0, NULL, 0);
if (status != napi_ok)
napi_fatal_error(NULL, 0, NULL, 0);

char lib_path[256];
status = napi_get_value_string_utf8(env, argv, lib_path, 256, NULL);
if (status != napi_ok) napi_fatal_error(NULL, 0, NULL, 0);
if (status != napi_ok)
napi_fatal_error(NULL, 0, NULL, 0);

uv_lib_t lib;
auto uv_status = uv_dlopen(lib_path, &lib);
if (uv_status == 0) {
napi_value result;
status = napi_get_boolean(env, true, &result);
if (status != napi_ok) napi_fatal_error(NULL, 0, NULL, 0);
if (status != napi_ok)
napi_fatal_error(NULL, 0, NULL, 0);
return result;
} else {
status = napi_throw_error(env, NULL, uv_dlerror(&lib));
if (status != napi_ok) napi_fatal_error(NULL, 0, NULL, 0);
if (status != napi_ok)
napi_fatal_error(NULL, 0, NULL, 0);
}
}

Expand Down

0 comments on commit a2c541a

Please sign in to comment.