Pacify some GCC strict-aliasing compiler warnings.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 23 Nov 2016 21:52:48 -0500
changeset 10646cc3e4b8f1a8d
parent 10645 b3475b7afcbc
child 10647 3b96d0f403d3
Pacify some GCC strict-aliasing compiler warnings.
src/render/opengl/SDL_render_gl.c
src/render/opengles2/SDL_render_gles2.c
src/video/SDL_shape.c
     1.1 --- a/src/render/opengl/SDL_render_gl.c	Wed Nov 23 06:54:19 2016 -0800
     1.2 +++ b/src/render/opengl/SDL_render_gl.c	Wed Nov 23 21:52:48 2016 -0500
     1.3 @@ -493,7 +493,7 @@
     1.4          PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
     1.5  
     1.6          data->GL_ARB_debug_output_supported = SDL_TRUE;
     1.7 -        data->glGetPointerv(GL_DEBUG_CALLBACK_FUNCTION_ARB, (GLvoid **)&data->next_error_callback);
     1.8 +        data->glGetPointerv(GL_DEBUG_CALLBACK_FUNCTION_ARB, (GLvoid **)(char *)&data->next_error_callback);
     1.9          data->glGetPointerv(GL_DEBUG_CALLBACK_USER_PARAM_ARB, &data->next_error_userparam);
    1.10          glDebugMessageCallbackARBFunc(GL_HandleDebugMessage, renderer);
    1.11  
     2.1 --- a/src/render/opengles2/SDL_render_gles2.c	Wed Nov 23 06:54:19 2016 -0800
     2.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Wed Nov 23 21:52:48 2016 -0500
     2.3 @@ -1068,7 +1068,7 @@
     2.4      /* Compile or load the selected shader instance */
     2.5      entry->id = data->glCreateShader(instance->type);
     2.6      if (instance->format == (GLenum)-1) {
     2.7 -        data->glShaderSource(entry->id, 1, (const char **)&instance->data, NULL);
     2.8 +        data->glShaderSource(entry->id, 1, (const char **)(char *)&instance->data, NULL);
     2.9          data->glCompileShader(entry->id);
    2.10          data->glGetShaderiv(entry->id, GL_COMPILE_STATUS, &compileSuccessful);
    2.11      } else {
     3.1 --- a/src/video/SDL_shape.c	Wed Nov 23 06:54:19 2016 -0800
     3.2 +++ b/src/video/SDL_shape.c	Wed Nov 23 21:52:48 2016 -0500
     3.3 @@ -234,10 +234,10 @@
     3.4  SDL_FreeShapeTree(SDL_ShapeTree** shape_tree)
     3.5  {
     3.6      if((*shape_tree)->kind == QuadShape) {
     3.7 -        SDL_FreeShapeTree((SDL_ShapeTree **)&(*shape_tree)->data.children.upleft);
     3.8 -        SDL_FreeShapeTree((SDL_ShapeTree **)&(*shape_tree)->data.children.upright);
     3.9 -        SDL_FreeShapeTree((SDL_ShapeTree **)&(*shape_tree)->data.children.downleft);
    3.10 -        SDL_FreeShapeTree((SDL_ShapeTree **)&(*shape_tree)->data.children.downright);
    3.11 +        SDL_FreeShapeTree((SDL_ShapeTree **)(char*)&(*shape_tree)->data.children.upleft);
    3.12 +        SDL_FreeShapeTree((SDL_ShapeTree **)(char*)&(*shape_tree)->data.children.upright);
    3.13 +        SDL_FreeShapeTree((SDL_ShapeTree **)(char*)&(*shape_tree)->data.children.downleft);
    3.14 +        SDL_FreeShapeTree((SDL_ShapeTree **)(char*)&(*shape_tree)->data.children.downright);
    3.15      }
    3.16      SDL_free(*shape_tree);
    3.17      *shape_tree = NULL;