diff --git a/platforms/app/main.c b/platforms/app/main.c index 358941a..83a8cb6 100644 --- a/platforms/app/main.c +++ b/platforms/app/main.c @@ -198,8 +198,8 @@ M3Result repl_invoke (const char* name, int argc, const char* argv[]) return "too many args"; } - uint64_t args[arg_count]; - const void* argptrs[arg_count]; + static uint64_t args[128]; + static const void* argptrs[128]; memset(args, 0, sizeof(args)); memset(argptrs, 0, sizeof(argptrs)); diff --git a/platforms/cpp/wasm3_cpp/include/wasm3_cpp.h b/platforms/cpp/wasm3_cpp/include/wasm3_cpp.h index 060c564..4bf91ef 100644 --- a/platforms/cpp/wasm3_cpp/include/wasm3_cpp.h +++ b/platforms/cpp/wasm3_cpp/include/wasm3_cpp.h @@ -348,22 +348,6 @@ namespace wasm3 { return ret; } - /** - * Call the function which doesn't take any arguments. - * Note that the type of the return value must be explicitly specified as a template argument. - * @return the return value of the function. - */ - template - Ret call() { - M3Result res = m3_Call(m_func); - detail::check_error(res); - Ret ret; - /* FIXME: there should be a public API to get the return value */ - auto sp = (detail::stack_type) m_runtime->stack; - detail::arg_from_stack(ret, sp, nullptr); - return ret; - } - protected: friend class runtime; diff --git a/platforms/python/m3module.c b/platforms/python/m3module.c index 8f33b97..5ed6ace 100644 --- a/platforms/python/m3module.c +++ b/platforms/python/m3module.c @@ -130,13 +130,6 @@ M3_Runtime_get_memory(m3_runtime *runtime, PyObject *index) return PyMemoryView_FromBuffer(&view); } -static PyObject * -M3_Runtime_print_info(m3_runtime *runtime) -{ - m3_PrintRuntimeInfo(runtime->r); - Py_RETURN_NONE; -} - static PyMethodDef M3_Runtime_methods[] = { {"load", (PyCFunction)M3_Runtime_load, METH_O, PyDoc_STR("load(module) -> None")}, @@ -144,8 +137,6 @@ static PyMethodDef M3_Runtime_methods[] = { PyDoc_STR("find_function(name) -> Function")}, {"get_memory", (PyCFunction)M3_Runtime_get_memory, METH_O, PyDoc_STR("get_memory(index) -> memoryview")}, - {"print_info", (PyCFunction)M3_Runtime_print_info, METH_NOARGS, - PyDoc_STR("print_info()")}, {NULL, NULL} /* sentinel */ }; diff --git a/source/m3_env.c b/source/m3_env.c index 1bd80be..f2b6d7a 100644 --- a/source/m3_env.c +++ b/source/m3_env.c @@ -871,7 +871,7 @@ M3Result m3_CallWithArgs (IM3Function i_function, uint32_t i_argc, const char switch (d_FuncArgType(ftype, i)) { case c_m3Type_i32: *(i32*)(s) = strtoul(i_argv[i], NULL, 10); break; case c_m3Type_i64: *(i64*)(s) = strtoull(i_argv[i], NULL, 10); break; - case c_m3Type_f32: *(f32*)(s) = strtof(i_argv[i], NULL); break; + case c_m3Type_f32: *(f32*)(s) = strtod(i_argv[i], NULL); break; case c_m3Type_f64: *(f64*)(s) = strtod(i_argv[i], NULL); break; default: return "unknown argument type"; }