From d7a2888b18c478d87ce8094e1419b4e061db289f Mon Sep 17 00:00:00 2001 From: Wenyong Huang Date: Mon, 16 May 2022 09:12:58 +0800 Subject: [PATCH] Fix Windows compilation warnings (#1171) And update the Zephyr platform sample help, add arc target into usage list. --- core/iwasm/common/wasm_runtime_common.c | 2 +- core/iwasm/interpreter/wasm_interp_classic.c | 2 +- core/iwasm/interpreter/wasm_interp_fast.c | 2 +- product-mini/platforms/zephyr/simple/build_and_run.sh | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/iwasm/common/wasm_runtime_common.c b/core/iwasm/common/wasm_runtime_common.c index 858263a9a..c6c849300 100644 --- a/core/iwasm/common/wasm_runtime_common.c +++ b/core/iwasm/common/wasm_runtime_common.c @@ -1273,7 +1273,7 @@ wasm_runtime_prepare_call_function(WASMExecEnv *exec_env, } if (!need_param_transform) { - bh_memcpy_s(new_argv, size, argv, size); + bh_memcpy_s(new_argv, (uint32)size, argv, (uint32)size); } else { for (param_i = 0; param_i < func_type->param_count && argv_i < argc diff --git a/core/iwasm/interpreter/wasm_interp_classic.c b/core/iwasm/interpreter/wasm_interp_classic.c index 6098ed6f3..150d55626 100644 --- a/core/iwasm/interpreter/wasm_interp_classic.c +++ b/core/iwasm/interpreter/wasm_interp_classic.c @@ -787,7 +787,7 @@ wasm_interp_call_func_native(WASMModuleInstance *module_inst, wasm_exec_env_set_cur_frame(exec_env, frame); - cur_func_index = cur_func - module_inst->functions; + cur_func_index = (uint32)(cur_func - module_inst->functions); bh_assert(cur_func_index < module_inst->module->import_function_count); native_func_pointer = module_inst->import_func_ptrs[cur_func_index]; diff --git a/core/iwasm/interpreter/wasm_interp_fast.c b/core/iwasm/interpreter/wasm_interp_fast.c index f09b5ebc9..b64609d7a 100644 --- a/core/iwasm/interpreter/wasm_interp_fast.c +++ b/core/iwasm/interpreter/wasm_interp_fast.c @@ -854,7 +854,7 @@ wasm_interp_call_func_native(WASMModuleInstance *module_inst, wasm_exec_env_set_cur_frame(exec_env, frame); - cur_func_index = cur_func - module_inst->functions; + cur_func_index = (uint32)(cur_func - module_inst->functions); bh_assert(cur_func_index < module_inst->module->import_function_count); native_func_pointer = module_inst->import_func_ptrs[cur_func_index]; diff --git a/product-mini/platforms/zephyr/simple/build_and_run.sh b/product-mini/platforms/zephyr/simple/build_and_run.sh index d2948af32..921f88363 100755 --- a/product-mini/platforms/zephyr/simple/build_and_run.sh +++ b/product-mini/platforms/zephyr/simple/build_and_run.sh @@ -28,6 +28,7 @@ usage () echo " $0 $QEMU_XTENSA_TARGET" echo " $0 $QEMU_RISCV64_TARGET" echo " $0 $QEMU_RISCV32_TARGET" + echo " $0 $QEMU_ARC_TARGET" exit 1 }