Remove unnecessary function
This commit is contained in:
parent
f749b7fb18
commit
1a01a016f2
1 changed files with 7 additions and 14 deletions
21
src/vm.cpp
21
src/vm.cpp
|
@ -36,19 +36,6 @@ namespace wren {
|
||||||
|
|
||||||
void load_module_complete_fn (WrenVM* wvm, const char* name, struct WrenLoadModuleResult result);
|
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) {
|
void write_fn (WrenVM* wvm, const char* text) {
|
||||||
auto cb = static_cast<detail::Callbacks*>(wrenGetUserData(wvm));
|
auto cb = static_cast<detail::Callbacks*>(wrenGetUserData(wvm));
|
||||||
assert(cb);
|
assert(cb);
|
||||||
|
@ -82,7 +69,13 @@ namespace wren {
|
||||||
auto cb = static_cast<detail::Callbacks*>(user_data);
|
auto cb = static_cast<detail::Callbacks*>(user_data);
|
||||||
assert(cb);
|
assert(cb);
|
||||||
assert(cb->load_module_fn and cb->config_obj and cb->owner);
|
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) {
|
WrenForeignMethodFn foreign_method_fn (WrenVM* wvm, const char* module, const char* class_name, bool is_static, const char* signature) {
|
||||||
|
|
Loading…
Reference in a new issue