From 4bef3b93b4c1fe76f274b317d45882fb96ab09a4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 11 Dec 2023 18:06:40 -0500 Subject: [PATCH] AndroidCommon: Resolve -Wsign-compare warning --- Source/Android/jni/AndroidCommon/AndroidCommon.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Android/jni/AndroidCommon/AndroidCommon.h b/Source/Android/jni/AndroidCommon/AndroidCommon.h index 733d2882f6..cc86795418 100644 --- a/Source/Android/jni/AndroidCommon/AndroidCommon.h +++ b/Source/Android/jni/AndroidCommon/AndroidCommon.h @@ -19,8 +19,9 @@ jobjectArray VectorToJStringArray(JNIEnv* env, const std::vector& v template jobjectArray VectorToJObjectArray(JNIEnv* env, const std::vector& vector, jclass clazz, F f) { - jobjectArray result = env->NewObjectArray(vector.size(), clazz, nullptr); - for (jsize i = 0; i < vector.size(); ++i) + const auto vector_size = static_cast(vector.size()); + jobjectArray result = env->NewObjectArray(vector_size, clazz, nullptr); + for (jsize i = 0; i < vector_size; ++i) { jobject obj = f(env, vector[i]); env->SetObjectArrayElement(result, i, obj);