Android: fix corresponding warnings
authorSylvain Becker <sylvain.becker@gmail.com>
Fri, 30 Aug 2019 08:55:20 +0200
changeset 130416ea2f4ed7014
parent 13040 58a4430a9492
child 13042 a4f7b983fbe8
Android: fix corresponding warnings
src/audio/openslES/SDL_openslES.c
src/core/android/SDL_android.c
src/dynapi/SDL_dynapi_procs.h
src/events/SDL_gesture.c
src/joystick/android/SDL_sysjoystick.c
src/joystick/controller_type.h
src/video/SDL_RLEaccel.c
src/video/android/SDL_androidtouch.c
     1.1 --- a/src/audio/openslES/SDL_openslES.c	Fri Aug 30 08:43:13 2019 +0200
     1.2 +++ b/src/audio/openslES/SDL_openslES.c	Fri Aug 30 08:55:20 2019 +0200
     1.3 @@ -36,9 +36,8 @@
     1.4  
     1.5  #include <android/log.h>
     1.6  
     1.7 +#if 0
     1.8  #define LOG_TAG "SDL_openslES"
     1.9 -
    1.10 -#if 0
    1.11  #define LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
    1.12  #define LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
    1.13  //#define LOGV(...)  __android_log_print(ANDROID_LOG_VERBOSE,LOG_TAG,__VA_ARGS__)
    1.14 @@ -103,7 +102,7 @@
    1.15  }
    1.16  #endif
    1.17  
    1.18 -static void openslES_DestroyEngine();
    1.19 +static void openslES_DestroyEngine(void);
    1.20  
    1.21  static int
    1.22  openslES_CreateEngine()
     2.1 --- a/src/core/android/SDL_android.c	Fri Aug 30 08:43:13 2019 +0200
     2.2 +++ b/src/core/android/SDL_android.c	Fri Aug 30 08:55:20 2019 +0200
     2.3 @@ -2400,7 +2400,7 @@
     2.4      if (messageboxdata->colorScheme) {
     2.5          colors = (*env)->NewIntArray(env, SDL_MESSAGEBOX_COLOR_MAX);
     2.6          for (i = 0; i < SDL_MESSAGEBOX_COLOR_MAX; ++i) {
     2.7 -            temp = (0xFF << 24) |
     2.8 +            temp = ((unsigned int)0xFF << 24) |
     2.9                     (messageboxdata->colorScheme->colors[i].r << 16) |
    2.10                     (messageboxdata->colorScheme->colors[i].g << 8) |
    2.11                     (messageboxdata->colorScheme->colors[i].b << 0);
    2.12 @@ -2507,7 +2507,8 @@
    2.13  void SDL_AndroidBackButton(void)
    2.14  {
    2.15      JNIEnv *env = Android_JNI_GetEnv();
    2.16 -    return (*env)->CallStaticVoidMethod(env, mActivityClass, midManualBackButton);
    2.17 +    (*env)->CallStaticVoidMethod(env, mActivityClass, midManualBackButton);
    2.18 +    return;
    2.19  }
    2.20  
    2.21  const char * SDL_AndroidGetInternalStoragePath(void)
     3.1 --- a/src/dynapi/SDL_dynapi_procs.h	Fri Aug 30 08:43:13 2019 +0200
     3.2 +++ b/src/dynapi/SDL_dynapi_procs.h	Fri Aug 30 08:55:20 2019 +0200
     3.3 @@ -715,7 +715,7 @@
     3.4  #ifdef __ANDROID__
     3.5  SDL_DYNAPI_PROC(SDL_bool,SDL_IsChromebook,(void),(),return)
     3.6  SDL_DYNAPI_PROC(SDL_bool,SDL_IsDeXMode,(void),(),return)
     3.7 -SDL_DYNAPI_PROC(void,SDL_AndroidBackButton,(void),(),return)
     3.8 +SDL_DYNAPI_PROC(void,SDL_AndroidBackButton,(void),(),)
     3.9  #endif
    3.10  SDL_DYNAPI_PROC(double,SDL_exp,(double a),(a),return)
    3.11  SDL_DYNAPI_PROC(float,SDL_expf,(float a),(a),return)
     4.1 --- a/src/events/SDL_gesture.c	Fri Aug 30 08:43:13 2019 +0200
     4.2 +++ b/src/events/SDL_gesture.c	Fri Aug 30 08:55:20 2019 +0200
     4.3 @@ -36,12 +36,14 @@
     4.4  
     4.5  #define MAXPATHSIZE 1024
     4.6  
     4.7 -#define DOLLARNPOINTS 64
     4.8 -#define DOLLARSIZE 256
     4.9 -
    4.10  #define ENABLE_DOLLAR
    4.11  
    4.12 -#define PHI 0.618033989
    4.13 +#define DOLLARNPOINTS 64
    4.14 +
    4.15 +#if defined(ENABLE_DOLLAR)
    4.16 +#  define DOLLARSIZE 256
    4.17 +#  define PHI 0.618033989
    4.18 +#endif
    4.19  
    4.20  typedef struct {
    4.21      float x,y;
     5.1 --- a/src/joystick/android/SDL_sysjoystick.c	Fri Aug 30 08:43:13 2019 +0200
     5.2 +++ b/src/joystick/android/SDL_sysjoystick.c	Fri Aug 30 08:55:20 2019 +0200
     5.3 @@ -497,7 +497,7 @@
     5.4  }
     5.5  
     5.6  
     5.7 -static void ANDROID_JoystickDetect();
     5.8 +static void ANDROID_JoystickDetect(void);
     5.9  
    5.10  static int
    5.11  ANDROID_JoystickInit(void)
     6.1 --- a/src/joystick/controller_type.h	Fri Aug 30 08:43:13 2019 +0200
     6.2 +++ b/src/joystick/controller_type.h	Fri Aug 30 08:55:20 2019 +0200
     6.3 @@ -24,10 +24,6 @@
     6.4  #pragma once
     6.5  #endif
     6.6  
     6.7 -#ifndef __cplusplus
     6.8 -#define inline SDL_INLINE
     6.9 -#endif
    6.10 -
    6.11  //-----------------------------------------------------------------------------
    6.12  // Purpose: Steam Controller models 
    6.13  // WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN A DATABASE
    6.14 @@ -65,7 +61,7 @@
    6.15  	k_eControllertype_GenericMouse = 800,
    6.16  } EControllerType;
    6.17  
    6.18 -#define MAKE_CONTROLLER_ID( nVID, nPID )	(unsigned int)( nVID << 16 | nPID )
    6.19 +#define MAKE_CONTROLLER_ID( nVID, nPID )	(unsigned int)( (unsigned int)nVID << 16 | nPID )
    6.20  typedef struct
    6.21  {
    6.22  	unsigned int m_unDeviceID;
    6.23 @@ -424,7 +420,7 @@
    6.24  	{ MAKE_CONTROLLER_ID( 0x28de, 0x1202 ), k_eControllerType_SteamControllerV2 },	// Valve Bluetooth Steam Controller (HEADCRAB)
    6.25  };
    6.26  
    6.27 -static inline EControllerType GuessControllerType( int nVID, int nPID )
    6.28 +static SDL_INLINE EControllerType GuessControllerType( int nVID, int nPID )
    6.29  {
    6.30  	unsigned int unDeviceID = MAKE_CONTROLLER_ID( nVID, nPID );
    6.31  	int iIndex;
     7.1 --- a/src/video/SDL_RLEaccel.c	Fri Aug 30 08:43:13 2019 +0200
     7.2 +++ b/src/video/SDL_RLEaccel.c	Fri Aug 30 08:55:20 2019 +0200
     7.3 @@ -295,10 +295,10 @@
     7.4      } while(0)
     7.5  
     7.6  #define ALPHA_BLIT16_565_50(to, from, length, bpp, alpha)       \
     7.7 -    ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xf7de)
     7.8 +    ALPHA_BLIT16_50(to, from, length, bpp, alpha, (unsigned int)0xf7de)
     7.9  
    7.10  #define ALPHA_BLIT16_555_50(to, from, length, bpp, alpha)       \
    7.11 -    ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xfbde)
    7.12 +    ALPHA_BLIT16_50(to, from, length, bpp, alpha, (unsigned int)0xfbde)
    7.13  
    7.14  #define CHOOSE_BLIT(blitter, alpha, fmt)                        \
    7.15      do {                                                        \
     8.1 --- a/src/video/android/SDL_androidtouch.c	Fri Aug 30 08:43:13 2019 +0200
     8.2 +++ b/src/video/android/SDL_androidtouch.c	Fri Aug 30 08:55:20 2019 +0200
     8.3 @@ -35,8 +35,8 @@
     8.4  #define ACTION_DOWN 0
     8.5  #define ACTION_UP 1
     8.6  #define ACTION_MOVE 2
     8.7 -#define ACTION_CANCEL 3
     8.8 -#define ACTION_OUTSIDE 4
     8.9 +/* #define ACTION_CANCEL 3 */
    8.10 +/* #define ACTION_OUTSIDE 4 */
    8.11  #define ACTION_POINTER_DOWN 5
    8.12  #define ACTION_POINTER_UP 6
    8.13