@@ -48,7 +48,7 @@ rotl32(uint32 n, uint32 c)
4848 const uint32 mask = (31 );
4949 c = c % 32 ;
5050 c &= mask ;
51- return (n << c ) | (n >>( ( - c ) & mask ));
51+ return (n << c ) | (n >> (( 0 - c ) & mask ));
5252}
5353
5454static inline uint32
@@ -57,7 +57,7 @@ rotr32(uint32 n, uint32 c)
5757 const uint32 mask = (31 );
5858 c = c % 32 ;
5959 c &= mask ;
60- return (n >> c ) | (n <<( ( - c ) & mask ));
60+ return (n >> c ) | (n << (( 0 - c ) & mask ));
6161}
6262
6363static inline uint64
@@ -66,7 +66,7 @@ rotl64(uint64 n, uint64 c)
6666 const uint64 mask = (63 );
6767 c = c % 64 ;
6868 c &= mask ;
69- return (n << c ) | (n >>( ( - c ) & mask ));
69+ return (n << c ) | (n >> (( 0 - c ) & mask ));
7070}
7171
7272static inline uint64
@@ -75,7 +75,7 @@ rotr64(uint64 n, uint64 c)
7575 const uint64 mask = (63 );
7676 c = c % 64 ;
7777 c &= mask ;
78- return (n >> c ) | (n <<( ( - c ) & mask ));
78+ return (n >> c ) | (n << (( 0 - c ) & mask ));
7979}
8080
8181static inline double
@@ -455,7 +455,8 @@ LOAD_PTR(void *addr)
455455
456456#define DEF_OP_MATH (src_type , src_op_type , method ) do { \
457457 SET_OPERAND(src_op_type, 2, \
458- method(GET_OPERAND(src_type, src_op_type, 0))); \
458+ (src_type)method(GET_OPERAND(src_type, \
459+ src_op_type, 0))); \
459460 frame_ip += 4; \
460461 } while (0)
461462
@@ -2229,7 +2230,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
22292230 else if (isnan (b ))
22302231 * (float32 * )(frame_lp + GET_OFFSET ()) = b ;
22312232 else
2232- * (float32 * )(frame_lp + GET_OFFSET ()) = wa_fmin (a , b );
2233+ * (float32 * )(frame_lp + GET_OFFSET ()) = ( float32 ) wa_fmin (a , b );
22332234 HANDLE_OP_END ();
22342235 }
22352236
@@ -2245,7 +2246,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
22452246 else if (isnan (b ))
22462247 * (float32 * )(frame_lp + GET_OFFSET ()) = b ;
22472248 else
2248- * (float32 * )(frame_lp + GET_OFFSET ()) = wa_fmax (a , b );
2249+ * (float32 * )(frame_lp + GET_OFFSET ()) = ( float32 ) wa_fmax (a , b );
22492250 HANDLE_OP_END ();
22502251 }
22512252
@@ -2255,7 +2256,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
22552256
22562257 b = * (float32 * )(frame_lp + GET_OFFSET ());
22572258 a = * (float32 * )(frame_lp + GET_OFFSET ());
2258- * (float32 * )(frame_lp + GET_OFFSET ()) = (signbit (b ) ? - fabs (a ) : fabs (a ));
2259+ * (float32 * )(frame_lp + GET_OFFSET ()) =
2260+ (float32 )(signbit (b ) ? - fabs (a ) : fabs (a ));
22592261 HANDLE_OP_END ();
22602262 }
22612263
@@ -2606,7 +2608,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
26062608 if (offset + bytes > seg_len )
26072609 goto out_of_bounds ;
26082610
2609- bh_memcpy_s (maddr , linear_mem_size - addr , data + offset , bytes );
2611+ bh_memcpy_s (maddr , linear_mem_size - addr ,
2612+ data + offset , (uint32 )bytes );
26102613 break ;
26112614 }
26122615 case WASM_OP_DATA_DROP :
@@ -2695,9 +2698,9 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
26952698 bh_memcpy_s (
26962699 (uint8 * )tbl_inst + offsetof (WASMTableInstance , base_addr )
26972700 + d * sizeof (uint32 ),
2698- (tbl_inst - > cur_size - d ) * sizeof (uint32 ),
2701+ (uint32 )(( tbl_inst - > cur_size - d ) * sizeof (uint32 ) ),
26992702 module - > module - > table_segments [elem_idx ].func_indexes + s ,
2700- n * sizeof (uint32 ));
2703+ ( uint32 )( n * sizeof (uint32 ) ));
27012704 break ;
27022705 }
27032706 case WASM_OP_ELEM_DROP :
@@ -2740,10 +2743,10 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
27402743 bh_memmove_s (
27412744 (uint8 * )dst_tbl_inst + offsetof (WASMTableInstance , base_addr )
27422745 + d * sizeof (uint32 ),
2743- (dst_tbl_inst - > cur_size - d ) * sizeof (uint32 ),
2746+ (uint32 )(( dst_tbl_inst - > cur_size - d ) * sizeof (uint32 ) ),
27442747 (uint8 * )src_tbl_inst
27452748 + offsetof (WASMTableInstance , base_addr ) + s * sizeof (uint32 ),
2746- n * sizeof (uint32 ));
2749+ ( uint32 )( n * sizeof (uint32 ) ));
27472750 break ;
27482751 }
27492752 case WASM_OP_TABLE_GROW :
0 commit comments