Android: fix corresponding warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
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