diff --git a/cmake/Warnings.cmake b/cmake/Warnings.cmake index c5d42e1c91..dc78a247c1 100644 --- a/cmake/Warnings.cmake +++ b/cmake/Warnings.cmake @@ -50,7 +50,7 @@ if(WARNINGS_ENABLED) add_compile_options(-Wall) add_compile_options(-Wextra) add_compile_options(-Wunused) - #add_compile_options(-Wshadow) + add_compile_options(-Wshadow) add_compile_options(-Wignored-qualifiers) add_compile_options(-Wmissing-braces) add_compile_options(-Wreturn-type) diff --git a/source/configuration/source/configuration.c b/source/configuration/source/configuration.c index a53bc9b477..d8b841490b 100644 --- a/source/configuration/source/configuration.c +++ b/source/configuration/source/configuration.c @@ -1,10 +1,10 @@ /* -* Configuration Library by Parra Studios -* Copyright (C) 2016 - 2026 Vicente Eduardo Ferrer Garcia -* -* A cross-platform library for managing multiple configuration formats. -* -*/ + * Configuration Library by Parra Studios + * Copyright (C) 2016 - 2026 Vicente Eduardo Ferrer Garcia + * + * A cross-platform library for managing multiple configuration formats. + * + */ /* -- Headers -- */ @@ -71,11 +71,11 @@ int configuration_initialize(const char *reader, const char *path, void *allocat } /* The order of precedence is: - * 1) Environment variable - * 2) Default relative path to metacall library - * 3) Locate it relative to metacall library install path - * 4) Default installation path (if any) - */ + * 1) Environment variable + * 2) Default relative path to metacall library + * 3) Locate it relative to metacall library install path + * 4) Default installation path (if any) + */ if (path == NULL) { static const char configuration_path[] = CONFIGURATION_PATH; @@ -198,20 +198,20 @@ int configuration_initialize(const char *reader, const char *path, void *allocat return 1; } -configuration configuration_create(const char *scope, const char *path, const char *parent, void *allocator) +configuration configuration_create(const char *scope_name, const char *path, const char *parent, void *allocator) { - configuration config = configuration_singleton_get(scope); + configuration config = configuration_singleton_get(scope_name); if (config != NULL) { return config; } - config = configuration_object_initialize(scope, path, configuration_scope(parent)); + config = configuration_object_initialize(scope_name, path, configuration_scope(parent)); if (config == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid configuration (%s) scope map creation [%s]", scope, path); + log_write("metacall", LOG_LEVEL_ERROR, "Invalid configuration (%s) scope map creation [%s]", scope_name, path); return NULL; } diff --git a/source/loader/include/loader/loader_impl.h b/source/loader/include/loader/loader_impl.h index 0045f8e76b..af1ec54bcd 100644 --- a/source/loader/include/loader/loader_impl.h +++ b/source/loader/include/loader/loader_impl.h @@ -63,7 +63,7 @@ LOADER_API value loader_impl_get_value(loader_impl impl, const char *name); LOADER_API context loader_impl_context(loader_impl impl); -LOADER_API type loader_impl_type(loader_impl impl, const char *name); +LOADER_API type loader_impl_get_type(loader_impl impl, const char *name); LOADER_API int loader_impl_type_define(loader_impl impl, const char *name, type t); diff --git a/source/loader/source/loader_host.c b/source/loader/source/loader_host.c index d4835d2420..e727f21b55 100644 --- a/source/loader/source/loader_host.c +++ b/source/loader/source/loader_host.c @@ -183,12 +183,12 @@ int loader_host_register(loader_impl host, context ctx, const char *name, loader { static const char empty_argument_name[] = ""; - type t = loader_impl_type(host, type_id_name(args_type_id[iterator])); + type t = loader_impl_get_type(host, type_id_name(args_type_id[iterator])); signature_set(s, iterator, empty_argument_name, t); } - type t = loader_impl_type(host, type_id_name(return_type)); + type t = loader_impl_get_type(host, type_id_name(return_type)); signature_set_return(s, t); diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 86a1257eab..b9cacd2262 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -64,11 +64,11 @@ /* -- Forward Declarations -- */ -struct loader_handle_impl_type; +struct loader_handle_impl_s; /* -- Type Definitions -- */ -typedef struct loader_handle_impl_type *loader_handle_impl; +typedef struct loader_handle_impl_s *loader_handle_impl; /* -- Member Data -- */ @@ -90,7 +90,7 @@ struct loader_impl_type set detour_map; /* List of detour handles (detour_handle) to the dependencies of the loader and the loader itself */ }; -struct loader_handle_impl_type +struct loader_handle_impl_s { uintptr_t magic; /* Magic number for detecting corrupted input by the user */ loader_impl impl; /* Reference to the loader which handle belongs to */ @@ -846,7 +846,7 @@ context loader_impl_context(loader_impl impl) return NULL; } -type loader_impl_type(loader_impl impl, const char *name) +type loader_impl_get_type(loader_impl impl, const char *name) { if (impl != NULL && impl->type_info_map != NULL && name != NULL) { @@ -868,7 +868,7 @@ int loader_impl_type_define(loader_impl impl, const char *name, type t) loader_handle_impl loader_impl_load_handle(loader_impl impl, loader_impl_interface iface, loader_handle module, const char *path, size_t size) { - loader_handle_impl handle_impl = malloc(sizeof(struct loader_handle_impl_type)); + loader_handle_impl handle_impl = malloc(sizeof(struct loader_handle_impl_s)); if (handle_impl == NULL) { diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index 9875f14951..7e36bb1d4e 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -1425,7 +1425,7 @@ type_id c_loader_impl_clang_type(loader_impl impl, CXCursor cursor, CXType cx_ty type c_loader_impl_discover_type(loader_impl impl, CXCursor &cursor, CXType &cx_type) { auto type_str = c_loader_impl_cxstring_to_str(clang_getTypeSpelling(cx_type)); - type t = loader_impl_type(impl, type_str.c_str()); + type t = loader_impl_get_type(impl, type_str.c_str()); if (t != NULL) { diff --git a/source/loaders/cs_loader/source/cs_loader_impl.c b/source/loaders/cs_loader/source/cs_loader_impl.c index c1b2b06e33..085be4884d 100644 --- a/source/loaders/cs_loader/source/cs_loader_impl.c +++ b/source/loaders/cs_loader/source/cs_loader_impl.c @@ -377,11 +377,11 @@ int cs_loader_impl_discover(loader_impl impl, loader_handle handle, context ctx) { signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, cs_loader_impl_discover_type(functions[i].return_type))); + signature_set_return(s, loader_impl_get_type(impl, cs_loader_impl_discover_type(functions[i].return_type))); for (int j = 0; j < functions[i].param_count; ++j) { - type t = loader_impl_type(impl, cs_loader_impl_discover_type(functions[i].pars[j].type)); + type t = loader_impl_get_type(impl, cs_loader_impl_discover_type(functions[i].pars[j].type)); signature_set(s, j, functions[i].pars[j].name, t); } diff --git a/source/loaders/dart_loader/source/dart_loader_impl.cc b/source/loaders/dart_loader/source/dart_loader_impl.cc index 4671feb5d1..aebcdf2d41 100644 --- a/source/loaders/dart_loader/source/dart_loader_impl.cc +++ b/source/loaders/dart_loader/source/dart_loader_impl.cc @@ -438,7 +438,7 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Integer")); + signature_set_return(s, loader_impl_get_type(impl, "Integer")); value v = value_create_function(f); @@ -457,11 +457,11 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Double")); + signature_set_return(s, loader_impl_get_type(impl, "Double")); - signature_set(s, 0, "first_parameter", loader_impl_type(impl, "Double")); + signature_set(s, 0, "first_parameter", loader_impl_get_type(impl, "Double")); - signature_set(s, 1, "second_parameter", loader_impl_type(impl, "Double")); + signature_set(s, 1, "second_parameter", loader_impl_get_type(impl, "Double")); value v = value_create_function(f); @@ -480,17 +480,17 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Char")); + signature_set_return(s, loader_impl_get_type(impl, "Char")); - signature_set(s, 0, "a_char", loader_impl_type(impl, "Char")); + signature_set(s, 0, "a_char", loader_impl_get_type(impl, "Char")); - signature_set(s, 1, "b_int", loader_impl_type(impl, "Integer")); + signature_set(s, 1, "b_int", loader_impl_get_type(impl, "Integer")); - signature_set(s, 2, "c_long", loader_impl_type(impl, "Long")); + signature_set(s, 2, "c_long", loader_impl_get_type(impl, "Long")); - signature_set(s, 3, "d_double", loader_impl_type(impl, "Double")); + signature_set(s, 3, "d_double", loader_impl_get_type(impl, "Double")); - signature_set(s, 4, "e_ptr", loader_impl_type(impl, "Ptr")); + signature_set(s, 4, "e_ptr", loader_impl_get_type(impl, "Ptr")); value v = value_create_function(f); @@ -509,9 +509,9 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "String")); + signature_set_return(s, loader_impl_get_type(impl, "String")); - signature_set(s, 0, "a_str", loader_impl_type(impl, "String")); + signature_set(s, 0, "a_str", loader_impl_get_type(impl, "String")); value v = value_create_function(f); @@ -530,11 +530,11 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "String")); + signature_set_return(s, loader_impl_get_type(impl, "String")); - signature_set(s, 0, "a_str", loader_impl_type(impl, "String")); + signature_set(s, 0, "a_str", loader_impl_get_type(impl, "String")); - signature_set(s, 1, "b_str", loader_impl_type(impl, "String")); + signature_set(s, 1, "b_str", loader_impl_get_type(impl, "String")); value v = value_create_function(f); @@ -553,13 +553,13 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "String")); + signature_set_return(s, loader_impl_get_type(impl, "String")); - signature_set(s, 0, "a_str", loader_impl_type(impl, "String")); + signature_set(s, 0, "a_str", loader_impl_get_type(impl, "String")); - signature_set(s, 1, "b_str", loader_impl_type(impl, "String")); + signature_set(s, 1, "b_str", loader_impl_get_type(impl, "String")); - signature_set(s, 2, "c_str", loader_impl_type(impl, "String")); + signature_set(s, 2, "c_str", loader_impl_get_type(impl, "String")); value v = value_create_function(f); @@ -578,7 +578,7 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "String")); + signature_set_return(s, loader_impl_get_type(impl, "String")); value v = value_create_function(f); @@ -597,7 +597,7 @@ int dart_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Integer")); + signature_set_return(s, loader_impl_get_type(impl, "Integer")); value v = value_create_function(f); diff --git a/source/loaders/file_loader/source/file_loader_impl.c b/source/loaders/file_loader/source/file_loader_impl.c index 414650b3f3..4cd85797af 100644 --- a/source/loaders/file_loader/source/file_loader_impl.c +++ b/source/loaders/file_loader/source/file_loader_impl.c @@ -550,7 +550,7 @@ int file_loader_impl_discover(loader_impl impl, loader_handle handle, context ct s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Path")); + signature_set_return(s, loader_impl_get_type(impl, "Path")); v = value_create_function(f); diff --git a/source/loaders/java_loader/source/java_loader_impl.cpp b/source/loaders/java_loader/source/java_loader_impl.cpp index 4615660978..e68b461639 100644 --- a/source/loaders/java_loader/source/java_loader_impl.cpp +++ b/source/loaders/java_loader/source/java_loader_impl.cpp @@ -84,7 +84,7 @@ static type_interface type_java_singleton(void); static type java_loader_impl_type(loader_impl impl, const char *type_str, const char *type_signature) { - type t = loader_impl_type(impl, type_str); + type t = loader_impl_get_type(impl, type_str); if (t != NULL) { diff --git a/source/loaders/js_loader/source/js_loader_impl.cpp b/source/loaders/js_loader/source/js_loader_impl.cpp index 8aab317d43..2d86c3e85f 100644 --- a/source/loaders/js_loader/source/js_loader_impl.cpp +++ b/source/loaders/js_loader/source/js_loader_impl.cpp @@ -256,14 +256,14 @@ typedef class loader_impl_js_handle_type parameter_list::iterator param_it; - type ret_type = loader_impl_type(impl, js_f->return_type.c_str()); + type ret_type = loader_impl_get_type(impl, js_f->return_type.c_str()); signature_set_return(s, ret_type); for (param_it = js_f->parameters.begin(); param_it != js_f->parameters.end(); ++param_it) { - type t = loader_impl_type(impl, param_it->type.c_str()); + type t = loader_impl_get_type(impl, param_it->type.c_str()); signature_set(s, param_it->index, param_it->name.c_str(), t); } diff --git a/source/loaders/lua_loader/source/lua_loader_impl.c b/source/loaders/lua_loader/source/lua_loader_impl.c index f09d66952b..a23a3ce363 100644 --- a/source/loaders/lua_loader/source/lua_loader_impl.c +++ b/source/loaders/lua_loader/source/lua_loader_impl.c @@ -491,7 +491,7 @@ int lua_loader_impl_discover(loader_impl impl, loader_handle handle, context ctx signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Integer")); + signature_set_return(s, loader_impl_get_type(impl, "Integer")); value v = value_create_function(f); diff --git a/source/loaders/mock_loader/source/mock_loader_handle.c b/source/loaders/mock_loader/source/mock_loader_handle.c index 2701677a41..7587c30440 100644 --- a/source/loaders/mock_loader/source/mock_loader_handle.c +++ b/source/loaders/mock_loader/source/mock_loader_handle.c @@ -92,7 +92,7 @@ int mock_loader_impl_handle_discover(loader_impl impl, loader_handle handle, con signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Integer")); + signature_set_return(s, loader_impl_get_type(impl, "Integer")); value v = value_create_function(f); @@ -111,11 +111,11 @@ int mock_loader_impl_handle_discover(loader_impl impl, loader_handle handle, con signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Double")); + signature_set_return(s, loader_impl_get_type(impl, "Double")); - signature_set(s, 0, "first_parameter", loader_impl_type(impl, "Double")); + signature_set(s, 0, "first_parameter", loader_impl_get_type(impl, "Double")); - signature_set(s, 1, "second_parameter", loader_impl_type(impl, "Double")); + signature_set(s, 1, "second_parameter", loader_impl_get_type(impl, "Double")); value v = value_create_function(f); @@ -134,17 +134,17 @@ int mock_loader_impl_handle_discover(loader_impl impl, loader_handle handle, con signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Char")); + signature_set_return(s, loader_impl_get_type(impl, "Char")); - signature_set(s, 0, "a_char", loader_impl_type(impl, "Char")); + signature_set(s, 0, "a_char", loader_impl_get_type(impl, "Char")); - signature_set(s, 1, "b_int", loader_impl_type(impl, "Integer")); + signature_set(s, 1, "b_int", loader_impl_get_type(impl, "Integer")); - signature_set(s, 2, "c_long", loader_impl_type(impl, "Long")); + signature_set(s, 2, "c_long", loader_impl_get_type(impl, "Long")); - signature_set(s, 3, "d_double", loader_impl_type(impl, "Double")); + signature_set(s, 3, "d_double", loader_impl_get_type(impl, "Double")); - signature_set(s, 4, "e_ptr", loader_impl_type(impl, "Ptr")); + signature_set(s, 4, "e_ptr", loader_impl_get_type(impl, "Ptr")); value v = value_create_function(f); @@ -163,9 +163,9 @@ int mock_loader_impl_handle_discover(loader_impl impl, loader_handle handle, con signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "String")); + signature_set_return(s, loader_impl_get_type(impl, "String")); - signature_set(s, 0, "str", loader_impl_type(impl, "String")); + signature_set(s, 0, "str", loader_impl_get_type(impl, "String")); value v = value_create_function(f); diff --git a/source/loaders/mock_loader/source/mock_loader_impl.c b/source/loaders/mock_loader/source/mock_loader_impl.c index c068ea52a4..c7032c6f34 100644 --- a/source/loaders/mock_loader/source/mock_loader_impl.c +++ b/source/loaders/mock_loader/source/mock_loader_impl.c @@ -209,7 +209,7 @@ function_return function_mock_interface_invoke(function func, function_impl impl return NULL; } -function_return function_mock_interface_await(function func, function_impl impl, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *context) +function_return function_mock_interface_await(function func, function_impl impl, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *ctx) { /* TODO */ @@ -219,7 +219,7 @@ function_return function_mock_interface_await(function func, function_impl impl, (void)size; (void)resolve_callback; (void)reject_callback; - (void)context; + (void)ctx; return NULL; } @@ -438,7 +438,7 @@ int mock_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Integer")); + signature_set_return(s, loader_impl_get_type(impl, "Integer")); value v = value_create_function(f); @@ -457,11 +457,11 @@ int mock_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Double")); + signature_set_return(s, loader_impl_get_type(impl, "Double")); - signature_set(s, 0, "first_parameter", loader_impl_type(impl, "Double")); + signature_set(s, 0, "first_parameter", loader_impl_get_type(impl, "Double")); - signature_set(s, 1, "second_parameter", loader_impl_type(impl, "Double")); + signature_set(s, 1, "second_parameter", loader_impl_get_type(impl, "Double")); value v = value_create_function(f); @@ -480,17 +480,17 @@ int mock_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Char")); + signature_set_return(s, loader_impl_get_type(impl, "Char")); - signature_set(s, 0, "a_char", loader_impl_type(impl, "Char")); + signature_set(s, 0, "a_char", loader_impl_get_type(impl, "Char")); - signature_set(s, 1, "b_int", loader_impl_type(impl, "Integer")); + signature_set(s, 1, "b_int", loader_impl_get_type(impl, "Integer")); - signature_set(s, 2, "c_long", loader_impl_type(impl, "Long")); + signature_set(s, 2, "c_long", loader_impl_get_type(impl, "Long")); - signature_set(s, 3, "d_double", loader_impl_type(impl, "Double")); + signature_set(s, 3, "d_double", loader_impl_get_type(impl, "Double")); - signature_set(s, 4, "e_ptr", loader_impl_type(impl, "Ptr")); + signature_set(s, 4, "e_ptr", loader_impl_get_type(impl, "Ptr")); value v = value_create_function(f); @@ -509,9 +509,9 @@ int mock_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "String")); + signature_set_return(s, loader_impl_get_type(impl, "String")); - signature_set(s, 0, "a_str", loader_impl_type(impl, "String")); + signature_set(s, 0, "a_str", loader_impl_get_type(impl, "String")); value v = value_create_function(f); @@ -530,11 +530,11 @@ int mock_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "String")); + signature_set_return(s, loader_impl_get_type(impl, "String")); - signature_set(s, 0, "a_str", loader_impl_type(impl, "String")); + signature_set(s, 0, "a_str", loader_impl_get_type(impl, "String")); - signature_set(s, 1, "b_str", loader_impl_type(impl, "String")); + signature_set(s, 1, "b_str", loader_impl_get_type(impl, "String")); value v = value_create_function(f); @@ -553,13 +553,13 @@ int mock_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "String")); + signature_set_return(s, loader_impl_get_type(impl, "String")); - signature_set(s, 0, "a_str", loader_impl_type(impl, "String")); + signature_set(s, 0, "a_str", loader_impl_get_type(impl, "String")); - signature_set(s, 1, "b_str", loader_impl_type(impl, "String")); + signature_set(s, 1, "b_str", loader_impl_get_type(impl, "String")); - signature_set(s, 2, "c_str", loader_impl_type(impl, "String")); + signature_set(s, 2, "c_str", loader_impl_get_type(impl, "String")); value v = value_create_function(f); @@ -578,7 +578,7 @@ int mock_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "String")); + signature_set_return(s, loader_impl_get_type(impl, "String")); value v = value_create_function(f); @@ -597,7 +597,7 @@ int mock_loader_impl_discover(loader_impl impl, loader_handle handle, context ct signature s = function_signature(f); - signature_set_return(s, loader_impl_type(impl, "Integer")); + signature_set_return(s, loader_impl_get_type(impl, "Integer")); value v = value_create_function(f); diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index e13d2abaec..67448ad786 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -3093,7 +3093,7 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di node_loader_impl_exception(env, status); /* TODO: Implement return type with impl (may need an important refactor) */ - signature_set_return(s, /*loader_impl_type(discover_function_safe->impl, return_type_str)*/ NULL); + signature_set_return(s, /*loader_impl_get_type(discover_function_safe->impl, return_type_str)*/ NULL); delete[] return_type_str; } @@ -3154,7 +3154,7 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di node_loader_impl_exception(env, status); /* TODO: Implement parameter type with impl (may need an important refactor) */ - signature_set(s, static_cast(arg_index), parameter_name_str, /*loader_impl_type(discover_function_safe->impl, parameter_type_str)*/ NULL); + signature_set(s, static_cast(arg_index), parameter_name_str, /*loader_impl_get_type(discover_function_safe->impl, parameter_type_str)*/ NULL); if (parameter_type_str != nullptr) { @@ -3458,7 +3458,7 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf node_loader_impl_exception(env, status); - signature_set_return(s, loader_impl_type(discover_safe->node_impl->impl, return_type_str)); + signature_set_return(s, loader_impl_get_type(discover_safe->node_impl->impl, return_type_str)); delete[] return_type_str; } @@ -3518,7 +3518,7 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf node_loader_impl_exception(env, status); - signature_set(s, static_cast(arg_index), parameter_name_str, loader_impl_type(discover_safe->node_impl->impl, parameter_type_str)); + signature_set(s, static_cast(arg_index), parameter_name_str, loader_impl_get_type(discover_safe->node_impl->impl, parameter_type_str)); if (parameter_type_str != nullptr) { diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 3c9800280d..20a5dea5ed 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -1145,7 +1145,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) py_cls->cls = obj; // TODO: We should register the class during the discover as a type, so here we would - // be able to retrieve the the class instance by using loader_impl_type + // be able to retrieve the the class instance by using loader_impl_get_type if (py_loader_impl_discover_class(impl, obj, c) != 0) { @@ -3191,7 +3191,7 @@ type py_loader_impl_discover_type(loader_impl impl, PyObject *annotation, const { if (strcmp(annotation_name, "_empty") != 0) { - t = loader_impl_type(impl, annotation_name); + t = loader_impl_get_type(impl, annotation_name); log_write("metacall", LOG_LEVEL_DEBUG, "Discover type (%p) (%p): %s", (void *)annotation, (void *)type_derived(t), annotation_name); } @@ -3453,7 +3453,7 @@ type py_loader_impl_get_type(loader_impl impl, PyObject *obj) } const char *name = PyUnicode_AsUTF8(t_name); - t = loader_impl_type(impl, name); + t = loader_impl_get_type(impl, name); if (t == NULL) { diff --git a/source/loaders/rb_loader/source/rb_loader_impl.c b/source/loaders/rb_loader/source/rb_loader_impl.c index 67b9a7805e..984524633c 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl.c +++ b/source/loaders/rb_loader/source/rb_loader_impl.c @@ -1592,7 +1592,7 @@ int rb_loader_impl_discover_func(loader_impl impl, function f, rb_function_parse for (index = 0; index < size; ++index) { - signature_set(s, index, function_parser->params[index].name, loader_impl_type(impl, function_parser->params[index].type)); + signature_set(s, index, function_parser->params[index].name, loader_impl_get_type(impl, function_parser->params[index].type)); } return 0; diff --git a/source/loaders/rs_loader/rust/compiler/src/api/class.rs b/source/loaders/rs_loader/rust/compiler/src/api/class.rs index 7469451e45..b9aad0996a 100644 --- a/source/loaders/rs_loader/rust/compiler/src/api/class.rs +++ b/source/loaders/rs_loader/rust/compiler/src/api/class.rs @@ -175,7 +175,7 @@ pub fn register_class(class_registration: ClassRegistration) { ctor, idx, name.as_ptr(), - loader_impl_type(class_registration.loader_impl, t.as_ptr()), + loader_impl_get_type(class_registration.loader_impl, t.as_ptr()), ) }; } @@ -195,7 +195,7 @@ pub fn register_class(class_registration: ClassRegistration) { attribute_create( class, name.as_ptr(), - loader_impl_type(class_registration.loader_impl, ty.as_ptr()), + loader_impl_get_type(class_registration.loader_impl, ty.as_ptr()), std::ptr::null_mut(), 0, std::ptr::null_mut(), @@ -233,7 +233,7 @@ pub fn register_class(class_registration: ClassRegistration) { unsafe { signature_set_return( s, - loader_impl_type(class_registration.loader_impl, ret.as_ptr()), + loader_impl_get_type(class_registration.loader_impl, ret.as_ptr()), ); }; } else { @@ -242,7 +242,7 @@ pub fn register_class(class_registration: ClassRegistration) { unsafe { signature_set_return( s, - loader_impl_type(class_registration.loader_impl, ret.as_ptr()), + loader_impl_get_type(class_registration.loader_impl, ret.as_ptr()), ); }; } @@ -257,7 +257,7 @@ pub fn register_class(class_registration: ClassRegistration) { s, idx, name.as_ptr(), - loader_impl_type(class_registration.loader_impl, t.as_ptr()), + loader_impl_get_type(class_registration.loader_impl, t.as_ptr()), ) }; } @@ -286,7 +286,7 @@ pub fn register_class(class_registration: ClassRegistration) { unsafe { signature_set_return( s, - loader_impl_type(class_registration.loader_impl, ret.as_ptr()), + loader_impl_get_type(class_registration.loader_impl, ret.as_ptr()), ); }; } else { @@ -295,7 +295,7 @@ pub fn register_class(class_registration: ClassRegistration) { unsafe { signature_set_return( s, - loader_impl_type(class_registration.loader_impl, ret.as_ptr()), + loader_impl_get_type(class_registration.loader_impl, ret.as_ptr()), ); }; } @@ -310,7 +310,7 @@ pub fn register_class(class_registration: ClassRegistration) { s, idx, name.as_ptr(), - loader_impl_type(class_registration.loader_impl, t.as_ptr()), + loader_impl_get_type(class_registration.loader_impl, t.as_ptr()), ) }; } diff --git a/source/loaders/rs_loader/rust/compiler/src/api/function.rs b/source/loaders/rs_loader/rust/compiler/src/api/function.rs index 9adabbd779..9079da8880 100644 --- a/source/loaders/rs_loader/rust/compiler/src/api/function.rs +++ b/source/loaders/rs_loader/rust/compiler/src/api/function.rs @@ -114,7 +114,7 @@ pub fn register_function(function_registration: FunctionRegistration) { unsafe { signature_set_return( s, - loader_impl_type(function_registration.loader_impl, ret.as_ptr()), + loader_impl_get_type(function_registration.loader_impl, ret.as_ptr()), ); }; } else { @@ -123,7 +123,7 @@ pub fn register_function(function_registration: FunctionRegistration) { unsafe { signature_set_return( s, - loader_impl_type(function_registration.loader_impl, ret.as_ptr()), + loader_impl_get_type(function_registration.loader_impl, ret.as_ptr()), ); }; } @@ -139,7 +139,7 @@ pub fn register_function(function_registration: FunctionRegistration) { s, index, name.as_ptr(), - loader_impl_type(function_registration.loader_impl, t.as_ptr()), + loader_impl_get_type(function_registration.loader_impl, t.as_ptr()), ) }; } diff --git a/source/loaders/rs_loader/rust/compiler/src/api/mod.rs b/source/loaders/rs_loader/rust/compiler/src/api/mod.rs index e42f22cfe8..2232ac8d29 100644 --- a/source/loaders/rs_loader/rust/compiler/src/api/mod.rs +++ b/source/loaders/rs_loader/rust/compiler/src/api/mod.rs @@ -70,7 +70,7 @@ extern "C" { fn signature_set_return(signature: OpaqueType, t: OpaqueType); - fn loader_impl_type(loader_impl: OpaqueType, name: *const c_char) -> OpaqueType; + fn loader_impl_get_type(loader_impl: OpaqueType, name: *const c_char) -> OpaqueType; fn scope_define(scope: OpaqueType, key: *mut c_char, value: OpaqueType) -> c_int; fn class_create( diff --git a/source/loaders/ts_loader/source/ts_loader_impl.cpp b/source/loaders/ts_loader/source/ts_loader_impl.cpp index 0fe63c24ce..23c0db2188 100644 --- a/source/loaders/ts_loader/source/ts_loader_impl.cpp +++ b/source/loaders/ts_loader/source/ts_loader_impl.cpp @@ -353,11 +353,11 @@ int ts_loader_impl_discover_value(loader_impl impl, context ctx, void *discover) { const char *type_name = metacall_value_to_string(types_array[iterator]); const char *parameter_name = metacall_value_to_string(signature_array[iterator]); - type t = loader_impl_type(impl, type_name); + type t = loader_impl_get_type(impl, type_name); signature_set(s, iterator, parameter_name, t); } - signature_set_return(s, loader_impl_type(impl, metacall_value_to_string(ts_func.data["ret"]))); + signature_set_return(s, loader_impl_get_type(impl, metacall_value_to_string(ts_func.data["ret"]))); function_async(f, is_async == 1L ? ASYNCHRONOUS : SYNCHRONOUS); diff --git a/source/loaders/wasm_loader/source/wasm_loader_handle.c b/source/loaders/wasm_loader/source/wasm_loader_handle.c index 1be45efade..2309c5dbaf 100644 --- a/source/loaders/wasm_loader/source/wasm_loader_handle.c +++ b/source/loaders/wasm_loader/source/wasm_loader_handle.c @@ -138,13 +138,13 @@ static type valkind_to_type(loader_impl impl, wasm_valkind_t kind) switch (kind) { case WASM_I32: - return loader_impl_type(impl, "i32"); + return loader_impl_get_type(impl, "i32"); case WASM_I64: - return loader_impl_type(impl, "i64"); + return loader_impl_get_type(impl, "i64"); case WASM_F32: - return loader_impl_type(impl, "f32"); + return loader_impl_get_type(impl, "f32"); case WASM_F64: - return loader_impl_type(impl, "f64"); + return loader_impl_get_type(impl, "f64"); default: return NULL; } @@ -191,7 +191,7 @@ static int discover_function(loader_impl impl, scope scp, const wasm_externtype_ if (results->size > 0) { - type ret_type = results->size == 1 ? valkind_to_type(impl, wasm_valtype_kind(results->data[0])) : loader_impl_type(impl, "array"); + type ret_type = results->size == 1 ? valkind_to_type(impl, wasm_valtype_kind(results->data[0])) : loader_impl_get_type(impl, "array"); signature_set_return(sig, ret_type); } diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index a28f82154a..6390d6fba9 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -957,14 +957,14 @@ void *metacall_function(const char *name) return f; } -int metacall_handle_initialize(void *loader, const char *name, void **handle_ptr) +int metacall_handle_initialize(void *loader_ptr, const char *name, void **handle_ptr) { - if (loader == NULL) + if (loader_ptr == NULL) { return 1; } - return loader_handle_initialize(loader, name, handle_ptr); + return loader_handle_initialize(loader_ptr, name, handle_ptr); } int metacall_handle_populate(void *handle_dest, void *handle_src) @@ -1618,9 +1618,9 @@ void *metacall_loader(const char *tag) return loader_get_impl(tag); } -int metacall_register_loaderv(void *loader, void *handle, const char *name, void *(*invoke)(size_t, void *[], void *), enum metacall_value_id return_type, size_t size, enum metacall_value_id types[], void *data) +int metacall_register_loaderv(void *loader_ptr, void *handle, const char *name, void *(*invoke)(size_t, void *[], void *), enum metacall_value_id return_type, size_t size, enum metacall_value_id types[], void *data) { - return loader_register_handle(loader, handle, name, (loader_register_invoke)invoke, (type_id)return_type, size, (type_id *)types, data); + return loader_register_handle(loader_ptr, handle, name, (loader_register_invoke)invoke, (type_id)return_type, size, (type_id *)types, data); } void *metacall_await(const char *name, void *args[], void *(*resolve_callback)(void *, void *), void *(*reject_callback)(void *, void *), void *data) diff --git a/source/metacall/source/metacall_link.c b/source/metacall/source/metacall_link.c index 620ce8ad7f..6d24ae19bf 100644 --- a/source/metacall/source/metacall_link.c +++ b/source/metacall/source/metacall_link.c @@ -187,7 +187,7 @@ int metacall_link_register(const char *tag, const char *library, const char *sym return set_insert(metacall_link_table, (set_key)symbol, ptr); } -int metacall_link_register_loader(void *loader, const char *library, const char *symbol, void (*fn)(void)) +int metacall_link_register_loader(void *loader_ptr, const char *library, const char *symbol, void (*fn)(void)) { void *ptr; @@ -196,7 +196,7 @@ int metacall_link_register_loader(void *loader, const char *library, const char return 1; } - if (loader_hook_impl(loader, library, metacall_link_register_load_cb) == NULL) + if (loader_hook_impl(loader_ptr, library, metacall_link_register_load_cb) == NULL) { return 1; } diff --git a/source/reflect/include/reflect/reflect_attribute_decl.h b/source/reflect/include/reflect/reflect_attribute_decl.h index 3d7dabe735..38337c9fa5 100644 --- a/source/reflect/include/reflect/reflect_attribute_decl.h +++ b/source/reflect/include/reflect/reflect_attribute_decl.h @@ -25,11 +25,11 @@ extern "C" { #endif -struct attribute_type; +struct attribute_s; typedef void *attribute_impl; -typedef struct attribute_type *attribute; +typedef struct attribute_s *attribute; typedef void (*attribute_impl_interface_destroy)(attribute, attribute_impl); diff --git a/source/reflect/source/reflect_attribute.c b/source/reflect/source/reflect_attribute.c index c251a478b8..8e297e8997 100644 --- a/source/reflect/source/reflect_attribute.c +++ b/source/reflect/source/reflect_attribute.c @@ -25,7 +25,7 @@ #include #include -struct attribute_type +struct attribute_s { klass cls; char *name; @@ -40,7 +40,7 @@ static value attribute_metadata_visibility(attribute attr); attribute attribute_create(klass cls, const char *name, type t, attribute_impl impl, enum class_visibility_id visibility, attribute_impl_interface_singleton singleton) { - attribute attr = malloc(sizeof(struct attribute_type)); + attribute attr = malloc(sizeof(struct attribute_s)); if (attr == NULL) { diff --git a/source/reflect/source/reflect_value_type.c b/source/reflect/source/reflect_value_type.c index 5429d6ff27..61195c5d87 100644 --- a/source/reflect/source/reflect_value_type.c +++ b/source/reflect/source/reflect_value_type.c @@ -543,9 +543,9 @@ value value_from_string(value v, const char *str, size_t length) if (bytes > current_size) { - char *str = value_to_string(v); + char *v_str = value_to_string(v); - str[size - 1] = '\0'; + v_str[size - 1] = '\0'; } } } diff --git a/source/tests/reflect_metadata_test/source/reflect_metadata_test.cpp b/source/tests/reflect_metadata_test/source/reflect_metadata_test.cpp index 9bda07d831..d48c2252e8 100644 --- a/source/tests/reflect_metadata_test/source/reflect_metadata_test.cpp +++ b/source/tests/reflect_metadata_test/source/reflect_metadata_test.cpp @@ -79,7 +79,7 @@ function_return function_example_interface_invoke(function func, function_impl f return NULL; } -function_return function_example_interface_await(function func, function_impl impl, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *context) +function_return function_example_interface_await(function func, function_impl impl, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *ctx) { /* TODO */ @@ -89,7 +89,7 @@ function_return function_example_interface_await(function func, function_impl im (void)size; (void)resolve_callback; (void)reject_callback; - (void)context; + (void)ctx; return NULL; } diff --git a/source/tests/reflect_scope_test/source/reflect_scope_test.cpp b/source/tests/reflect_scope_test/source/reflect_scope_test.cpp index f9c5cf6baa..43ee782e79 100644 --- a/source/tests/reflect_scope_test/source/reflect_scope_test.cpp +++ b/source/tests/reflect_scope_test/source/reflect_scope_test.cpp @@ -82,7 +82,7 @@ function_return function_example_interface_invoke(function func, function_impl f return NULL; } -function_return function_example_interface_await(function func, function_impl impl, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *context) +function_return function_example_interface_await(function func, function_impl impl, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *ctx) { /* TODO */ @@ -92,7 +92,7 @@ function_return function_example_interface_await(function func, function_impl im (void)size; (void)resolve_callback; (void)reject_callback; - (void)context; + (void)ctx; return NULL; }