diff --git a/cxx/fbjni/detail/CoreClasses-inl.h b/cxx/fbjni/detail/CoreClasses-inl.h index bf70fc4..96c2af4 100644 --- a/cxx/fbjni/detail/CoreClasses-inl.h +++ b/cxx/fbjni/detail/CoreClasses-inl.h @@ -425,7 +425,8 @@ auto JArrayClass::newArray(size_t count) -> local_ref { static const auto elementClass = findClassStatic(jtype_traits::kBaseName.c_str()); const auto env = Environment::current(); - auto rawArray = env->NewObjectArray(count, elementClass.get(), nullptr); + auto rawArray = env->NewObjectArray( + static_cast(count), elementClass.get(), nullptr); FACEBOOK_JNI_THROW_EXCEPTION_IF(!rawArray); return adopt_local(static_cast(rawArray)); } @@ -434,7 +435,9 @@ template inline void JArrayClass::setElement(size_t idx, T value) { const auto env = Environment::current(); env->SetObjectArrayElement( - this->self(), idx, detail::toPlainJniReference(value)); + this->self(), + static_cast(idx), + detail::toPlainJniReference(value)); } template @@ -625,7 +628,12 @@ inline void PinnedPrimitiveArray::abort() { template inline void PinnedPrimitiveArray::releaseImpl(jint mode) { FACEBOOK_JNI_THROW_EXCEPTION_IF(array_.get() == nullptr); - Alloc::release(array_, elements_, start_, size_, mode); + Alloc::release( + array_, + elements_, + static_cast(start_), + static_cast(size_), + mode); } template