diff --git a/example/finalize.c b/example/finalize.c index 6841617..8a342d7 100644 --- a/example/finalize.c +++ b/example/finalize.c @@ -10,7 +10,7 @@ const int iterations = 100000; void finalize(void* data) { - int i = (int)data; + int i = (intptr_t)data; if (i % (iterations / 10) == 0) printf("Finalizing #%d...\n", i); } diff --git a/src/wasm-bin.cc b/src/wasm-bin.cc index d43a3a1..b3036e1 100644 --- a/src/wasm-bin.cc +++ b/src/wasm-bin.cc @@ -82,7 +82,7 @@ void encode_const_zero(char*& ptr, const ValType* type) { case F64: *ptr++ = 0x44; break; default: assert(false); } - for (int i = 0; i < zero_size(type); ++i) *ptr++ = 0; + for (size_t i = 0; i < zero_size(type); ++i) *ptr++ = 0; } @@ -123,7 +123,7 @@ auto wrapper(const FuncType* type) -> vec { *ptr++ = 0x00; // func *ptr++ = 0; // func index - assert(ptr - binary.get() == size); + assert(static_cast(ptr - binary.get()) == size); return binary; } @@ -149,7 +149,7 @@ auto wrapper(const GlobalType* type) -> vec { *ptr++ = 0x03; // global *ptr++ = 0; // func index - assert(ptr - binary.get() == size); + assert(static_cast(ptr - binary.get()) == size); return binary; } diff --git a/src/wasm-v8.cc b/src/wasm-v8.cc index c46ff09..8d0a246 100644 --- a/src/wasm-v8.cc +++ b/src/wasm-v8.cc @@ -605,6 +605,7 @@ auto ExternType::copy() const -> own { case EXTERN_GLOBAL: return global()->copy(); case EXTERN_TABLE: return table()->copy(); case EXTERN_MEMORY: return memory()->copy(); + default: assert(false); } } @@ -1100,6 +1101,7 @@ auto v8_to_val( UNIMPLEMENTED("ref value"); } } + default: assert(false); } } @@ -1550,6 +1552,7 @@ auto Extern::type() const -> own { case EXTERN_GLOBAL: return global()->type(); case EXTERN_TABLE: return table()->type(); case EXTERN_MEMORY: return memory()->type(); + default: assert(false); } } @@ -1794,7 +1797,7 @@ void FuncData::v8_callback(const v8::FunctionCallbackInfo& info) { auto& param_types = self->type->params(); auto& result_types = self->type->results(); - assert(param_types.size() == info.Length()); + assert(param_types.size() == static_cast(info.Length())); // TODO: cache params and result arrays per thread. auto args = std::unique_ptr(new Val[param_types.size()]); @@ -2194,6 +2197,7 @@ auto Instance::exports() const -> vec { assert(wasm_v8::extern_kind(obj) == wasm_v8::EXTERN_MEMORY); exports[i].reset(RefImpl::make(store, obj)); } break; + default: assert(false); } }