src/video/wayland/SDL_waylandvideo.c
changeset 9484 8828b1a0ab67
parent 9476 2928e95ffcaf
child 9485 84407b33fe1e
     1.1 --- a/src/video/wayland/SDL_waylandvideo.c	Thu Apr 09 21:11:43 2015 +0200
     1.2 +++ b/src/video/wayland/SDL_waylandvideo.c	Thu Apr 09 21:13:20 2015 +0200
     1.3 @@ -277,21 +277,19 @@
     1.4  {
     1.5      SDL_VideoData *data = SDL_malloc(sizeof *data);
     1.6      if (data == NULL)
     1.7 -        return 0;
     1.8 +        return SDL_OutOfMemory();
     1.9      memset(data, 0, sizeof *data);
    1.10  
    1.11      _this->driverdata = data;
    1.12  
    1.13      data->display = WAYLAND_wl_display_connect(NULL);
    1.14      if (data->display == NULL) {
    1.15 -        SDL_SetError("Failed to connect to a Wayland display");
    1.16 -        return 0;
    1.17 +        return SDL_SetError("Failed to connect to a Wayland display");
    1.18      }
    1.19  
    1.20      data->registry = wl_display_get_registry(data->display);
    1.21      if (data->registry == NULL) {
    1.22 -        SDL_SetError("Failed to get the Wayland registry");
    1.23 -        return 0;
    1.24 +        return SDL_SetError("Failed to get the Wayland registry");
    1.25      }
    1.26  
    1.27      wl_registry_add_listener(data->registry, &registry_listener, data);
    1.28 @@ -304,8 +302,7 @@
    1.29  
    1.30      data->xkb_context = WAYLAND_xkb_context_new(0);
    1.31      if (!data->xkb_context) {
    1.32 -        SDL_SetError("Failed to create XKB context");
    1.33 -        return 0;
    1.34 +        return SDL_SetError("Failed to create XKB context");
    1.35      }
    1.36  
    1.37      Wayland_InitMouse();