Skip to content

Commit

Permalink
Fixed some issues reported on new Ubuntu 14.04 buildbots.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Apr 19, 2014
1 parent d2ea7cf commit 60e0504
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
13 changes: 6 additions & 7 deletions src/video/wayland/SDL_waylandmouse.c
Expand Up @@ -106,6 +106,7 @@ create_buffer_from_shm(Wayland_CursorData *d,
{
SDL_VideoDevice *vd = SDL_GetVideoDevice();
SDL_VideoData *data = (SDL_VideoData *) vd->driverdata;
struct wl_shm_pool *shm_pool;

int stride = width * 4;
int size = stride * height;
Expand All @@ -131,9 +132,7 @@ create_buffer_from_shm(Wayland_CursorData *d,
close (shm_fd);
}

struct wl_shm_pool *shm_pool = wl_shm_create_pool(data->shm,
shm_fd,
size);
shm_pool = wl_shm_create_pool(data->shm, shm_fd, size);
d->buffer = wl_shm_pool_create_buffer(shm_pool,
0,
width,
Expand Down Expand Up @@ -280,18 +279,18 @@ Wayland_CreateSystemCursor(SDL_SystemCursor id)
break;
}

SDL_Cursor *sdl_cursor = CreateCursorFromWlCursor (d, cursor);

return sdl_cursor;
return CreateCursorFromWlCursor(d, cursor);
}

static void
Wayland_FreeCursor(SDL_Cursor *cursor)
{
Wayland_CursorData *d;

if (!cursor)
return;

Wayland_CursorData *d = cursor->driverdata;
d = cursor->driverdata;

/* Probably not a cursor we own */
if (!d)
Expand Down
9 changes: 6 additions & 3 deletions src/video/wayland/SDL_waylandtouch.c
Expand Up @@ -236,13 +236,16 @@ WL_EXPORT const struct wl_interface qt_extended_surface_interface = {
void
Wayland_touch_create(SDL_VideoData *data, uint32_t id)
{
struct SDL_WaylandTouch *touch;

if (data->touch) {
Wayland_touch_destroy(data);
}

data->touch = malloc(sizeof(struct SDL_WaylandTouch));
/* !!! FIXME: check for failure, call SDL_OutOfMemory() */
data->touch = SDL_malloc(sizeof(struct SDL_WaylandTouch));

struct SDL_WaylandTouch *touch = data->touch;
touch = data->touch;
touch->touch_extension = wl_registry_bind(data->registry, id, &qt_touch_extension_interface, 1);
qt_touch_extension_add_listener(touch->touch_extension, &touch_listener, data);
}
Expand All @@ -256,7 +259,7 @@ Wayland_touch_destroy(SDL_VideoData *data)
qt_touch_extension_destroy(touch->touch_extension);
}

free(data->touch);
SDL_free(data->touch);
data->touch = NULL;
}
}
Expand Down

0 comments on commit 60e0504

Please sign in to comment.