Fixed bug 3490 - Build failure with --enable-video-directfb
authorSam Lantinga <slouken@libsdl.org>
Tue, 15 Nov 2016 01:14:30 -0800
changeset 10613ea44906e19b8
parent 10612 6b2307dbec54
child 10614 63c2c6c8762c
Fixed bug 3490 - Build failure with --enable-video-directfb

felix

Building SDL 2.0.5, or even the Mercurial snapshot (r10608) with GCC 6.2.1 and --enable-video-directfb generates a number of compiler diagnostics and fails.
src/video/directfb/SDL_DirectFB_render.c
src/video/directfb/SDL_DirectFB_shape.c
     1.1 --- a/src/video/directfb/SDL_DirectFB_render.c	Tue Nov 15 01:12:27 2016 -0800
     1.2 +++ b/src/video/directfb/SDL_DirectFB_render.c	Tue Nov 15 01:14:30 2016 -0800
     1.3 @@ -1273,7 +1273,7 @@
     1.4                       Uint32 format, void * pixels, int pitch)
     1.5  {
     1.6      Uint32 sdl_format;
     1.7 -    void * laypixels;
     1.8 +    unsigned char* laypixels;
     1.9      int laypitch;
    1.10      DFBSurfacePixelFormat dfb_format;
    1.11      DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata;
    1.12 @@ -1303,7 +1303,7 @@
    1.13      SDL_Window *window = renderer->window;
    1.14      SDL_DFB_WINDOWDATA(window);
    1.15      Uint32 sdl_format;
    1.16 -    void * laypixels;
    1.17 +    unsigned char* laypixels;
    1.18      int laypitch;
    1.19      DFBSurfacePixelFormat dfb_format;
    1.20  
     2.1 --- a/src/video/directfb/SDL_DirectFB_shape.c	Tue Nov 15 01:12:27 2016 -0800
     2.2 +++ b/src/video/directfb/SDL_DirectFB_shape.c	Tue Nov 15 01:14:30 2016 -0800
     2.3 @@ -37,17 +37,19 @@
     2.4  SDL_WindowShaper*
     2.5  DirectFB_CreateShaper(SDL_Window* window) {
     2.6      SDL_WindowShaper* result = NULL;
     2.7 +    SDL_ShapeData* data;
     2.8 +    int resized_properly;
     2.9  
    2.10      result = malloc(sizeof(SDL_WindowShaper));
    2.11      result->window = window;
    2.12      result->mode.mode = ShapeModeDefault;
    2.13      result->mode.parameters.binarizationCutoff = 1;
    2.14      result->userx = result->usery = 0;
    2.15 -    SDL_ShapeData* data = SDL_malloc(sizeof(SDL_ShapeData));
    2.16 +    data = SDL_malloc(sizeof(SDL_ShapeData));
    2.17      result->driverdata = data;
    2.18      data->surface = NULL;
    2.19      window->shaper = result;
    2.20 -    int resized_properly = DirectFB_ResizeWindowShape(window);
    2.21 +    resized_properly = DirectFB_ResizeWindowShape(window);
    2.22      SDL_assert(resized_properly == 0);
    2.23  
    2.24      return result;