Remove unnecessary function

This commit is contained in:
King_DuckZ 2022-04-22 22:38:19 +02:00
parent f749b7fb18
commit 1a01a016f2

View file

@ -36,19 +36,6 @@ namespace wren {
void load_module_complete_fn (WrenVM* wvm, const char* name, struct WrenLoadModuleResult result);
WrenLoadModuleResult to_wren_load_module_result (
const char* source,
const detail::Callbacks& cb,
void* user_data
) {
assert(cb.owner);
return ::WrenLoadModuleResult{
.source = source,
.onComplete = (cb.load_module_complete_fn ? &load_module_complete_fn : nullptr),
.userData = user_data
};
}
void write_fn (WrenVM* wvm, const char* text) {
auto cb = static_cast<detail::Callbacks*>(wrenGetUserData(wvm));
assert(cb);
@ -82,7 +69,13 @@ namespace wren {
auto cb = static_cast<detail::Callbacks*>(user_data);
assert(cb);
assert(cb->load_module_fn and cb->config_obj and cb->owner);
return to_wren_load_module_result(cb->load_module_fn(*cb->config_obj, cb->owner, name), *cb, user_data);
char* const source = cb->load_module_fn(*cb->config_obj, cb->owner, name);
return ::WrenLoadModuleResult{
.source = source,
.onComplete = (cb->load_module_complete_fn ? &load_module_complete_fn : nullptr),
.userData = user_data
};
}
WrenForeignMethodFn foreign_method_fn (WrenVM* wvm, const char* module, const char* class_name, bool is_static, const char* signature) {