diff options
-rw-r--r-- | src/allocator.h | 2 | ||||
-rw-r--r-- | src/ast.h | 8 | ||||
-rw-r--r-- | src/vector.h | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/allocator.h b/src/allocator.h index 56890ebc..e074b4ac 100644 --- a/src/allocator.h +++ b/src/allocator.h @@ -105,7 +105,7 @@ static WASM_INLINE char* wasm_strndup_(WasmAllocator* allocator, real_len++; } - char* new_s = allocator->alloc(allocator, real_len + 1, 1, file, line); + char* new_s = (char*)allocator->alloc(allocator, real_len + 1, 1, file, line); memcpy(new_s, s, real_len); new_s[real_len] = 0; return new_s; @@ -506,14 +506,16 @@ void wasm_make_type_binding_reverse_mapping( static WASM_INLINE WasmBool wasm_decl_has_func_type(const WasmFuncDeclaration* decl) { - return decl->flags & WASM_FUNC_DECLARATION_FLAG_HAS_FUNC_TYPE; + return (WasmBool)((decl->flags & WASM_FUNC_DECLARATION_FLAG_HAS_FUNC_TYPE) != + 0); } static WASM_INLINE WasmBool wasm_signatures_are_equal(const WasmFuncSignature* sig1, const WasmFuncSignature* sig2) { - return wasm_type_vectors_are_equal(&sig1->param_types, &sig2->param_types) && - wasm_type_vectors_are_equal(&sig1->result_types, &sig2->result_types); + return (WasmBool)( + wasm_type_vectors_are_equal(&sig1->param_types, &sig2->param_types) && + wasm_type_vectors_are_equal(&sig1->result_types, &sig2->result_types)); } static WASM_INLINE size_t wasm_get_num_params(const WasmFunc* func) { diff --git a/src/vector.h b/src/vector.h index f64b611c..a40b7a42 100644 --- a/src/vector.h +++ b/src/vector.h @@ -90,8 +90,9 @@ } \ type* wasm_append_##name(struct WasmAllocator* allocator, \ type##Vector* vec) { \ - return wasm_append_element(allocator, (void**)&vec->data, &vec->size, \ - &vec->capacity, sizeof(type)); \ + return (type*)wasm_append_element(allocator, (void**)&vec->data, \ + &vec->size, &vec->capacity, \ + sizeof(type)); \ } \ void wasm_append_##name##_value(struct WasmAllocator* allocator, \ type##Vector* vec, const type* value) { \ |