diff --git a/napi-inl.h b/napi-inl.h index a1d67ac17..0af8e7ae5 100644 --- a/napi-inl.h +++ b/napi-inl.h @@ -2044,8 +2044,10 @@ inline TypedArrayOf::TypedArrayOf(napi_env env, napi_value value) : TypedArray(env, value), _data(nullptr) { napi_status status = napi_ok; if (value != nullptr) { + void* data = nullptr; status = napi_get_typedarray_info( - _env, _value, &_type, &_length, reinterpret_cast(&_data), nullptr, nullptr); + _env, _value, &_type, &_length, &data, nullptr, nullptr); + _data = static_cast(data); } else { _type = TypedArrayTypeForPrimitiveType(); _length = 0; @@ -3967,10 +3969,10 @@ inline ObjectWrap::~ObjectWrap() { template inline T* ObjectWrap::Unwrap(Object wrapper) { - T* unwrapped; - napi_status status = napi_unwrap(wrapper.Env(), wrapper, reinterpret_cast(&unwrapped)); + void* unwrapped; + napi_status status = napi_unwrap(wrapper.Env(), wrapper, &unwrapped); NAPI_THROW_IF_FAILED(wrapper.Env(), status, nullptr); - return unwrapped; + return static_cast(unwrapped); } template