Fixed some issues reported on new Ubuntu 14.04 buildbots.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 19 Apr 2014 02:17:34 -0400
changeset 8721d73e451f1dc5
parent 8720 97d23eef62fd
child 8722 9203a56e7ffc
Fixed some issues reported on new Ubuntu 14.04 buildbots.
src/video/wayland/SDL_waylandmouse.c
src/video/wayland/SDL_waylandtouch.c
     1.1 --- a/src/video/wayland/SDL_waylandmouse.c	Fri Apr 18 12:43:10 2014 -0700
     1.2 +++ b/src/video/wayland/SDL_waylandmouse.c	Sat Apr 19 02:17:34 2014 -0400
     1.3 @@ -106,6 +106,7 @@
     1.4  {
     1.5      SDL_VideoDevice *vd = SDL_GetVideoDevice();
     1.6      SDL_VideoData *data = (SDL_VideoData *) vd->driverdata;
     1.7 +    struct wl_shm_pool *shm_pool;
     1.8  
     1.9      int stride = width * 4;
    1.10      int size = stride * height;
    1.11 @@ -131,9 +132,7 @@
    1.12          close (shm_fd);
    1.13      }
    1.14  
    1.15 -    struct wl_shm_pool *shm_pool = wl_shm_create_pool(data->shm,
    1.16 -                                                      shm_fd,
    1.17 -                                                      size);
    1.18 +    shm_pool = wl_shm_create_pool(data->shm, shm_fd, size);
    1.19      d->buffer = wl_shm_pool_create_buffer(shm_pool,
    1.20                                            0,
    1.21                                            width,
    1.22 @@ -280,18 +279,18 @@
    1.23          break;
    1.24      }
    1.25  
    1.26 -    SDL_Cursor *sdl_cursor = CreateCursorFromWlCursor (d, cursor);
    1.27 -
    1.28 -    return sdl_cursor;
    1.29 +    return CreateCursorFromWlCursor(d, cursor);
    1.30  }
    1.31  
    1.32  static void
    1.33  Wayland_FreeCursor(SDL_Cursor *cursor)
    1.34  {
    1.35 +    Wayland_CursorData *d;
    1.36 +
    1.37      if (!cursor)
    1.38          return;
    1.39  
    1.40 -    Wayland_CursorData *d = cursor->driverdata;
    1.41 +    d = cursor->driverdata;
    1.42  
    1.43      /* Probably not a cursor we own */
    1.44      if (!d)
     2.1 --- a/src/video/wayland/SDL_waylandtouch.c	Fri Apr 18 12:43:10 2014 -0700
     2.2 +++ b/src/video/wayland/SDL_waylandtouch.c	Sat Apr 19 02:17:34 2014 -0400
     2.3 @@ -236,13 +236,16 @@
     2.4  void
     2.5  Wayland_touch_create(SDL_VideoData *data, uint32_t id)
     2.6  {
     2.7 +    struct SDL_WaylandTouch *touch;
     2.8 +
     2.9      if (data->touch) {
    2.10          Wayland_touch_destroy(data);
    2.11      }
    2.12  
    2.13 -    data->touch = malloc(sizeof(struct SDL_WaylandTouch));
    2.14 +    /* !!! FIXME: check for failure, call SDL_OutOfMemory() */
    2.15 +    data->touch = SDL_malloc(sizeof(struct SDL_WaylandTouch));
    2.16  
    2.17 -    struct SDL_WaylandTouch *touch = data->touch;
    2.18 +    touch = data->touch;
    2.19      touch->touch_extension = wl_registry_bind(data->registry, id, &qt_touch_extension_interface, 1);
    2.20      qt_touch_extension_add_listener(touch->touch_extension, &touch_listener, data);
    2.21  }
    2.22 @@ -256,7 +259,7 @@
    2.23              qt_touch_extension_destroy(touch->touch_extension);
    2.24          }
    2.25  
    2.26 -        free(data->touch);
    2.27 +        SDL_free(data->touch);
    2.28          data->touch = NULL;
    2.29      }
    2.30  }