Skip to content

Commit

Permalink
Android: fix corresponding warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl committed Aug 30, 2019
1 parent 6794ec6 commit 70dc8d1
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 21 deletions.
5 changes: 2 additions & 3 deletions src/audio/openslES/SDL_openslES.c
Expand Up @@ -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__)
Expand Down Expand Up @@ -103,7 +102,7 @@ static void openslES_DetectDevices( int iscapture )
}
#endif

static void openslES_DestroyEngine();
static void openslES_DestroyEngine(void);

static int
openslES_CreateEngine()
Expand Down
5 changes: 3 additions & 2 deletions src/core/android/SDL_android.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/dynapi/SDL_dynapi_procs.h
Expand Up @@ -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)
Expand Down
10 changes: 6 additions & 4 deletions src/events/SDL_gesture.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/joystick/android/SDL_sysjoystick.c
Expand Up @@ -497,7 +497,7 @@ Android_RemoveJoystick(int device_id)
}


static void ANDROID_JoystickDetect();
static void ANDROID_JoystickDetect(void);

static int
ANDROID_JoystickInit(void)
Expand Down
8 changes: 2 additions & 6 deletions src/joystick/controller_type.h
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/video/SDL_RLEaccel.c
Expand Up @@ -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 { \
Expand Down
4 changes: 2 additions & 2 deletions src/video/android/SDL_androidtouch.c
Expand Up @@ -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

Expand Down

0 comments on commit 70dc8d1

Please sign in to comment.