Skip to content

Commit

Permalink
fix(runtime-c-api) wasmer_instance_call types matches `wasmer_expor…
Browse files Browse the repository at this point in the history
…t_func_*_arity`.

The `wasmer_export_func_params_arity` and
`wasmer_export_func_returns_arity` functions store the arity in a
`uint32_t`. The `wasmer_instance_call` expects `c_int`. There is a
type mismatch here. It's not annoying in C or C++, but in some other
languages that have bindings to C/C++, it can imply useless casting.

This patch changes `wasmer_instance_call` to expect `uint32_t` for
`params_len` and `results_len` to match the
`wasmer_export_func_*_arity` functions.
  • Loading branch information
Hywan committed May 14, 2019
1 parent 7e00bef commit d3c75a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/runtime-c-api/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ pub unsafe extern "C" fn wasmer_instance_call(
instance: *mut wasmer_instance_t,
name: *const c_char,
params: *const wasmer_value_t,
params_len: c_int,
params_len: uint32_t,
results: *mut wasmer_value_t,
results_len: c_int,
results_len: uint32_t,
) -> wasmer_result_t {
if instance.is_null() {
update_last_error(CApiError {
Expand Down

0 comments on commit d3c75a3

Please sign in to comment.