Fixed bug 5005 - warnings in kmsdrm
authorSam Lantinga <slouken@libsdl.org>
Thu, 27 Feb 2020 08:20:34 -0800
changeset 13555936b1869a34a
parent 13554 4518dbd47100
child 13556 3d49344c6988
Fixed bug 5005 - warnings in kmsdrm

Malte Kie├čling

At the moment i get following warnings from kmsdrm:

* in SDL_kmsdrmvideo.c KMSDRM_DestroySurfaces is return type int, but thats never returned or checked against
* in SDL_kmsdrmvideo.c KMSDRM_DestroySurfaces the variable viddata is not used
* in SDL_kmsdrmopengles.c KMSDRM_GLES_LoadLibrary a cast to NativeDisplayType is missing

I attached a patch for them :)
src/video/kmsdrm/SDL_kmsdrmopengles.c
src/video/kmsdrm/SDL_kmsdrmvideo.c
     1.1 --- a/src/video/kmsdrm/SDL_kmsdrmopengles.c	Thu Feb 27 08:18:20 2020 -0800
     1.2 +++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c	Thu Feb 27 08:20:34 2020 -0800
     1.3 @@ -37,7 +37,8 @@
     1.4  
     1.5  int
     1.6  KMSDRM_GLES_LoadLibrary(_THIS, const char *path) {
     1.7 -    return SDL_EGL_LoadLibrary(_this, path, ((SDL_VideoData *)_this->driverdata)->gbm, EGL_PLATFORM_GBM_MESA);
     1.8 +    NativeDisplayType display = (NativeDisplayType)((SDL_VideoData *)_this->driverdata)->gbm;
     1.9 +    return SDL_EGL_LoadLibrary(_this, path, display, EGL_PLATFORM_GBM_MESA);
    1.10  }
    1.11  
    1.12  SDL_EGL_CreateContext_impl(KMSDRM)
     2.1 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c	Thu Feb 27 08:18:20 2020 -0800
     2.2 +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c	Thu Feb 27 08:20:34 2020 -0800
     2.3 @@ -349,10 +349,9 @@
     2.4  /* SDL Video and Display initialization/handling functions                   */
     2.5  /* _this is a SDL_VideoDevice *                                              */
     2.6  /*****************************************************************************/
     2.7 -static int
     2.8 +static void
     2.9  KMSDRM_DestroySurfaces(_THIS, SDL_Window * window)
    2.10  {
    2.11 -    SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata);
    2.12      SDL_WindowData *windata = (SDL_WindowData *)window->driverdata;
    2.13  
    2.14      KMSDRM_WaitPageFlip(_this, windata, -1);