Get rid of compilation warnings and minor doc fix (#2839)

This commit is contained in:
Enrico Loparco 2023-11-30 00:49:58 +00:00 committed by GitHub
parent 0455071fc1
commit 873558c40e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -5873,7 +5873,7 @@ wasm_runtime_register_sub_module(const WASMModuleCommon *parent_module,
{
/* register sub_module into its parent sub module list */
WASMRegisteredModule *node = NULL;
bh_list_status ret;
bh_list_status ret = BH_LIST_ERROR;
if (wasm_runtime_search_sub_module(parent_module, sub_module_name)) {
LOG_DEBUG("%s has been registered in its parent", sub_module_name);

View File

@ -479,7 +479,7 @@ os_preadv(os_file_handle handle, const struct __wasi_iovec_t *iov, int iovcnt,
// Allocate a single buffer to fit all data.
size_t totalsize = 0;
for (size_t i = 0; i < iovcnt; ++i)
for (int i = 0; i < iovcnt; ++i)
totalsize += iov[i].buf_len;
char *buf = BH_MALLOC(totalsize);
@ -498,7 +498,7 @@ os_preadv(os_file_handle handle, const struct __wasi_iovec_t *iov, int iovcnt,
// Copy data back to vectors.
size_t bufoff = 0;
for (size_t i = 0; i < iovcnt; ++i) {
for (int i = 0; i < iovcnt; ++i) {
if (bufoff + iov[i].buf_len < (size_t)len) {
memcpy(iov[i].buf, buf + bufoff, iov[i].buf_len);
bufoff += iov[i].buf_len;
@ -533,14 +533,14 @@ os_pwritev(os_file_handle handle, const struct __wasi_ciovec_t *iov, int iovcnt,
else {
// Allocate a single buffer to fit all data.
size_t totalsize = 0;
for (size_t i = 0; i < iovcnt; ++i)
for (int i = 0; i < iovcnt; ++i)
totalsize += iov[i].buf_len;
char *buf = BH_MALLOC(totalsize);
if (buf == NULL) {
return __WASI_ENOMEM;
}
size_t bufoff = 0;
for (size_t i = 0; i < iovcnt; ++i) {
for (int i = 0; i < iovcnt; ++i) {
memcpy(buf + bufoff, iov[i].buf, iov[i].buf_len);
bufoff += iov[i].buf_len;
}

View File

@ -9,12 +9,12 @@ $ mkdir build
$ cd build
$ cmake ..
$ make
$ # It will build multi-module runtime and
$ # It will build multi_module runtime and
$ # wasm file under the ./build .
$ # If you have built wamrc,
$ # aot file will also genrate.
$ ./multi-module mC.wasm
$ ./multi_module mC.wasm
$ ...
$ ./multi-module mC.aot
$ ./multi_module mC.aot
$ ...