Fixed compiler warnings on iOS

main
Sam Lantinga 2014-07-07 11:00:25 -07:00
parent 017c5dc381
commit 7187b74cf4
5 changed files with 10 additions and 12 deletions

View File

@ -142,7 +142,7 @@ SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint32 buttonstate)
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();
SDL_bool inWindow = SDL_TRUE; SDL_bool inWindow = SDL_TRUE;
if (window != NULL && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) { if (window && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
int w, h; int w, h;
SDL_GetWindowSize(window, &w, &h); SDL_GetWindowSize(window, &w, &h);
if (x < 0 || y < 0 || x >= w || y >= h) { if (x < 0 || y < 0 || x >= w || y >= h) {
@ -247,7 +247,7 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ
/* make sure that the pointers find themselves inside the windows, /* make sure that the pointers find themselves inside the windows,
unless we have the mouse captured. */ unless we have the mouse captured. */
if (window != NULL && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) { if (window && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
int x_max = 0, y_max = 0; int x_max = 0, y_max = 0;
// !!! FIXME: shouldn't this be (window) instead of (mouse->focus)? // !!! FIXME: shouldn't this be (window) instead of (mouse->focus)?

View File

@ -80,7 +80,7 @@ typedef struct GLES2_TextureData
GLenum pixel_format; GLenum pixel_format;
GLenum pixel_type; GLenum pixel_type;
void *pixel_data; void *pixel_data;
size_t pitch; int pitch;
/* YV12 texture support */ /* YV12 texture support */
SDL_bool yuv; SDL_bool yuv;
GLenum texture_v; GLenum texture_v;

View File

@ -106,7 +106,7 @@ SDL_GetTicks(void)
start_ts.tv_nsec) / 1000000; start_ts.tv_nsec) / 1000000;
#elif defined(__APPLE__) #elif defined(__APPLE__)
uint64_t now = mach_absolute_time(); uint64_t now = mach_absolute_time();
ticks = (((now - start_mach) * mach_base_info.numer) / mach_base_info.denom) / 1000000; ticks = (Uint32)((((now - start_mach) * mach_base_info.numer) / mach_base_info.denom) / 1000000);
#else #else
SDL_assert(SDL_FALSE); SDL_assert(SDL_FALSE);
ticks = 0; ticks = 0;
@ -115,9 +115,7 @@ SDL_GetTicks(void)
struct timeval now; struct timeval now;
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
ticks = ticks = (Uint32)((now.tv_sec - start_tv.tv_sec) * 1000 + (now.tv_usec - start_tv.tv_usec) / 1000);
(now.tv_sec - start_tv.tv_sec) * 1000 + (now.tv_usec -
start_tv.tv_usec) / 1000;
} }
return (ticks); return (ticks);
} }

View File

@ -55,7 +55,7 @@ static SDL_bool s_showingMessageBox = SDL_FALSE;
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex; - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;
{ {
*clickedButtonIndex = buttonIndex; *clickedButtonIndex = (int)buttonIndex;
} }
@end /* UIKit_UIAlertViewDelegate */ @end /* UIKit_UIAlertViewDelegate */

View File

@ -91,10 +91,10 @@ void _uikit_keyboard_init() ;
CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO]; CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
/* send moved event */ /* send moved event */
SDL_SendMouseMotion(NULL, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y); SDL_SendMouseMotion(self->viewcontroller.window, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
/* send mouse down event */ /* send mouse down event */
SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT); SDL_SendMouseButton(self->viewcontroller.window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
leftFingerDown = touch; leftFingerDown = touch;
} }
@ -130,7 +130,7 @@ void _uikit_keyboard_init() ;
while(touch) { while(touch) {
if (touch == leftFingerDown) { if (touch == leftFingerDown) {
/* send mouse up */ /* send mouse up */
SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT); SDL_SendMouseButton(self->viewcontroller.window, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
leftFingerDown = nil; leftFingerDown = nil;
} }
@ -173,7 +173,7 @@ void _uikit_keyboard_init() ;
CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO]; CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
/* send moved event */ /* send moved event */
SDL_SendMouseMotion(NULL, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y); SDL_SendMouseMotion(self->viewcontroller.window, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
} }
CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES]; CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];