src/core/android/SDL_android.c
changeset 7863 c6b33210e610
parent 7786 cfc1285375e1
child 7907 24b4e98c6010
equal deleted inserted replaced
7862:d20e37f08533 7863:c6b33210e610
  1198         number = (int) (*env)->GetArrayLength(env, array);
  1198         number = (int) (*env)->GetArrayLength(env, array);
  1199         if (0 < number) {
  1199         if (0 < number) {
  1200             jint* elements = (*env)->GetIntArrayElements(env, array, NULL);
  1200             jint* elements = (*env)->GetIntArrayElements(env, array, NULL);
  1201             if (elements) {
  1201             if (elements) {
  1202                 int i;
  1202                 int i;
  1203                 *ids = SDL_malloc(number * sizeof (*ids[0]));
  1203                 *ids = SDL_malloc(number * sizeof (**ids));
  1204                 for (i = 0; i < number; ++i) { /* not assuming sizeof (jint) == sizeof (int) */
  1204                 for (i = 0; i < number; ++i) { /* not assuming sizeof (jint) == sizeof (int) */
  1205                     *ids[i] = elements[i];
  1205                     (*ids)[i] = elements[i];
  1206                 }
  1206                 }
  1207                 (*env)->ReleaseIntArrayElements(env, array, elements, JNI_ABORT);
  1207                 (*env)->ReleaseIntArrayElements(env, array, elements, JNI_ABORT);
  1208             }
  1208             }
  1209         }
  1209         }
  1210         (*env)->DeleteLocalRef(env, array);
  1210         (*env)->DeleteLocalRef(env, array);