Fixed compiler warnings on iOS
authorSam Lantinga <slouken@libsdl.org>
Mon, 07 Jul 2014 11:00:25 -0700
changeset 898321f5923cfd15
parent 8982 a41a6b334028
child 8984 bbc802ae0ada
Fixed compiler warnings on iOS
src/events/SDL_mouse.c
src/render/opengles2/SDL_render_gles2.c
src/timer/unix/SDL_systimer.c
src/video/uikit/SDL_uikitmessagebox.m
src/video/uikit/SDL_uikitview.m
     1.1 --- a/src/events/SDL_mouse.c	Mon Jul 07 10:42:19 2014 -0700
     1.2 +++ b/src/events/SDL_mouse.c	Mon Jul 07 11:00:25 2014 -0700
     1.3 @@ -142,7 +142,7 @@
     1.4      SDL_Mouse *mouse = SDL_GetMouse();
     1.5      SDL_bool inWindow = SDL_TRUE;
     1.6  
     1.7 -    if (window != NULL && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
     1.8 +    if (window && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
     1.9          int w, h;
    1.10          SDL_GetWindowSize(window, &w, &h);
    1.11          if (x < 0 || y < 0 || x >= w || y >= h) {
    1.12 @@ -247,7 +247,7 @@
    1.13  
    1.14      /* make sure that the pointers find themselves inside the windows,
    1.15         unless we have the mouse captured. */
    1.16 -    if (window != NULL && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
    1.17 +    if (window && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
    1.18          int x_max = 0, y_max = 0;
    1.19  
    1.20          // !!! FIXME: shouldn't this be (window) instead of (mouse->focus)?
     2.1 --- a/src/render/opengles2/SDL_render_gles2.c	Mon Jul 07 10:42:19 2014 -0700
     2.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Mon Jul 07 11:00:25 2014 -0700
     2.3 @@ -80,7 +80,7 @@
     2.4      GLenum pixel_format;
     2.5      GLenum pixel_type;
     2.6      void *pixel_data;
     2.7 -    size_t pitch;
     2.8 +    int pitch;
     2.9      /* YV12 texture support */
    2.10      SDL_bool yuv;
    2.11      GLenum texture_v;
     3.1 --- a/src/timer/unix/SDL_systimer.c	Mon Jul 07 10:42:19 2014 -0700
     3.2 +++ b/src/timer/unix/SDL_systimer.c	Mon Jul 07 11:00:25 2014 -0700
     3.3 @@ -106,7 +106,7 @@
     3.4                                                   start_ts.tv_nsec) / 1000000;
     3.5  #elif defined(__APPLE__)
     3.6          uint64_t now = mach_absolute_time();
     3.7 -        ticks = (((now - start_mach) * mach_base_info.numer) / mach_base_info.denom) / 1000000;
     3.8 +        ticks = (Uint32)((((now - start_mach) * mach_base_info.numer) / mach_base_info.denom) / 1000000);
     3.9  #else
    3.10          SDL_assert(SDL_FALSE);
    3.11          ticks = 0;
    3.12 @@ -115,9 +115,7 @@
    3.13          struct timeval now;
    3.14  
    3.15          gettimeofday(&now, NULL);
    3.16 -        ticks =
    3.17 -            (now.tv_sec - start_tv.tv_sec) * 1000 + (now.tv_usec -
    3.18 -                                                  start_tv.tv_usec) / 1000;
    3.19 +        ticks = (Uint32)((now.tv_sec - start_tv.tv_sec) * 1000 + (now.tv_usec - start_tv.tv_usec) / 1000);
    3.20      }
    3.21      return (ticks);
    3.22  }
     4.1 --- a/src/video/uikit/SDL_uikitmessagebox.m	Mon Jul 07 10:42:19 2014 -0700
     4.2 +++ b/src/video/uikit/SDL_uikitmessagebox.m	Mon Jul 07 11:00:25 2014 -0700
     4.3 @@ -55,7 +55,7 @@
     4.4  
     4.5  - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;
     4.6  {
     4.7 -    *clickedButtonIndex = buttonIndex;
     4.8 +    *clickedButtonIndex = (int)buttonIndex;
     4.9  }
    4.10  
    4.11  @end /* UIKit_UIAlertViewDelegate */
     5.1 --- a/src/video/uikit/SDL_uikitview.m	Mon Jul 07 10:42:19 2014 -0700
     5.2 +++ b/src/video/uikit/SDL_uikitview.m	Mon Jul 07 11:00:25 2014 -0700
     5.3 @@ -91,10 +91,10 @@
     5.4              CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
     5.5  
     5.6              /* send moved event */
     5.7 -            SDL_SendMouseMotion(NULL, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
     5.8 +            SDL_SendMouseMotion(self->viewcontroller.window, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
     5.9  
    5.10              /* send mouse down event */
    5.11 -            SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
    5.12 +            SDL_SendMouseButton(self->viewcontroller.window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
    5.13  
    5.14              leftFingerDown = touch;
    5.15          }
    5.16 @@ -130,7 +130,7 @@
    5.17      while(touch) {
    5.18          if (touch == leftFingerDown) {
    5.19              /* send mouse up */
    5.20 -            SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
    5.21 +            SDL_SendMouseButton(self->viewcontroller.window, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
    5.22              leftFingerDown = nil;
    5.23          }
    5.24  
    5.25 @@ -173,7 +173,7 @@
    5.26              CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
    5.27  
    5.28              /* send moved event */
    5.29 -            SDL_SendMouseMotion(NULL, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
    5.30 +            SDL_SendMouseMotion(self->viewcontroller.window, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
    5.31          }
    5.32  
    5.33          CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];