Commit 70dc8d16485c8e84966da0183aec55ac10a6be46

Sylvain Becker 2019-08-30T08:55:20

Android: fix corresponding warnings

diff --git a/src/audio/openslES/SDL_openslES.c b/src/audio/openslES/SDL_openslES.c
index 9642c67..0bb63ef 100644
--- a/src/audio/openslES/SDL_openslES.c
+++ b/src/audio/openslES/SDL_openslES.c
@@ -36,9 +36,8 @@
 
 #include <android/log.h>
 
-#define LOG_TAG "SDL_openslES"
-
 #if 0
+#define LOG_TAG "SDL_openslES"
 #define LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
 #define LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
 //#define LOGV(...)  __android_log_print(ANDROID_LOG_VERBOSE,LOG_TAG,__VA_ARGS__)
@@ -103,7 +102,7 @@ static void openslES_DetectDevices( int iscapture )
 }
 #endif
 
-static void openslES_DestroyEngine();
+static void openslES_DestroyEngine(void);
 
 static int
 openslES_CreateEngine()
diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c
index 02b9fd4..ce88e79 100644
--- a/src/core/android/SDL_android.c
+++ b/src/core/android/SDL_android.c
@@ -2400,7 +2400,7 @@ int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *bu
     if (messageboxdata->colorScheme) {
         colors = (*env)->NewIntArray(env, SDL_MESSAGEBOX_COLOR_MAX);
         for (i = 0; i < SDL_MESSAGEBOX_COLOR_MAX; ++i) {
-            temp = (0xFF << 24) |
+            temp = ((unsigned int)0xFF << 24) |
                    (messageboxdata->colorScheme->colors[i].r << 16) |
                    (messageboxdata->colorScheme->colors[i].g << 8) |
                    (messageboxdata->colorScheme->colors[i].b << 0);
@@ -2507,7 +2507,8 @@ SDL_bool SDL_IsDeXMode(void)
 void SDL_AndroidBackButton(void)
 {
     JNIEnv *env = Android_JNI_GetEnv();
-    return (*env)->CallStaticVoidMethod(env, mActivityClass, midManualBackButton);
+    (*env)->CallStaticVoidMethod(env, mActivityClass, midManualBackButton);
+    return;
 }
 
 const char * SDL_AndroidGetInternalStoragePath(void)
diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h
index de5edba..e94d5de 100644
--- a/src/dynapi/SDL_dynapi_procs.h
+++ b/src/dynapi/SDL_dynapi_procs.h
@@ -715,7 +715,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_HasAVX512F,(void),(),return)
 #ifdef __ANDROID__
 SDL_DYNAPI_PROC(SDL_bool,SDL_IsChromebook,(void),(),return)
 SDL_DYNAPI_PROC(SDL_bool,SDL_IsDeXMode,(void),(),return)
-SDL_DYNAPI_PROC(void,SDL_AndroidBackButton,(void),(),return)
+SDL_DYNAPI_PROC(void,SDL_AndroidBackButton,(void),(),)
 #endif
 SDL_DYNAPI_PROC(double,SDL_exp,(double a),(a),return)
 SDL_DYNAPI_PROC(float,SDL_expf,(float a),(a),return)
diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c
index fd3a709..72cb933 100644
--- a/src/events/SDL_gesture.c
+++ b/src/events/SDL_gesture.c
@@ -36,12 +36,14 @@
 
 #define MAXPATHSIZE 1024
 
-#define DOLLARNPOINTS 64
-#define DOLLARSIZE 256
-
 #define ENABLE_DOLLAR
 
-#define PHI 0.618033989
+#define DOLLARNPOINTS 64
+
+#if defined(ENABLE_DOLLAR)
+#  define DOLLARSIZE 256
+#  define PHI 0.618033989
+#endif
 
 typedef struct {
     float x,y;
diff --git a/src/joystick/android/SDL_sysjoystick.c b/src/joystick/android/SDL_sysjoystick.c
index 7361b56..b9ca308 100644
--- a/src/joystick/android/SDL_sysjoystick.c
+++ b/src/joystick/android/SDL_sysjoystick.c
@@ -497,7 +497,7 @@ Android_RemoveJoystick(int device_id)
 }
 
 
-static void ANDROID_JoystickDetect();
+static void ANDROID_JoystickDetect(void);
 
 static int
 ANDROID_JoystickInit(void)
diff --git a/src/joystick/controller_type.h b/src/joystick/controller_type.h
index b64aae5..32ce70f 100644
--- a/src/joystick/controller_type.h
+++ b/src/joystick/controller_type.h
@@ -24,10 +24,6 @@
 #pragma once
 #endif
 
-#ifndef __cplusplus
-#define inline SDL_INLINE
-#endif
-
 //-----------------------------------------------------------------------------
 // Purpose: Steam Controller models 
 // WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN A DATABASE
@@ -65,7 +61,7 @@ typedef enum
 	k_eControllertype_GenericMouse = 800,
 } EControllerType;
 
-#define MAKE_CONTROLLER_ID( nVID, nPID )	(unsigned int)( nVID << 16 | nPID )
+#define MAKE_CONTROLLER_ID( nVID, nPID )	(unsigned int)( (unsigned int)nVID << 16 | nPID )
 typedef struct
 {
 	unsigned int m_unDeviceID;
@@ -424,7 +420,7 @@ static const ControllerDescription_t arrControllers[] = {
 	{ MAKE_CONTROLLER_ID( 0x28de, 0x1202 ), k_eControllerType_SteamControllerV2 },	// Valve Bluetooth Steam Controller (HEADCRAB)
 };
 
-static inline EControllerType GuessControllerType( int nVID, int nPID )
+static SDL_INLINE EControllerType GuessControllerType( int nVID, int nPID )
 {
 	unsigned int unDeviceID = MAKE_CONTROLLER_ID( nVID, nPID );
 	int iIndex;
diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c
index b5aaf4d..4639409 100644
--- a/src/video/SDL_RLEaccel.c
+++ b/src/video/SDL_RLEaccel.c
@@ -295,10 +295,10 @@
     } while(0)
 
 #define ALPHA_BLIT16_565_50(to, from, length, bpp, alpha)       \
-    ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xf7de)
+    ALPHA_BLIT16_50(to, from, length, bpp, alpha, (unsigned int)0xf7de)
 
 #define ALPHA_BLIT16_555_50(to, from, length, bpp, alpha)       \
-    ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xfbde)
+    ALPHA_BLIT16_50(to, from, length, bpp, alpha, (unsigned int)0xfbde)
 
 #define CHOOSE_BLIT(blitter, alpha, fmt)                        \
     do {                                                        \
diff --git a/src/video/android/SDL_androidtouch.c b/src/video/android/SDL_androidtouch.c
index 7c86921..063e7b3 100644
--- a/src/video/android/SDL_androidtouch.c
+++ b/src/video/android/SDL_androidtouch.c
@@ -35,8 +35,8 @@
 #define ACTION_DOWN 0
 #define ACTION_UP 1
 #define ACTION_MOVE 2
-#define ACTION_CANCEL 3
-#define ACTION_OUTSIDE 4
+/* #define ACTION_CANCEL 3 */
+/* #define ACTION_OUTSIDE 4 */
 #define ACTION_POINTER_DOWN 5
 #define ACTION_POINTER_UP 6