Android: use SDL_arraysize()
authorSylvain Becker <sylvain.becker@gmail.com>
Thu, 12 Dec 2019 20:33:11 +0100
changeset 13336e15228a0c1b0
parent 13335 386769477625
child 13337 9cbbe45952a4
Android: use SDL_arraysize()
src/core/android/SDL_android.c
     1.1 --- a/src/core/android/SDL_android.c	Thu Dec 12 18:38:36 2019 +0100
     1.2 +++ b/src/core/android/SDL_android.c	Thu Dec 12 20:33:11 2019 +0100
     1.3 @@ -492,10 +492,10 @@
     1.4          return JNI_VERSION_1_4;
     1.5      }
     1.6  
     1.7 -    register_methods(env, "org/libsdl/app/SDLActivity", SDLActivity_tab, sizeof (SDLActivity_tab) / sizeof (SDLActivity_tab[0]));
     1.8 -    register_methods(env, "org/libsdl/app/SDLInputConnection", SDLInputConnection_tab, sizeof (SDLInputConnection_tab) / sizeof (SDLInputConnection_tab[0]));
     1.9 -    register_methods(env, "org/libsdl/app/SDLAudioManager", SDLAudioManager_tab, sizeof (SDLAudioManager_tab) / sizeof (SDLAudioManager_tab[0]));
    1.10 -    register_methods(env, "org/libsdl/app/SDLControllerManager", SDLControllerManager_tab, sizeof (SDLControllerManager_tab) / sizeof (SDLControllerManager_tab[0]));
    1.11 +    register_methods(env, "org/libsdl/app/SDLActivity", SDLActivity_tab, SDL_arraysize(SDLActivity_tab)); 
    1.12 +    register_methods(env, "org/libsdl/app/SDLInputConnection", SDLInputConnection_tab, SDL_arraysize(SDLInputConnection_tab));
    1.13 +    register_methods(env, "org/libsdl/app/SDLAudioManager", SDLAudioManager_tab, SDL_arraysize(SDLAudioManager_tab));
    1.14 +    register_methods(env, "org/libsdl/app/SDLControllerManager", SDLControllerManager_tab, SDL_arraysize(SDLControllerManager_tab));
    1.15  
    1.16      return JNI_VERSION_1_4;
    1.17  }
    1.18 @@ -2271,7 +2271,7 @@
    1.19  #define GET_INT_EXTRA(var, key) \
    1.20      int var; \
    1.21      iname = (*env)->NewStringUTF(env, key); \
    1.22 -    var = (*env)->CallIntMethod(env, intent, imid, iname, -1); \
    1.23 +    (var) = (*env)->CallIntMethod(env, intent, imid, iname, -1); \
    1.24      (*env)->DeleteLocalRef(env, iname);
    1.25  
    1.26      bmid = (*env)->GetMethodID(env, cls, "getBooleanExtra", "(Ljava/lang/String;Z)Z");
    1.27 @@ -2280,7 +2280,7 @@
    1.28  #define GET_BOOL_EXTRA(var, key) \
    1.29      int var; \
    1.30      bname = (*env)->NewStringUTF(env, key); \
    1.31 -    var = (*env)->CallBooleanMethod(env, intent, bmid, bname, JNI_FALSE); \
    1.32 +    (var) = (*env)->CallBooleanMethod(env, intent, bmid, bname, JNI_FALSE); \
    1.33      (*env)->DeleteLocalRef(env, bname);
    1.34  
    1.35      if (plugged) {