feat(runtime-c-api) wasmer_validate expects a *const uint8_t.

This patch updates the first argument of `wasmer_validate` from `*mut
uint8_t` to `*const uint8_t`. Indeed, the
`wasmer-runtime-core::validate` function doesn't expect a mutable
slice, so it's not required to expect a mutable array from C.

Also, it's likely for the Wasm bytes to be stored in the
`wasmer_byte_array` structure. The first field `bytes` is defined as
`*const uint8_t`. So this patch avoids a cast when writing a C++
program.
This commit is contained in:
Ivan Enderlin
2019-03-14 12:33:40 +01:00
parent 97187f6d21
commit 5b98ee732c
3 changed files with 4 additions and 4 deletions

View File

@ -535,6 +535,6 @@ wasmer_result_t wasmer_table_new(wasmer_table_t **table, wasmer_limits_t limits)
/**
* Returns true for valid wasm bytes and false for invalid bytes
*/
bool wasmer_validate(uint8_t *wasm_bytes, uint32_t wasm_bytes_len);
bool wasmer_validate(const uint8_t *wasm_bytes, uint32_t wasm_bytes_len);
#endif /* WASMER_H */