Fixed compiler warnings on iOS

This commit is contained in:
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_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;
SDL_GetWindowSize(window, &w, &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,
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;
// !!! 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_type;
void *pixel_data;
size_t pitch;
int pitch;
/* YV12 texture support */
SDL_bool yuv;
GLenum texture_v;

View File

@ -106,7 +106,7 @@ SDL_GetTicks(void)
start_ts.tv_nsec) / 1000000;
#elif defined(__APPLE__)
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
SDL_assert(SDL_FALSE);
ticks = 0;
@ -115,9 +115,7 @@ SDL_GetTicks(void)
struct timeval now;
gettimeofday(&now, NULL);
ticks =
(now.tv_sec - start_tv.tv_sec) * 1000 + (now.tv_usec -
start_tv.tv_usec) / 1000;
ticks = (Uint32)((now.tv_sec - start_tv.tv_sec) * 1000 + (now.tv_usec - start_tv.tv_usec) / 1000);
}
return (ticks);
}

View File

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

View File

@ -91,10 +91,10 @@ void _uikit_keyboard_init() ;
CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
/* 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 */
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;
}
@ -130,7 +130,7 @@ void _uikit_keyboard_init() ;
while(touch) {
if (touch == leftFingerDown) {
/* 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;
}
@ -173,7 +173,7 @@ void _uikit_keyboard_init() ;
CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
/* 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];