Fixed ISO C99 compatibility
authorSam Lantinga <slouken@libsdl.org>
Tue, 30 Jan 2018 18:08:34 -0800
changeset 11839971881e55d61
parent 11838 5ef6e4e70103
child 11840 4d52395a8dba
Fixed ISO C99 compatibility
SDL now builds with gcc 7.2 with the following command line options:
-Wall -pedantic-errors -Wno-deprecated-declarations -Wno-overlength-strings --std=c99
src/audio/SDL_audio.c
src/audio/directsound/SDL_directsound.c
src/audio/wasapi/SDL_wasapi_win32.c
src/core/linux/SDL_dbus.c
src/core/windows/SDL_xinput.c
src/dynapi/SDL_dynapi.c
src/events/SDL_quit.c
src/filesystem/windows/SDL_sysfilesystem.c
src/render/direct3d11/SDL_render_d3d11.c
src/render/opengl/SDL_render_gl.c
src/render/opengl/SDL_shaders_gl.c
src/render/opengles/SDL_render_gles.c
src/render/opengles2/SDL_render_gles2.c
src/thread/pthread/SDL_systhread.c
src/thread/windows/SDL_systhread.c
src/video/SDL_blit.c
src/video/SDL_egl.c
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/SDL_vulkan_internal.h
src/video/android/SDL_androidvulkan.c
src/video/cocoa/SDL_cocoavulkan.m
src/video/mir/SDL_mirdyn.c
src/video/mir/SDL_mirvideo.c
src/video/mir/SDL_mirvulkan.c
src/video/uikit/SDL_uikitvulkan.m
src/video/wayland/SDL_waylanddatamanager.c
src/video/wayland/SDL_waylanddyn.c
src/video/wayland/SDL_waylandopengles.h
src/video/wayland/SDL_waylandvulkan.c
src/video/windows/SDL_windowsevents.c
src/video/windows/SDL_windowskeyboard.c
src/video/windows/SDL_windowsopengl.c
src/video/windows/SDL_windowsvideo.c
src/video/windows/SDL_windowsvulkan.c
src/video/winrt/SDL_winrtopengles.cpp
src/video/x11/SDL_x11dyn.c
src/video/x11/SDL_x11opengl.c
src/video/x11/SDL_x11vulkan.c
src/video/yuv2rgb/yuv_rgb_sse_func.h
     1.1 --- a/src/audio/SDL_audio.c	Tue Jan 30 16:53:24 2018 -0800
     1.2 +++ b/src/audio/SDL_audio.c	Tue Jan 30 18:08:34 2018 -0800
     1.3 @@ -151,11 +151,11 @@
     1.4          return SDL_FALSE;
     1.5      }
     1.6  
     1.7 -    SRC_src_new = (SRC_STATE* (*)(int converter_type, int channels, int *error))SDL_LoadFunction(SRC_lib, "src_new");
     1.8 -    SRC_src_process = (int (*)(SRC_STATE *state, SRC_DATA *data))SDL_LoadFunction(SRC_lib, "src_process");
     1.9 -    SRC_src_reset = (int(*)(SRC_STATE *state))SDL_LoadFunction(SRC_lib, "src_reset");
    1.10 -    SRC_src_delete = (SRC_STATE* (*)(SRC_STATE *state))SDL_LoadFunction(SRC_lib, "src_delete");
    1.11 -    SRC_src_strerror = (const char* (*)(int error))SDL_LoadFunction(SRC_lib, "src_strerror");
    1.12 +    *(void **)&SRC_src_new = SDL_LoadFunction(SRC_lib, "src_new");
    1.13 +    *(void **)&SRC_src_process = SDL_LoadFunction(SRC_lib, "src_process");
    1.14 +    *(void **)&SRC_src_reset = SDL_LoadFunction(SRC_lib, "src_reset");
    1.15 +    *(void **)&SRC_src_delete = SDL_LoadFunction(SRC_lib, "src_delete");
    1.16 +    *(void **)&SRC_src_strerror = SDL_LoadFunction(SRC_lib, "src_strerror");
    1.17  
    1.18      if (!SRC_src_new || !SRC_src_process || !SRC_src_reset || !SRC_src_delete || !SRC_src_strerror) {
    1.19          SDL_UnloadObject(SRC_lib);
     2.1 --- a/src/audio/directsound/SDL_directsound.c	Tue Jan 30 16:53:24 2018 -0800
     2.2 +++ b/src/audio/directsound/SDL_directsound.c	Tue Jan 30 18:08:34 2018 -0800
     2.3 @@ -74,7 +74,7 @@
     2.4      } else {
     2.5          /* Now make sure we have DirectX 8 or better... */
     2.6          #define DSOUNDLOAD(f) { \
     2.7 -            p##f = (fn##f) SDL_LoadFunction(DSoundDLL, #f); \
     2.8 +            *(void**)&p##f = SDL_LoadFunction(DSoundDLL, #f); \
     2.9              if (!p##f) loaded = 0; \
    2.10          }
    2.11          loaded = 1;  /* will reset if necessary. */
     3.1 --- a/src/audio/wasapi/SDL_wasapi_win32.c	Tue Jan 30 16:53:24 2018 -0800
     3.2 +++ b/src/audio/wasapi/SDL_wasapi_win32.c	Tue Jan 30 18:08:34 2018 -0800
     3.3 @@ -256,8 +256,8 @@
     3.4  
     3.5      libavrt = LoadLibraryW(L"avrt.dll");  /* this library is available in Vista and later. No WinXP, so have to LoadLibrary to use it for now! */
     3.6      if (libavrt) {
     3.7 -        pAvSetMmThreadCharacteristicsW = (pfnAvSetMmThreadCharacteristicsW) GetProcAddress(libavrt, "AvSetMmThreadCharacteristicsW");
     3.8 -        pAvRevertMmThreadCharacteristics = (pfnAvRevertMmThreadCharacteristics) GetProcAddress(libavrt, "AvRevertMmThreadCharacteristics");
     3.9 +        *(void **)&pAvSetMmThreadCharacteristicsW = GetProcAddress(libavrt, "AvSetMmThreadCharacteristicsW");
    3.10 +        *(void **)&pAvRevertMmThreadCharacteristics = GetProcAddress(libavrt, "AvRevertMmThreadCharacteristics");
    3.11      }
    3.12  
    3.13      return 0;
     4.1 --- a/src/core/linux/SDL_dbus.c	Tue Jan 30 16:53:24 2018 -0800
     4.2 +++ b/src/core/linux/SDL_dbus.c	Tue Jan 30 18:08:34 2018 -0800
     4.3 @@ -33,7 +33,7 @@
     4.4  LoadDBUSSyms(void)
     4.5  {
     4.6      #define SDL_DBUS_SYM2(x, y) \
     4.7 -        if (!(dbus.x = SDL_LoadFunction(dbus_handle, #y))) return -1
     4.8 +        if (!(*(void**)&dbus.x = SDL_LoadFunction(dbus_handle, #y))) return -1
     4.9          
    4.10      #define SDL_DBUS_SYM(x) \
    4.11          SDL_DBUS_SYM2(x, dbus_##x)
     5.1 --- a/src/core/windows/SDL_xinput.c	Tue Jan 30 16:53:24 2018 -0800
     5.2 +++ b/src/core/windows/SDL_xinput.c	Tue Jan 30 18:08:34 2018 -0800
     5.3 @@ -104,13 +104,13 @@
     5.4      s_XInputDLLRefCount = 1;
     5.5  
     5.6      /* 100 is the ordinal for _XInputGetStateEx, which returns the same struct as XinputGetState, but with extra data in wButtons for the guide button, we think... */
     5.7 -    SDL_XInputGetState = (XInputGetState_t)GetProcAddress((HMODULE)s_pXInputDLL, (LPCSTR)100);
     5.8 +    *(void**)&SDL_XInputGetState = GetProcAddress((HMODULE)s_pXInputDLL, (LPCSTR)100);
     5.9      if (!SDL_XInputGetState) {
    5.10 -        SDL_XInputGetState = (XInputGetState_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetState");
    5.11 +        *(void**)&SDL_XInputGetState = GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetState");
    5.12      }
    5.13 -    SDL_XInputSetState = (XInputSetState_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputSetState");
    5.14 -    SDL_XInputGetCapabilities = (XInputGetCapabilities_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetCapabilities");
    5.15 -    SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)GetProcAddress( (HMODULE)s_pXInputDLL, "XInputGetBatteryInformation" );
    5.16 +    *(void**)&SDL_XInputSetState = GetProcAddress((HMODULE)s_pXInputDLL, "XInputSetState");
    5.17 +    *(void**)&SDL_XInputGetCapabilities = GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetCapabilities");
    5.18 +    *(void**)&SDL_XInputGetBatteryInformation = GetProcAddress( (HMODULE)s_pXInputDLL, "XInputGetBatteryInformation" );
    5.19      if (!SDL_XInputGetState || !SDL_XInputSetState || !SDL_XInputGetCapabilities) {
    5.20          WIN_UnloadXInputDLL();
    5.21          return -1;
     6.1 --- a/src/dynapi/SDL_dynapi.c	Tue Jan 30 16:53:24 2018 -0800
     6.2 +++ b/src/dynapi/SDL_dynapi.c	Tue Jan 30 18:08:34 2018 -0800
     6.3 @@ -263,7 +263,7 @@
     6.4      SDL_DYNAPI_ENTRYFN entry = SDL_DYNAPI_entry;  /* funcs from here by default. */
     6.5  
     6.6      if (libname) {
     6.7 -        entry = (SDL_DYNAPI_ENTRYFN) get_sdlapi_entry(libname, "SDL_DYNAPI_entry");
     6.8 +        *(void **)&entry = get_sdlapi_entry(libname, "SDL_DYNAPI_entry");
     6.9          if (!entry) {
    6.10              /* !!! FIXME: fail to startup here instead? */
    6.11              /* !!! FIXME: definitely warn user. */
     7.1 --- a/src/events/SDL_quit.c	Tue Jan 30 16:53:24 2018 -0800
     7.2 +++ b/src/events/SDL_quit.c	Tue Jan 30 18:08:34 2018 -0800
     7.3 @@ -55,7 +55,7 @@
     7.4      struct sigaction action;
     7.5      sigaction(SIGINT, NULL, &action);
     7.6  #ifdef HAVE_SA_SIGACTION
     7.7 -    if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
     7.8 +    if ( action.sa_handler == SIG_DFL && (__sighandler_t)action.sa_sigaction == SIG_DFL ) {
     7.9  #else
    7.10      if ( action.sa_handler == SIG_DFL ) {
    7.11  #endif
    7.12 @@ -65,7 +65,7 @@
    7.13      sigaction(SIGTERM, NULL, &action);
    7.14  
    7.15  #ifdef HAVE_SA_SIGACTION
    7.16 -    if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
    7.17 +    if ( action.sa_handler == SIG_DFL && (__sighandler_t)action.sa_sigaction == SIG_DFL ) {
    7.18  #else
    7.19      if ( action.sa_handler == SIG_DFL ) {
    7.20  #endif
     8.1 --- a/src/filesystem/windows/SDL_sysfilesystem.c	Tue Jan 30 16:53:24 2018 -0800
     8.2 +++ b/src/filesystem/windows/SDL_sysfilesystem.c	Tue Jan 30 18:08:34 2018 -0800
     8.3 @@ -50,7 +50,7 @@
     8.4          return NULL;
     8.5      }
     8.6  
     8.7 -    pGetModuleFileNameExW = (GetModuleFileNameExW_t)GetProcAddress(psapi, "GetModuleFileNameExW");
     8.8 +    *(void**)&pGetModuleFileNameExW = GetProcAddress(psapi, "GetModuleFileNameExW");
     8.9      if (!pGetModuleFileNameExW) {
    8.10          WIN_SetError("Couldn't find GetModuleFileNameExW");
    8.11          FreeLibrary(psapi);
     9.1 --- a/src/render/direct3d11/SDL_render_d3d11.c	Tue Jan 30 16:53:24 2018 -0800
     9.2 +++ b/src/render/direct3d11/SDL_render_d3d11.c	Tue Jan 30 18:08:34 2018 -0800
     9.3 @@ -568,7 +568,7 @@
     9.4          goto done;
     9.5      }
     9.6  
     9.7 -    CreateDXGIFactoryFunc = (PFN_CREATE_DXGI_FACTORY)SDL_LoadFunction(data->hDXGIMod, "CreateDXGIFactory");
     9.8 +    *(void**)&CreateDXGIFactoryFunc = SDL_LoadFunction(data->hDXGIMod, "CreateDXGIFactory");
     9.9      if (!CreateDXGIFactoryFunc) {
    9.10          result = E_FAIL;
    9.11          goto done;
    9.12 @@ -580,7 +580,7 @@
    9.13          goto done;
    9.14      }
    9.15  
    9.16 -    D3D11CreateDeviceFunc = (PFN_D3D11_CREATE_DEVICE)SDL_LoadFunction(data->hD3D11Mod, "D3D11CreateDevice");
    9.17 +    *(void**)D3D11CreateDeviceFunc = SDL_LoadFunction(data->hD3D11Mod, "D3D11CreateDevice");
    9.18      if (!D3D11CreateDeviceFunc) {
    9.19          result = E_FAIL;
    9.20          goto done;
    10.1 --- a/src/render/opengl/SDL_render_gl.c	Tue Jan 30 16:53:24 2018 -0800
    10.2 +++ b/src/render/opengl/SDL_render_gl.c	Tue Jan 30 18:08:34 2018 -0800
    10.3 @@ -260,10 +260,8 @@
    10.4  
    10.5  #if 0
    10.6  #define GL_CheckError(prefix, renderer)
    10.7 -#elif defined(_MSC_VER) || defined(__WATCOMC__)
    10.8 -#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __FUNCTION__)
    10.9  #else
   10.10 -#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __PRETTY_FUNCTION__)
   10.11 +#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, SDL_FILE, SDL_LINE, SDL_FUNCTION)
   10.12  #endif
   10.13  
   10.14  static int
   10.15 @@ -274,7 +272,7 @@
   10.16  #else
   10.17  #define SDL_PROC(ret,func,params) \
   10.18      do { \
   10.19 -        data->func = SDL_GL_GetProcAddress(#func); \
   10.20 +        *(void **)&data->func = SDL_GL_GetProcAddress(#func); \
   10.21          if ( ! data->func ) { \
   10.22              return SDL_SetError("Couldn't load GL function %s: %s", #func, SDL_GetError()); \
   10.23          } \
   10.24 @@ -492,7 +490,9 @@
   10.25          data->debug_enabled = SDL_TRUE;
   10.26      }
   10.27      if (data->debug_enabled && SDL_GL_ExtensionSupported("GL_ARB_debug_output")) {
   10.28 -        PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
   10.29 +        PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc;
   10.30 +       
   10.31 +        *(void **)&glDebugMessageCallbackARBFunc = SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
   10.32  
   10.33          data->GL_ARB_debug_output_supported = SDL_TRUE;
   10.34          data->glGetPointerv(GL_DEBUG_CALLBACK_FUNCTION_ARB, (GLvoid **)(char *)&data->next_error_callback);
   10.35 @@ -521,7 +521,7 @@
   10.36  
   10.37      /* Check for multitexture support */
   10.38      if (SDL_GL_ExtensionSupported("GL_ARB_multitexture")) {
   10.39 -        data->glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) SDL_GL_GetProcAddress("glActiveTextureARB");
   10.40 +        *(void **)&data->glActiveTextureARB = SDL_GL_GetProcAddress("glActiveTextureARB");
   10.41          if (data->glActiveTextureARB) {
   10.42              data->GL_ARB_multitexture_supported = SDL_TRUE;
   10.43              data->glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &data->num_texture_units);
   10.44 @@ -549,16 +549,11 @@
   10.45  
   10.46      if (SDL_GL_ExtensionSupported("GL_EXT_framebuffer_object")) {
   10.47          data->GL_EXT_framebuffer_object_supported = SDL_TRUE;
   10.48 -        data->glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)
   10.49 -            SDL_GL_GetProcAddress("glGenFramebuffersEXT");
   10.50 -        data->glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)
   10.51 -            SDL_GL_GetProcAddress("glDeleteFramebuffersEXT");
   10.52 -        data->glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)
   10.53 -            SDL_GL_GetProcAddress("glFramebufferTexture2DEXT");
   10.54 -        data->glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)
   10.55 -            SDL_GL_GetProcAddress("glBindFramebufferEXT");
   10.56 -        data->glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)
   10.57 -            SDL_GL_GetProcAddress("glCheckFramebufferStatusEXT");
   10.58 +        *(void**)&data->glGenFramebuffersEXT = SDL_GL_GetProcAddress("glGenFramebuffersEXT");
   10.59 +        *(void**)&data->glDeleteFramebuffersEXT = SDL_GL_GetProcAddress("glDeleteFramebuffersEXT");
   10.60 +        *(void**)&data->glFramebufferTexture2DEXT = SDL_GL_GetProcAddress("glFramebufferTexture2DEXT");
   10.61 +        *(void**)&data->glBindFramebufferEXT = SDL_GL_GetProcAddress("glBindFramebufferEXT");
   10.62 +        *(void**)&data->glCheckFramebufferStatusEXT = SDL_GL_GetProcAddress("glCheckFramebufferStatusEXT");
   10.63          renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE;
   10.64      }
   10.65      data->framebuffers = NULL;
   10.66 @@ -1615,7 +1610,9 @@
   10.67  
   10.68          GL_ClearErrors(renderer);
   10.69          if (data->GL_ARB_debug_output_supported) {
   10.70 -            PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
   10.71 +            PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc;
   10.72 +            
   10.73 +            *(void **)&glDebugMessageCallbackARBFunc = SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
   10.74  
   10.75              /* Uh oh, we don't have a safe way of removing ourselves from the callback chain, if it changed after we set our callback. */
   10.76              /* For now, just always replace the callback with the original one */
    11.1 --- a/src/render/opengl/SDL_shaders_gl.c	Tue Jan 30 16:53:24 2018 -0800
    11.2 +++ b/src/render/opengl/SDL_shaders_gl.c	Tue Jan 30 18:08:34 2018 -0800
    11.3 @@ -453,20 +453,20 @@
    11.4          SDL_GL_ExtensionSupported("GL_ARB_shading_language_100") &&
    11.5          SDL_GL_ExtensionSupported("GL_ARB_vertex_shader") &&
    11.6          SDL_GL_ExtensionSupported("GL_ARB_fragment_shader")) {
    11.7 -        ctx->glGetError = (GLenum (*)(void)) SDL_GL_GetProcAddress("glGetError");
    11.8 -        ctx->glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) SDL_GL_GetProcAddress("glAttachObjectARB");
    11.9 -        ctx->glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) SDL_GL_GetProcAddress("glCompileShaderARB");
   11.10 -        ctx->glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glCreateProgramObjectARB");
   11.11 -        ctx->glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) SDL_GL_GetProcAddress("glCreateShaderObjectARB");
   11.12 -        ctx->glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) SDL_GL_GetProcAddress("glDeleteObjectARB");
   11.13 -        ctx->glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC) SDL_GL_GetProcAddress("glGetInfoLogARB");
   11.14 -        ctx->glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) SDL_GL_GetProcAddress("glGetObjectParameterivARB");
   11.15 -        ctx->glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) SDL_GL_GetProcAddress("glGetUniformLocationARB");
   11.16 -        ctx->glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) SDL_GL_GetProcAddress("glLinkProgramARB");
   11.17 -        ctx->glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) SDL_GL_GetProcAddress("glShaderSourceARB");
   11.18 -        ctx->glUniform1iARB = (PFNGLUNIFORM1IARBPROC) SDL_GL_GetProcAddress("glUniform1iARB");
   11.19 -        ctx->glUniform1fARB = (PFNGLUNIFORM1FARBPROC) SDL_GL_GetProcAddress("glUniform1fARB");
   11.20 -        ctx->glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glUseProgramObjectARB");
   11.21 +        *(void**)&ctx->glGetError = SDL_GL_GetProcAddress("glGetError");
   11.22 +        *(void **)&ctx->glAttachObjectARB = SDL_GL_GetProcAddress("glAttachObjectARB");
   11.23 +        *(void **)&ctx->glCompileShaderARB = SDL_GL_GetProcAddress("glCompileShaderARB");
   11.24 +        *(void **)&ctx->glCreateProgramObjectARB = SDL_GL_GetProcAddress("glCreateProgramObjectARB");
   11.25 +        *(void **)&ctx->glCreateShaderObjectARB = SDL_GL_GetProcAddress("glCreateShaderObjectARB");
   11.26 +        *(void **)&ctx->glDeleteObjectARB = SDL_GL_GetProcAddress("glDeleteObjectARB");
   11.27 +        *(void **)&ctx->glGetInfoLogARB = SDL_GL_GetProcAddress("glGetInfoLogARB");
   11.28 +        *(void **)&ctx->glGetObjectParameterivARB = SDL_GL_GetProcAddress("glGetObjectParameterivARB");
   11.29 +        *(void **)&ctx->glGetUniformLocationARB = SDL_GL_GetProcAddress("glGetUniformLocationARB");
   11.30 +        *(void **)&ctx->glLinkProgramARB = SDL_GL_GetProcAddress("glLinkProgramARB");
   11.31 +        *(void **)&ctx->glShaderSourceARB = SDL_GL_GetProcAddress("glShaderSourceARB");
   11.32 +        *(void **)&ctx->glUniform1iARB = SDL_GL_GetProcAddress("glUniform1iARB");
   11.33 +        *(void **)&ctx->glUniform1fARB = SDL_GL_GetProcAddress("glUniform1fARB");
   11.34 +        *(void **)&ctx->glUseProgramObjectARB = SDL_GL_GetProcAddress("glUseProgramObjectARB");
   11.35          if (ctx->glGetError &&
   11.36              ctx->glAttachObjectARB &&
   11.37              ctx->glCompileShaderARB &&
    12.1 --- a/src/render/opengles/SDL_render_gles.c	Tue Jan 30 16:53:24 2018 -0800
    12.2 +++ b/src/render/opengles/SDL_render_gles.c	Tue Jan 30 18:08:34 2018 -0800
    12.3 @@ -198,14 +198,14 @@
    12.4  #else
    12.5  #define SDL_PROC(ret,func,params) \
    12.6      do { \
    12.7 -        data->func = SDL_GL_GetProcAddress(#func); \
    12.8 +        *(void**)&data->func = SDL_GL_GetProcAddress(#func); \
    12.9          if ( ! data->func ) { \
   12.10              return SDL_SetError("Couldn't load GLES function %s: %s", #func, SDL_GetError()); \
   12.11          } \
   12.12      } while ( 0 );
   12.13  #define SDL_PROC_OES(ret,func,params) \
   12.14      do { \
   12.15 -        data->func = SDL_GL_GetProcAddress(#func); \
   12.16 +        *(void**)&data->func = SDL_GL_GetProcAddress(#func); \
   12.17      } while ( 0 );    
   12.18  #endif /* __SDL_NOGETPROCADDR__ */
   12.19  
    13.1 --- a/src/render/opengles2/SDL_render_gles2.c	Tue Jan 30 16:53:24 2018 -0800
    13.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Tue Jan 30 18:08:34 2018 -0800
    13.3 @@ -22,6 +22,7 @@
    13.4  
    13.5  #if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED
    13.6  
    13.7 +#include "SDL_assert.h"
    13.8  #include "SDL_hints.h"
    13.9  #include "SDL_opengles2.h"
   13.10  #include "../SDL_sysrender.h"
   13.11 @@ -259,10 +260,8 @@
   13.12  
   13.13  #if 0
   13.14  #define GL_CheckError(prefix, renderer)
   13.15 -#elif defined(_MSC_VER) || defined(__WATCOMC__)
   13.16 -#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __FUNCTION__)
   13.17  #else
   13.18 -#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __PRETTY_FUNCTION__)
   13.19 +#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, SDL_FILE, SDL_LINE, SDL_FUNCTION)
   13.20  #endif
   13.21  
   13.22  
   13.23 @@ -295,7 +294,7 @@
   13.24  #else
   13.25  #define SDL_PROC(ret,func,params) \
   13.26      do { \
   13.27 -        data->func = SDL_GL_GetProcAddress(#func); \
   13.28 +        *(void **)&data->func = SDL_GL_GetProcAddress(#func); \
   13.29          if ( ! data->func ) { \
   13.30              return SDL_SetError("Couldn't load GLES2 function %s: %s", #func, SDL_GetError()); \
   13.31          } \
    14.1 --- a/src/thread/pthread/SDL_systhread.c	Tue Jan 30 16:53:24 2018 -0800
    14.2 +++ b/src/thread/pthread/SDL_systhread.c	Tue Jan 30 18:08:34 2018 -0800
    14.3 @@ -91,11 +91,7 @@
    14.4      #if defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__)
    14.5      if (!checked_setname) {
    14.6          void *fn = dlsym(RTLD_DEFAULT, "pthread_setname_np");
    14.7 -        #if defined(__MACOSX__) || defined(__IPHONEOS__)
    14.8 -        ppthread_setname_np = (int(*)(const char*)) fn;
    14.9 -        #elif defined(__LINUX__)
   14.10 -        ppthread_setname_np = (int(*)(pthread_t, const char*)) fn;
   14.11 -        #endif
   14.12 +        *(void **)&ppthread_setname_np = fn;
   14.13          checked_setname = SDL_TRUE;
   14.14      }
   14.15      #endif
    15.1 --- a/src/thread/windows/SDL_systhread.c	Tue Jan 30 16:53:24 2018 -0800
    15.2 +++ b/src/thread/windows/SDL_systhread.c	Tue Jan 30 18:08:34 2018 -0800
    15.3 @@ -178,7 +178,7 @@
    15.4          if (!kernel32) {
    15.5              kernel32 = LoadLibraryW(L"kernel32.dll");
    15.6              if (kernel32) {
    15.7 -                pSetThreadDescription = (pfnSetThreadDescription) GetProcAddress(kernel32, "SetThreadDescription");
    15.8 +                *(void**)&pSetThreadDescription = GetProcAddress(kernel32, "SetThreadDescription");
    15.9              }
   15.10          }
   15.11  
    16.1 --- a/src/video/SDL_blit.c	Tue Jan 30 16:53:24 2018 -0800
    16.2 +++ b/src/video/SDL_blit.c	Tue Jan 30 18:08:34 2018 -0800
    16.3 @@ -82,7 +82,7 @@
    16.4          info->dst_pitch = dst->pitch;
    16.5          info->dst_skip =
    16.6              info->dst_pitch - info->dst_w * info->dst_fmt->BytesPerPixel;
    16.7 -        RunBlit = (SDL_BlitFunc) src->map->data;
    16.8 +        *(void**)&RunBlit = src->map->data;
    16.9  
   16.10          /* Run the actual software blit */
   16.11          RunBlit(info);
   16.12 @@ -282,7 +282,7 @@
   16.13              blit = SDL_Blit_Slow;
   16.14          }
   16.15      }
   16.16 -    map->data = blit;
   16.17 +    *(SDL_BlitFunc *)&map->data = blit;
   16.18  
   16.19      /* Make sure we have a blit function */
   16.20      if (blit == NULL) {
    17.1 --- a/src/video/SDL_egl.c	Tue Jan 30 16:53:24 2018 -0800
    17.2 +++ b/src/video/SDL_egl.c	Tue Jan 30 18:08:34 2018 -0800
    17.3 @@ -87,7 +87,7 @@
    17.4  _this->egl_data->NAME = (void *)NAME;
    17.5  #else
    17.6  #define LOAD_FUNC(NAME) \
    17.7 -_this->egl_data->NAME = SDL_LoadFunction(_this->egl_data->dll_handle, #NAME); \
    17.8 +*(void**)&_this->egl_data->NAME = SDL_LoadFunction(_this->egl_data->dll_handle, #NAME); \
    17.9  if (!_this->egl_data->NAME) \
   17.10  { \
   17.11      return SDL_SetError("Could not retrieve EGL function " #NAME); \
   17.12 @@ -432,7 +432,7 @@
   17.13              _this->egl_data->egl_display = _this->egl_data->eglGetPlatformDisplay(platform, (void *)(size_t)native_display, NULL);
   17.14          } else {
   17.15              if (SDL_EGL_HasExtension(_this, SDL_EGL_CLIENT_EXTENSION, "EGL_EXT_platform_base")) {
   17.16 -                _this->egl_data->eglGetPlatformDisplayEXT = SDL_EGL_GetProcAddress(_this, "eglGetPlatformDisplayEXT");
   17.17 +                *(void**)&_this->egl_data->eglGetPlatformDisplayEXT = SDL_EGL_GetProcAddress(_this, "eglGetPlatformDisplayEXT");
   17.18                  if (_this->egl_data->eglGetPlatformDisplayEXT) {
   17.19                      _this->egl_data->egl_display = _this->egl_data->eglGetPlatformDisplayEXT(platform, (void *)(size_t)native_display, NULL);
   17.20                  }
    18.1 --- a/src/video/SDL_sysvideo.h	Tue Jan 30 16:53:24 2018 -0800
    18.2 +++ b/src/video/SDL_sysvideo.h	Tue Jan 30 18:08:34 2018 -0800
    18.3 @@ -365,8 +365,8 @@
    18.4      /* Data used by the Vulkan drivers */
    18.5      struct
    18.6      {
    18.7 -        void *vkGetInstanceProcAddr;
    18.8 -        void *vkEnumerateInstanceExtensionProperties;
    18.9 +        PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
   18.10 +        PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties;
   18.11          int loader_loaded;
   18.12          char loader_path[256];
   18.13          void *loader_handle;
    19.1 --- a/src/video/SDL_video.c	Tue Jan 30 16:53:24 2018 -0800
    19.2 +++ b/src/video/SDL_video.c	Tue Jan 30 18:08:34 2018 -0800
    19.3 @@ -224,7 +224,7 @@
    19.4                  const GLubyte *(APIENTRY * glGetStringFunc) (GLenum);
    19.5                  const char *vendor = NULL;
    19.6  
    19.7 -                glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
    19.8 +                *(void**)&glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
    19.9                  if (glGetStringFunc) {
   19.10                      vendor = (const char *) glGetStringFunc(GL_VENDOR);
   19.11                  }
   19.12 @@ -2870,7 +2870,7 @@
   19.13  
   19.14      /* Lookup the available extensions */
   19.15  
   19.16 -    glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
   19.17 +    *(void**)&glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
   19.18      if (!glGetStringFunc) {
   19.19          return SDL_FALSE;
   19.20      }
   19.21 @@ -2881,8 +2881,8 @@
   19.22          GLint num_exts = 0;
   19.23          GLint i;
   19.24  
   19.25 -        glGetStringiFunc = SDL_GL_GetProcAddress("glGetStringi");
   19.26 -        glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
   19.27 +        *(void**)&glGetStringiFunc = SDL_GL_GetProcAddress("glGetStringi");
   19.28 +        *(void**)&glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
   19.29          if ((!glGetStringiFunc) || (!glGetIntegervFunc)) {
   19.30              return SDL_FALSE;
   19.31          }
   19.32 @@ -3342,13 +3342,13 @@
   19.33      }
   19.34  
   19.35  #if SDL_VIDEO_OPENGL
   19.36 -    glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
   19.37 +    *(void**)&glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
   19.38      if (!glGetStringFunc) {
   19.39          return -1;
   19.40      }
   19.41  
   19.42      if (attachmentattrib && isAtLeastGL3((const char *) glGetStringFunc(GL_VERSION))) {
   19.43 -        glGetFramebufferAttachmentParameterivFunc = SDL_GL_GetProcAddress("glGetFramebufferAttachmentParameteriv");
   19.44 +        *(void**)&glGetFramebufferAttachmentParameterivFunc = SDL_GL_GetProcAddress("glGetFramebufferAttachmentParameteriv");
   19.45  
   19.46          if (glGetFramebufferAttachmentParameterivFunc) {
   19.47              glGetFramebufferAttachmentParameterivFunc(GL_FRAMEBUFFER, attachment, attachmentattrib, (GLint *) value);
   19.48 @@ -3359,7 +3359,7 @@
   19.49  #endif
   19.50      {
   19.51          void (APIENTRY *glGetIntegervFunc) (GLenum pname, GLint * params);
   19.52 -        glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
   19.53 +        *(void**)&glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
   19.54          if (glGetIntegervFunc) {
   19.55              glGetIntegervFunc(attrib, (GLint *) value);
   19.56          } else {
   19.57 @@ -3367,7 +3367,7 @@
   19.58          }
   19.59      }
   19.60  
   19.61 -    glGetErrorFunc = SDL_GL_GetProcAddress("glGetError");
   19.62 +    *(void**)&glGetErrorFunc = SDL_GL_GetProcAddress("glGetError");
   19.63      if (!glGetErrorFunc) {
   19.64          return -1;
   19.65      }
   19.66 @@ -3995,14 +3995,17 @@
   19.67  
   19.68  void *SDL_Vulkan_GetVkGetInstanceProcAddr(void)
   19.69  {
   19.70 +    void *func = NULL;
   19.71      if (!_this) {
   19.72          SDL_UninitializedVideo();
   19.73          return NULL;
   19.74      }
   19.75      if (!_this->vulkan_config.loader_loaded) {
   19.76          SDL_SetError("No Vulkan loader has been loaded");
   19.77 -    }
   19.78 -    return _this->vulkan_config.vkGetInstanceProcAddr;
   19.79 +        return NULL;
   19.80 +    }
   19.81 +    *(PFN_vkGetInstanceProcAddr*)&func =  _this->vulkan_config.vkGetInstanceProcAddr;
   19.82 +    return func;
   19.83  }
   19.84  
   19.85  void SDL_Vulkan_UnloadLibrary(void)
    20.1 --- a/src/video/SDL_vulkan_internal.h	Tue Jan 30 16:53:24 2018 -0800
    20.2 +++ b/src/video/SDL_vulkan_internal.h	Tue Jan 30 18:08:34 2018 -0800
    20.3 @@ -81,6 +81,9 @@
    20.4  /* No SDL Vulkan support, just include the header for typedefs */
    20.5  #include "SDL_vulkan.h"
    20.6  
    20.7 +typedef void* PFN_vkGetInstanceProcAddr;
    20.8 +typedef void* PFN_vkEnumerateInstanceExtensionProperties;
    20.9 +
   20.10  #endif /* SDL_VIDEO_VULKAN */
   20.11  
   20.12  #endif /* SDL_vulkan_internal_h_ */
    21.1 --- a/src/video/android/SDL_androidvulkan.c	Tue Jan 30 16:53:24 2018 -0800
    21.2 +++ b/src/video/android/SDL_androidvulkan.c	Tue Jan 30 18:08:34 2018 -0800
    21.3 @@ -56,13 +56,13 @@
    21.4          return -1;
    21.5      SDL_strlcpy(_this->vulkan_config.loader_path, path,
    21.6                  SDL_arraysize(_this->vulkan_config.loader_path));
    21.7 -    vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
    21.8 +    *(void**)&vkGetInstanceProcAddr = SDL_LoadFunction(
    21.9          _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
   21.10      if(!vkGetInstanceProcAddr)
   21.11          goto fail;
   21.12 -    _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
   21.13 +    _this->vulkan_config.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
   21.14      _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
   21.15 -        (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
   21.16 +        (PFN_vkEnumerateInstanceExtensionProperties)_this->vulkan_config.vkGetInstanceProcAddr(
   21.17              VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   21.18      if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties)
   21.19          goto fail;
   21.20 @@ -139,7 +139,7 @@
   21.21          (PFN_vkCreateAndroidSurfaceKHR)vkGetInstanceProcAddr(
   21.22                                              (VkInstance)instance,
   21.23                                              "vkCreateAndroidSurfaceKHR");
   21.24 -    VkAndroidSurfaceCreateInfoKHR createInfo = {};
   21.25 +    VkAndroidSurfaceCreateInfoKHR createInfo;
   21.26      VkResult result;
   21.27  
   21.28      if(!_this->vulkan_config.loader_handle)
   21.29 @@ -154,6 +154,7 @@
   21.30                       " extension is not enabled in the Vulkan instance.");
   21.31          return SDL_FALSE;
   21.32      }
   21.33 +    SDL_zero(createInfo);
   21.34      createInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR;
   21.35      createInfo.pNext = NULL;
   21.36      createInfo.flags = 0;
    22.1 --- a/src/video/cocoa/SDL_cocoavulkan.m	Tue Jan 30 16:53:24 2018 -0800
    22.2 +++ b/src/video/cocoa/SDL_cocoavulkan.m	Tue Jan 30 18:08:34 2018 -0800
    22.3 @@ -83,7 +83,7 @@
    22.4          }
    22.5          SDL_strlcpy(_this->vulkan_config.loader_path, path,
    22.6                      SDL_arraysize(_this->vulkan_config.loader_path));
    22.7 -        vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
    22.8 +        *(void**)&vkGetInstanceProcAddr = SDL_LoadFunction(
    22.9              _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
   22.10      }
   22.11  
   22.12 @@ -95,9 +95,9 @@
   22.13          goto fail;
   22.14      }
   22.15  
   22.16 -    _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
   22.17 +    _this->vulkan_config.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
   22.18      _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
   22.19 -        (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
   22.20 +        (PFN_vkEnumerateInstanceExtensionProperties)_this->vulkan_config.vkGetInstanceProcAddr(
   22.21              VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   22.22      if (!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) {
   22.23          goto fail;
    23.1 --- a/src/video/mir/SDL_mirdyn.c	Tue Jan 30 16:53:24 2018 -0800
    23.2 +++ b/src/video/mir/SDL_mirdyn.c	Tue Jan 30 18:08:34 2018 -0800
    23.3 @@ -139,7 +139,7 @@
    23.4  #include "SDL_mirsym.h"
    23.5  
    23.6  #define SDL_MIR_MODULE(modname) thismod = &SDL_MIR_HAVE_##modname;
    23.7 -#define SDL_MIR_SYM(rc,fn,params) MIR_##fn = (SDL_DYNMIRFN_##fn) MIR_GetSym(#fn,thismod);
    23.8 +#define SDL_MIR_SYM(rc,fn,params) *(void**)&MIR_##fn = MIR_GetSym(#fn,thismod);
    23.9  #define SDL_MIR_SYM_CONST(type,name) MIR_##name = *(SDL_DYMMIRCONST_##name*) MIR_GetSym(#name,thismod);
   23.10  #include "SDL_mirsym.h"
   23.11  
    24.1 --- a/src/video/mir/SDL_mirvideo.c	Tue Jan 30 16:53:24 2018 -0800
    24.2 +++ b/src/video/mir/SDL_mirvideo.c	Tue Jan 30 18:08:34 2018 -0800
    24.3 @@ -27,6 +27,7 @@
    24.4  
    24.5  #if SDL_VIDEO_DRIVER_MIR
    24.6  
    24.7 +#include "SDL_assert.h"
    24.8  #include "SDL_log.h"
    24.9  
   24.10  #include "SDL_mirwindow.h"
   24.11 @@ -103,7 +104,7 @@
   24.12      if (SDL_MIR_LoadSymbols()) {
   24.13  
   24.14          /* Lets ensure we can connect to the mir server */
   24.15 -        MirConnection* connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);
   24.16 +        MirConnection* connection = MIR_mir_connect_sync(NULL, SDL_FUNCTION);
   24.17  
   24.18          if (!MIR_mir_connection_is_valid(connection)) {
   24.19              SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "Unable to connect to the mir server %s",
   24.20 @@ -319,7 +320,7 @@
   24.21  {
   24.22      MIR_Data* mir_data = _this->driverdata;
   24.23  
   24.24 -    mir_data->connection     = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);
   24.25 +    mir_data->connection     = MIR_mir_connect_sync(NULL, SDL_FUNCTION);
   24.26      mir_data->current_window = NULL;
   24.27      mir_data->software       = SDL_FALSE;
   24.28      mir_data->pixel_format   = mir_pixel_format_invalid;
    25.1 --- a/src/video/mir/SDL_mirvulkan.c	Tue Jan 30 16:53:24 2018 -0800
    25.2 +++ b/src/video/mir/SDL_mirvulkan.c	Tue Jan 30 18:08:34 2018 -0800
    25.3 @@ -56,14 +56,13 @@
    25.4          return -1;
    25.5      SDL_strlcpy(_this->vulkan_config.loader_path, path,
    25.6                  SDL_arraysize(_this->vulkan_config.loader_path));
    25.7 -    vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
    25.8 +    *(void**)&vkGetInstanceProcAddr = SDL_LoadFunction(
    25.9          _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
   25.10      if(!vkGetInstanceProcAddr)
   25.11          goto fail;
   25.12 -    _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
   25.13 +    _this->vulkan_config.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
   25.14      _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
   25.15 -        (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
   25.16 -            VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   25.17 +        (PFN_vkEnumerateInstanceExtensionProperties)_this->vulkan_config.vkGetInstanceProcAddr(VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   25.18      if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties)
   25.19          goto fail;
   25.20      extensions = SDL_Vulkan_CreateInstanceExtensionsList(
   25.21 @@ -139,7 +138,7 @@
   25.22          (PFN_vkCreateMirSurfaceKHR)vkGetInstanceProcAddr(
   25.23                                              (VkInstance)instance,
   25.24                                              "vkCreateMirSurfaceKHR");
   25.25 -    VkMirSurfaceCreateInfoKHR createInfo = {};
   25.26 +    VkMirSurfaceCreateInfoKHR createInfo;
   25.27      VkResult result;
   25.28  
   25.29      if(!_this->vulkan_config.loader_handle)
   25.30 @@ -154,6 +153,7 @@
   25.31                       " extension is not enabled in the Vulkan instance.");
   25.32          return SDL_FALSE;
   25.33      }
   25.34 +    SDL_zero(createInfo);
   25.35      createInfo.sType = VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR;
   25.36      createInfo.pNext = NULL;
   25.37      createInfo.flags = 0;
    26.1 --- a/src/video/uikit/SDL_uikitvulkan.m	Tue Jan 30 16:53:24 2018 -0800
    26.2 +++ b/src/video/uikit/SDL_uikitvulkan.m	Tue Jan 30 18:08:34 2018 -0800
    26.3 @@ -84,8 +84,7 @@
    26.4          }
    26.5          SDL_strlcpy(_this->vulkan_config.loader_path, path,
    26.6                      SDL_arraysize(_this->vulkan_config.loader_path));
    26.7 -        vkGetInstanceProcAddr =
    26.8 -            (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
    26.9 +        *(void**)&vkGetInstanceProcAddr = SDL_LoadFunction(
   26.10                                      _this->vulkan_config.loader_handle,
   26.11                                      "vkGetInstanceProcAddr");
   26.12      }
    27.1 --- a/src/video/wayland/SDL_waylanddatamanager.c	Tue Jan 30 16:53:24 2018 -0800
    27.2 +++ b/src/video/wayland/SDL_waylanddatamanager.c	Tue Jan 30 18:08:34 2018 -0800
    27.3 @@ -61,7 +61,7 @@
    27.4          bytes_written = SDL_SetError("Pipe select error");
    27.5      } else {
    27.6          if (length > 0) {
    27.7 -            bytes_written = write(fd, buffer + *pos, SDL_min(length, PIPE_BUF));
    27.8 +            bytes_written = write(fd, (Uint8*)buffer + *pos, SDL_min(length, PIPE_BUF));
    27.9          }
   27.10  
   27.11          if (bytes_written > 0) {
   27.12 @@ -114,10 +114,10 @@
   27.13          if (output_buffer == NULL) {
   27.14              bytes_read = SDL_OutOfMemory();
   27.15          } else {
   27.16 -            SDL_memcpy(output_buffer + pos, temp, bytes_read);
   27.17 +            SDL_memcpy((Uint8*)output_buffer + pos, temp, bytes_read);
   27.18  
   27.19              if (null_terminate == SDL_TRUE) {
   27.20 -                SDL_memset(output_buffer + (new_buffer_length - 1), 0, 1);
   27.21 +                SDL_memset((Uint8*)output_buffer + (new_buffer_length - 1), 0, 1);
   27.22              }
   27.23              
   27.24              *buffer = output_buffer;
    28.1 --- a/src/video/wayland/SDL_waylanddyn.c	Tue Jan 30 16:53:24 2018 -0800
    28.2 +++ b/src/video/wayland/SDL_waylanddyn.c	Tue Jan 30 18:08:34 2018 -0800
    28.3 @@ -147,7 +147,7 @@
    28.4  #include "SDL_waylandsym.h"
    28.5  
    28.6  #define SDL_WAYLAND_MODULE(modname) thismod = &SDL_WAYLAND_HAVE_##modname;
    28.7 -#define SDL_WAYLAND_SYM(rc,fn,params) WAYLAND_##fn = (SDL_DYNWAYLANDFN_##fn) WAYLAND_GetSym(#fn,thismod);
    28.8 +#define SDL_WAYLAND_SYM(rc,fn,params) *(void**)&WAYLAND_##fn = WAYLAND_GetSym(#fn,thismod);
    28.9  #define SDL_WAYLAND_INTERFACE(iface) WAYLAND_##iface = (struct wl_interface *) WAYLAND_GetSym(#iface,thismod);
   28.10  #include "SDL_waylandsym.h"
   28.11  
    29.1 --- a/src/video/wayland/SDL_waylandopengles.h	Tue Jan 30 16:53:24 2018 -0800
    29.2 +++ b/src/video/wayland/SDL_waylandopengles.h	Tue Jan 30 18:08:34 2018 -0800
    29.3 @@ -28,6 +28,7 @@
    29.4  
    29.5  typedef struct SDL_PrivateGLESData
    29.6  {
    29.7 +    int dummy;
    29.8  } SDL_PrivateGLESData;
    29.9  
   29.10  /* OpenGLES functions */
    30.1 --- a/src/video/wayland/SDL_waylandvulkan.c	Tue Jan 30 16:53:24 2018 -0800
    30.2 +++ b/src/video/wayland/SDL_waylandvulkan.c	Tue Jan 30 18:08:34 2018 -0800
    30.3 @@ -56,13 +56,12 @@
    30.4          return -1;
    30.5      SDL_strlcpy(_this->vulkan_config.loader_path, path,
    30.6                  SDL_arraysize(_this->vulkan_config.loader_path));
    30.7 -    vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
    30.8 -        _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
    30.9 +    *(void**)&vkGetInstanceProcAddr = SDL_LoadFunction(_this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
   30.10      if(!vkGetInstanceProcAddr)
   30.11          goto fail;
   30.12 -    _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
   30.13 +    _this->vulkan_config.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
   30.14      _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
   30.15 -        (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
   30.16 +        (PFN_vkEnumerateInstanceExtensionProperties)_this->vulkan_config.vkGetInstanceProcAddr(
   30.17              VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   30.18      if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties)
   30.19          goto fail;
   30.20 @@ -139,7 +138,7 @@
   30.21          (PFN_vkCreateWaylandSurfaceKHR)vkGetInstanceProcAddr(
   30.22                                              (VkInstance)instance,
   30.23                                              "vkCreateWaylandSurfaceKHR");
   30.24 -    VkWaylandSurfaceCreateInfoKHR createInfo = {};
   30.25 +    VkWaylandSurfaceCreateInfoKHR createInfo;
   30.26      VkResult result;
   30.27  
   30.28      if(!_this->vulkan_config.loader_handle)
   30.29 @@ -154,6 +153,7 @@
   30.30                       " extension is not enabled in the Vulkan instance.");
   30.31          return SDL_FALSE;
   30.32      }
   30.33 +    SDL_zero(createInfo);
   30.34      createInfo.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR;
   30.35      createInfo.pNext = NULL;
   30.36      createInfo.flags = 0;
    31.1 --- a/src/video/windows/SDL_windowsevents.c	Tue Jan 30 16:53:24 2018 -0800
    31.2 +++ b/src/video/windows/SDL_windowsevents.c	Tue Jan 30 18:08:34 2018 -0800
    31.3 @@ -1086,7 +1086,9 @@
    31.4      HMODULE handle = GetModuleHandleW(L"ntdll.dll");
    31.5      if (handle) {
    31.6          typedef LONG(WINAPI* RtlGetVersionPtr)(struct SDL_WIN_OSVERSIONINFOW*);
    31.7 -        RtlGetVersionPtr getVersionPtr = (RtlGetVersionPtr)GetProcAddress(handle, "RtlGetVersion");
    31.8 +        RtlGetVersionPtr getVersionPtr;
    31.9 +       
   31.10 +        *(void**)&getVersionPtr = GetProcAddress(handle, "RtlGetVersion");
   31.11          if (getVersionPtr != NULL) {
   31.12              struct SDL_WIN_OSVERSIONINFOW info;
   31.13              SDL_zero(info);
    32.1 --- a/src/video/windows/SDL_windowskeyboard.c	Tue Jan 30 16:53:24 2018 -0800
    32.2 +++ b/src/video/windows/SDL_windowskeyboard.c	Tue Jan 30 18:08:34 2018 -0800
    32.3 @@ -354,10 +354,10 @@
    32.4          SDL_ClearError();
    32.5          return;
    32.6      }
    32.7 -    videodata->ImmLockIMC = (LPINPUTCONTEXT2 (WINAPI *)(HIMC))SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMC");
    32.8 -    videodata->ImmUnlockIMC = (BOOL (WINAPI *)(HIMC))SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMC");
    32.9 -    videodata->ImmLockIMCC = (LPVOID (WINAPI *)(HIMCC))SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMCC");
   32.10 -    videodata->ImmUnlockIMCC = (BOOL (WINAPI *)(HIMCC))SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMCC");
   32.11 +    *(void**)&videodata->ImmLockIMC = SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMC");
   32.12 +    *(void**)&videodata->ImmUnlockIMC = SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMC");
   32.13 +    *(void**)&videodata->ImmLockIMCC = SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMCC");
   32.14 +    *(void**)&videodata->ImmUnlockIMCC = SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMCC");
   32.15  
   32.16      IME_SetWindow(videodata, hwnd);
   32.17      videodata->ime_himc = ImmGetContext(hwnd);
   32.18 @@ -654,9 +654,9 @@
   32.19      if (!hime)
   32.20          return;
   32.21  
   32.22 -    videodata->GetReadingString = (UINT (WINAPI *)(HIMC, UINT, LPWSTR, PINT, BOOL*, PUINT))
   32.23 +    *(void**)&videodata->GetReadingString =
   32.24          SDL_LoadFunction(hime, "GetReadingString");
   32.25 -    videodata->ShowReadingWindow = (BOOL (WINAPI *)(HIMC, BOOL))
   32.26 +    *(void**)&videodata->ShowReadingWindow =
   32.27          SDL_LoadFunction(hime, "ShowReadingWindow");
   32.28  
   32.29      if (videodata->ShowReadingWindow) {
    33.1 --- a/src/video/windows/SDL_windowsopengl.c	Tue Jan 30 16:53:24 2018 -0800
    33.2 +++ b/src/video/windows/SDL_windowsopengl.c	Tue Jan 30 18:08:34 2018 -0800
    33.3 @@ -119,15 +119,15 @@
    33.4  
    33.5      /* Load function pointers */
    33.6      handle = _this->gl_config.dll_handle;
    33.7 -    _this->gl_data->wglGetProcAddress = (void *(WINAPI *) (const char *))
    33.8 +    *(void**)&_this->gl_data->wglGetProcAddress =
    33.9          SDL_LoadFunction(handle, "wglGetProcAddress");
   33.10 -    _this->gl_data->wglCreateContext = (HGLRC(WINAPI *) (HDC))
   33.11 +    *(void**)&_this->gl_data->wglCreateContext =
   33.12          SDL_LoadFunction(handle, "wglCreateContext");
   33.13 -    _this->gl_data->wglDeleteContext = (BOOL(WINAPI *) (HGLRC))
   33.14 +    *(void**)&_this->gl_data->wglDeleteContext =
   33.15          SDL_LoadFunction(handle, "wglDeleteContext");
   33.16 -    _this->gl_data->wglMakeCurrent = (BOOL(WINAPI *) (HDC, HGLRC))
   33.17 +    *(void**)&_this->gl_data->wglMakeCurrent =
   33.18          SDL_LoadFunction(handle, "wglMakeCurrent");
   33.19 -    _this->gl_data->wglShareLists = (BOOL(WINAPI *) (HGLRC, HGLRC))
   33.20 +    *(void**)&_this->gl_data->wglShareLists =
   33.21          SDL_LoadFunction(handle, "wglShareLists");
   33.22  
   33.23      if (!_this->gl_data->wglGetProcAddress ||
   33.24 @@ -409,7 +409,7 @@
   33.25      }
   33.26      _this->gl_data->wglMakeCurrent(hdc, hglrc);
   33.27  
   33.28 -    wglGetExtensionsStringARB = (const char *(WINAPI *) (HDC))
   33.29 +    *(void**)&wglGetExtensionsStringARB =
   33.30          _this->gl_data->wglGetProcAddress("wglGetExtensionsStringARB");
   33.31      if (wglGetExtensionsStringARB) {
   33.32          extensions = wglGetExtensionsStringARB(hdc);
   33.33 @@ -420,13 +420,9 @@
   33.34      /* Check for WGL_ARB_pixel_format */
   33.35      _this->gl_data->HAS_WGL_ARB_pixel_format = SDL_FALSE;
   33.36      if (HasExtension("WGL_ARB_pixel_format", extensions)) {
   33.37 -        _this->gl_data->wglChoosePixelFormatARB = (BOOL(WINAPI *)
   33.38 -                                                   (HDC, const int *,
   33.39 -                                                    const FLOAT *, UINT,
   33.40 -                                                    int *, UINT *))
   33.41 +        *(void**)&_this->gl_data->wglChoosePixelFormatARB =
   33.42              WIN_GL_GetProcAddress(_this, "wglChoosePixelFormatARB");
   33.43 -        _this->gl_data->wglGetPixelFormatAttribivARB =
   33.44 -            (BOOL(WINAPI *) (HDC, int, int, UINT, const int *, int *))
   33.45 +        *(void**)&_this->gl_data->wglGetPixelFormatAttribivARB =
   33.46              WIN_GL_GetProcAddress(_this, "wglGetPixelFormatAttribivARB");
   33.47  
   33.48          if ((_this->gl_data->wglChoosePixelFormatARB != NULL) &&
   33.49 @@ -438,9 +434,9 @@
   33.50      /* Check for WGL_EXT_swap_control */
   33.51      _this->gl_data->HAS_WGL_EXT_swap_control_tear = SDL_FALSE;
   33.52      if (HasExtension("WGL_EXT_swap_control", extensions)) {
   33.53 -        _this->gl_data->wglSwapIntervalEXT =
   33.54 +        *(void**)&_this->gl_data->wglSwapIntervalEXT =
   33.55              WIN_GL_GetProcAddress(_this, "wglSwapIntervalEXT");
   33.56 -        _this->gl_data->wglGetSwapIntervalEXT =
   33.57 +        *(void**)&_this->gl_data->wglGetSwapIntervalEXT =
   33.58              WIN_GL_GetProcAddress(_this, "wglGetSwapIntervalEXT");
   33.59          if (HasExtension("WGL_EXT_swap_control_tear", extensions)) {
   33.60              _this->gl_data->HAS_WGL_EXT_swap_control_tear = SDL_TRUE;
   33.61 @@ -721,9 +717,8 @@
   33.62              return NULL;
   33.63          }
   33.64  
   33.65 -        wglCreateContextAttribsARB =
   33.66 -            (PFNWGLCREATECONTEXTATTRIBSARBPROC) _this->gl_data->
   33.67 -            wglGetProcAddress("wglCreateContextAttribsARB");
   33.68 +        *(void**)&wglCreateContextAttribsARB =
   33.69 +            _this->gl_data->wglGetProcAddress("wglCreateContextAttribsARB");
   33.70          if (!wglCreateContextAttribsARB) {
   33.71              SDL_SetError("GL 3.x is not supported");
   33.72              context = temp_context;
    34.1 --- a/src/video/windows/SDL_windowsvideo.c	Tue Jan 30 16:53:24 2018 -0800
    34.2 +++ b/src/video/windows/SDL_windowsvideo.c	Tue Jan 30 18:08:34 2018 -0800
    34.3 @@ -113,16 +113,16 @@
    34.4  
    34.5      data->userDLL = SDL_LoadObject("USER32.DLL");
    34.6      if (data->userDLL) {
    34.7 -        data->CloseTouchInputHandle = (BOOL (WINAPI *)(HTOUCHINPUT)) SDL_LoadFunction(data->userDLL, "CloseTouchInputHandle");
    34.8 -        data->GetTouchInputInfo = (BOOL (WINAPI *)(HTOUCHINPUT, UINT, PTOUCHINPUT, int)) SDL_LoadFunction(data->userDLL, "GetTouchInputInfo");
    34.9 -        data->RegisterTouchWindow = (BOOL (WINAPI *)(HWND, ULONG)) SDL_LoadFunction(data->userDLL, "RegisterTouchWindow");
   34.10 +        *(void**)&data->CloseTouchInputHandle = SDL_LoadFunction(data->userDLL, "CloseTouchInputHandle");
   34.11 +        *(void**)&data->GetTouchInputInfo = SDL_LoadFunction(data->userDLL, "GetTouchInputInfo");
   34.12 +        *(void**)&data->RegisterTouchWindow = SDL_LoadFunction(data->userDLL, "RegisterTouchWindow");
   34.13      } else {
   34.14          SDL_ClearError();
   34.15      }
   34.16  
   34.17      data->shcoreDLL = SDL_LoadObject("SHCORE.DLL");
   34.18      if (data->shcoreDLL) {
   34.19 -        data->GetDpiForMonitor = (HRESULT (WINAPI *)(HMONITOR, MONITOR_DPI_TYPE, UINT *, UINT *)) SDL_LoadFunction(data->shcoreDLL, "GetDpiForMonitor");
   34.20 +        *(void**)&data->GetDpiForMonitor = SDL_LoadFunction(data->shcoreDLL, "GetDpiForMonitor");
   34.21      } else {
   34.22          SDL_ClearError();
   34.23      }
   34.24 @@ -256,7 +256,7 @@
   34.25          typedef HRESULT (WINAPI *Direct3DCreate9Ex_t)(UINT SDKVersion, IDirect3D9Ex **ppD3D);
   34.26          Direct3DCreate9Ex_t Direct3DCreate9ExFunc;
   34.27  
   34.28 -        Direct3DCreate9ExFunc = (Direct3DCreate9Ex_t)SDL_LoadFunction(*pD3DDLL, "Direct3DCreate9Ex");
   34.29 +        *(void**)&Direct3DCreate9ExFunc = SDL_LoadFunction(*pD3DDLL, "Direct3DCreate9Ex");
   34.30          if (Direct3DCreate9ExFunc) {
   34.31              IDirect3D9Ex *pDirect3D9ExInterface;
   34.32              HRESULT hr = Direct3DCreate9ExFunc(D3D_SDK_VERSION, &pDirect3D9ExInterface);
   34.33 @@ -271,7 +271,7 @@
   34.34          }
   34.35  #endif /* USE_D3D9EX */
   34.36  
   34.37 -        Direct3DCreate9Func = (Direct3DCreate9_t)SDL_LoadFunction(*pD3DDLL, "Direct3DCreate9");
   34.38 +        *(void**)&Direct3DCreate9Func = SDL_LoadFunction(*pD3DDLL, "Direct3DCreate9");
   34.39          if (Direct3DCreate9Func) {
   34.40              *pDirect3D9Interface = Direct3DCreate9Func(D3D_SDK_VERSION);
   34.41              if (*pDirect3D9Interface) {
   34.42 @@ -338,9 +338,7 @@
   34.43      if (*pDXGIDLL) {
   34.44          HRESULT (WINAPI *CreateDXGI)(REFIID riid, void **ppFactory);
   34.45  
   34.46 -        CreateDXGI =
   34.47 -            (HRESULT (WINAPI *) (REFIID, void**)) SDL_LoadFunction(*pDXGIDLL,
   34.48 -            "CreateDXGIFactory");
   34.49 +        *(void**)&CreateDXGI = SDL_LoadFunction(*pDXGIDLL, "CreateDXGIFactory");
   34.50          if (CreateDXGI) {
   34.51              GUID dxgiGUID = {0x7b7166ec,0x21c7,0x44ae,{0xb2,0x1a,0xc9,0xae,0x32,0x1a,0xe3,0x69}};
   34.52              if (!SUCCEEDED(CreateDXGI(&dxgiGUID, (void**)pDXGIFactory))) {
    35.1 --- a/src/video/windows/SDL_windowsvulkan.c	Tue Jan 30 16:53:24 2018 -0800
    35.2 +++ b/src/video/windows/SDL_windowsvulkan.c	Tue Jan 30 18:08:34 2018 -0800
    35.3 @@ -57,13 +57,13 @@
    35.4          return -1;
    35.5      SDL_strlcpy(_this->vulkan_config.loader_path, path,
    35.6                  SDL_arraysize(_this->vulkan_config.loader_path));
    35.7 -    vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
    35.8 +    *(void**)vkGetInstanceProcAddr = SDL_LoadFunction(
    35.9          _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
   35.10      if(!vkGetInstanceProcAddr)
   35.11          goto fail;
   35.12 -    _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
   35.13 +    _this->vulkan_config.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
   35.14      _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
   35.15 -        (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
   35.16 +        (PFN_vkEnumerateInstanceExtensionProperties)_this->vulkan_config.vkGetInstanceProcAddr(
   35.17              VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   35.18      if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties)
   35.19          goto fail;
    36.1 --- a/src/video/winrt/SDL_winrtopengles.cpp	Tue Jan 30 16:53:24 2018 -0800
    36.2 +++ b/src/video/winrt/SDL_winrtopengles.cpp	Tue Jan 30 18:08:34 2018 -0800
    36.3 @@ -63,7 +63,8 @@
    36.4      }
    36.5  
    36.6      /* Load ANGLE/WinRT-specific functions */
    36.7 -    CreateWinrtEglWindow_Old_Function CreateWinrtEglWindow = (CreateWinrtEglWindow_Old_Function) SDL_LoadFunction(_this->egl_data->egl_dll_handle, "CreateWinrtEglWindow");
    36.8 +    CreateWinrtEglWindow_Old_Function CreateWinrtEglWindow;
    36.9 +    *(void**)&CreateWinrtEglWindow =  SDL_LoadFunction(_this->egl_data->egl_dll_handle, "CreateWinrtEglWindow");
   36.10      if (CreateWinrtEglWindow) {
   36.11          /* 'CreateWinrtEglWindow' was found, which means that an an older
   36.12           * version of ANGLE/WinRT is being used.  Continue setting up EGL,
    37.1 --- a/src/video/x11/SDL_x11dyn.c	Tue Jan 30 16:53:24 2018 -0800
    37.2 +++ b/src/video/x11/SDL_x11dyn.c	Tue Jan 30 18:08:34 2018 -0800
    37.3 @@ -172,14 +172,12 @@
    37.4  #include "SDL_x11sym.h"
    37.5  
    37.6  #define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname;
    37.7 -#define SDL_X11_SYM(a,fn,x,y,z) X11_##fn = (SDL_DYNX11FN_##fn) X11_GetSym(#fn,thismod);
    37.8 +#define SDL_X11_SYM(a,fn,x,y,z) *(void**)&X11_##fn = X11_GetSym(#fn,thismod);
    37.9  #include "SDL_x11sym.h"
   37.10  
   37.11  #ifdef X_HAVE_UTF8_STRING
   37.12 -        X11_XCreateIC = (SDL_DYNX11FN_XCreateIC)
   37.13 -                        X11_GetSym("XCreateIC", &SDL_X11_HAVE_UTF8);
   37.14 -        X11_XGetICValues = (SDL_DYNX11FN_XGetICValues)
   37.15 -                        X11_GetSym("XGetICValues", &SDL_X11_HAVE_UTF8);
   37.16 +        *(void**)&X11_XCreateIC = X11_GetSym("XCreateIC", &SDL_X11_HAVE_UTF8);
   37.17 +        *(void**)&X11_XGetICValues = X11_GetSym("XGetICValues", &SDL_X11_HAVE_UTF8);
   37.18  #endif
   37.19  
   37.20          if (SDL_X11_HAVE_BASEXLIB) {
    38.1 --- a/src/video/x11/SDL_x11opengl.c	Tue Jan 30 16:53:24 2018 -0800
    38.2 +++ b/src/video/x11/SDL_x11opengl.c	Tue Jan 30 18:08:34 2018 -0800
    38.3 @@ -189,29 +189,21 @@
    38.4  
    38.5      /* Load function pointers */
    38.6      handle = _this->gl_config.dll_handle;
    38.7 -    _this->gl_data->glXQueryExtension =
    38.8 -        (Bool (*)(Display *, int *, int *))
    38.9 +    *(void**)&_this->gl_data->glXQueryExtension =
   38.10              GL_LoadFunction(handle, "glXQueryExtension");
   38.11 -    _this->gl_data->glXGetProcAddress =
   38.12 -        (void *(*)(const GLubyte *))
   38.13 +    *(void**)&_this->gl_data->glXGetProcAddress =
   38.14              GL_LoadFunction(handle, "glXGetProcAddressARB");
   38.15 -    _this->gl_data->glXChooseVisual =
   38.16 -        (XVisualInfo * (*)(Display *, int, int *))
   38.17 +    *(void**)&_this->gl_data->glXChooseVisual =
   38.18              X11_GL_GetProcAddress(_this, "glXChooseVisual");
   38.19 -    _this->gl_data->glXCreateContext =
   38.20 -        (GLXContext(*)(Display *, XVisualInfo *, GLXContext, int))
   38.21 +    *(void**)&_this->gl_data->glXCreateContext =
   38.22              X11_GL_GetProcAddress(_this, "glXCreateContext");
   38.23 -    _this->gl_data->glXDestroyContext =
   38.24 -        (void (*)(Display *, GLXContext))
   38.25 +    *(void**)&_this->gl_data->glXDestroyContext =
   38.26              X11_GL_GetProcAddress(_this, "glXDestroyContext");
   38.27 -    _this->gl_data->glXMakeCurrent =
   38.28 -        (int (*)(Display *, GLXDrawable, GLXContext))
   38.29 +    *(void**)&_this->gl_data->glXMakeCurrent =
   38.30              X11_GL_GetProcAddress(_this, "glXMakeCurrent");
   38.31 -    _this->gl_data->glXSwapBuffers =
   38.32 -        (void (*)(Display *, GLXDrawable))
   38.33 +    *(void**)&_this->gl_data->glXSwapBuffers =
   38.34              X11_GL_GetProcAddress(_this, "glXSwapBuffers");
   38.35 -    _this->gl_data->glXQueryDrawable =
   38.36 -        (void (*)(Display*,GLXDrawable,int,unsigned int*))
   38.37 +    *(void**)&_this->gl_data->glXQueryDrawable =
   38.38              X11_GL_GetProcAddress(_this, "glXQueryDrawable");
   38.39  
   38.40      if (!_this->gl_data->glXQueryExtension ||
   38.41 @@ -341,13 +333,11 @@
   38.42  
   38.43      vinfo = X11_GL_GetVisual(_this, display, screen);
   38.44      if (vinfo) {
   38.45 -        GLXContext (*glXGetCurrentContextFunc) (void) =
   38.46 -            (GLXContext(*)(void))
   38.47 -                X11_GL_GetProcAddress(_this, "glXGetCurrentContext");
   38.48 +        GLXContext (*glXGetCurrentContextFunc)(void);
   38.49 +        GLXDrawable (*glXGetCurrentDrawableFunc)(void);
   38.50  
   38.51 -        GLXDrawable (*glXGetCurrentDrawableFunc) (void) =
   38.52 -            (GLXDrawable(*)(void))
   38.53 -                X11_GL_GetProcAddress(_this, "glXGetCurrentDrawable");
   38.54 +        *(void**)&glXGetCurrentContextFunc = X11_GL_GetProcAddress(_this, "glXGetCurrentContext");
   38.55 +        *(void**)&glXGetCurrentDrawableFunc = X11_GL_GetProcAddress(_this, "glXGetCurrentDrawable");
   38.56  
   38.57          if (glXGetCurrentContextFunc && glXGetCurrentDrawableFunc) {
   38.58              XSetWindowAttributes xattr;
   38.59 @@ -373,9 +363,7 @@
   38.60          X11_XFree(vinfo);
   38.61      }
   38.62  
   38.63 -    glXQueryExtensionsStringFunc =
   38.64 -        (const char *(*)(Display *, int)) X11_GL_GetProcAddress(_this,
   38.65 -                                                                "glXQueryExtensionsString");
   38.66 +    *(void**)&glXQueryExtensionsStringFunc = X11_GL_GetProcAddress(_this, "glXQueryExtensionsString");
   38.67      if (glXQueryExtensionsStringFunc) {
   38.68          extensions = glXQueryExtensionsStringFunc(display, screen);
   38.69      } else {
   38.70 @@ -385,8 +373,7 @@
   38.71      /* Check for GLX_EXT_swap_control(_tear) */
   38.72      _this->gl_data->HAS_GLX_EXT_swap_control_tear = SDL_FALSE;
   38.73      if (HasExtension("GLX_EXT_swap_control", extensions)) {
   38.74 -        _this->gl_data->glXSwapIntervalEXT =
   38.75 -            (void (*)(Display*,GLXDrawable,int))
   38.76 +        *(void**)&_this->gl_data->glXSwapIntervalEXT =
   38.77                  X11_GL_GetProcAddress(_this, "glXSwapIntervalEXT");
   38.78          if (HasExtension("GLX_EXT_swap_control_tear", extensions)) {
   38.79              _this->gl_data->HAS_GLX_EXT_swap_control_tear = SDL_TRUE;
   38.80 @@ -395,26 +382,23 @@
   38.81  
   38.82      /* Check for GLX_MESA_swap_control */
   38.83      if (HasExtension("GLX_MESA_swap_control", extensions)) {
   38.84 -        _this->gl_data->glXSwapIntervalMESA =
   38.85 -            (int(*)(int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalMESA");
   38.86 -        _this->gl_data->glXGetSwapIntervalMESA =
   38.87 -            (int(*)(void)) X11_GL_GetProcAddress(_this,
   38.88 -                                                   "glXGetSwapIntervalMESA");
   38.89 +        *(void**)&_this->gl_data->glXSwapIntervalMESA =
   38.90 +                X11_GL_GetProcAddress(_this, "glXSwapIntervalMESA");
   38.91 +        *(void**)&_this->gl_data->glXGetSwapIntervalMESA =
   38.92 +                X11_GL_GetProcAddress(_this, "glXGetSwapIntervalMESA");
   38.93      }
   38.94  
   38.95      /* Check for GLX_SGI_swap_control */
   38.96      if (HasExtension("GLX_SGI_swap_control", extensions)) {
   38.97 -        _this->gl_data->glXSwapIntervalSGI =
   38.98 -            (int (*)(int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalSGI");
   38.99 +        *(void**)&_this->gl_data->glXSwapIntervalSGI =
  38.100 +                 X11_GL_GetProcAddress(_this, "glXSwapIntervalSGI");
  38.101      }
  38.102  
  38.103      /* Check for GLX_ARB_create_context */
  38.104      if (HasExtension("GLX_ARB_create_context", extensions)) {
  38.105 -        _this->gl_data->glXCreateContextAttribsARB =
  38.106 -            (GLXContext (*)(Display*,GLXFBConfig,GLXContext,Bool,const int *))
  38.107 +        *(void**)&_this->gl_data->glXCreateContextAttribsARB =
  38.108                  X11_GL_GetProcAddress(_this, "glXCreateContextAttribsARB");
  38.109 -        _this->gl_data->glXChooseFBConfig =
  38.110 -            (GLXFBConfig *(*)(Display *, int, const int *, int *))
  38.111 +        *(void**)&_this->gl_data->glXChooseFBConfig =
  38.112                  X11_GL_GetProcAddress(_this, "glXChooseFBConfig");
  38.113      }
  38.114  
    39.1 --- a/src/video/x11/SDL_x11vulkan.c	Tue Jan 30 16:53:24 2018 -0800
    39.2 +++ b/src/video/x11/SDL_x11vulkan.c	Tue Jan 30 18:08:34 2018 -0800
    39.3 @@ -57,14 +57,14 @@
    39.4      if(!_this->vulkan_config.loader_handle)
    39.5          return -1;
    39.6      SDL_strlcpy(_this->vulkan_config.loader_path, path, SDL_arraysize(_this->vulkan_config.loader_path));
    39.7 -    vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
    39.8 +    *(void**)&vkGetInstanceProcAddr = SDL_LoadFunction(
    39.9          _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
   39.10      if(!vkGetInstanceProcAddr)
   39.11          goto fail;
   39.12 -    _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
   39.13 +    _this->vulkan_config.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
   39.14      _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
   39.15 -        (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
   39.16 -            VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   39.17 +        (PFN_vkEnumerateInstanceExtensionProperties)
   39.18 +        _this->vulkan_config.vkGetInstanceProcAddr(VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   39.19      if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties)
   39.20          goto fail;
   39.21      extensions = SDL_Vulkan_CreateInstanceExtensionsList(
   39.22 @@ -108,7 +108,7 @@
   39.23          videoData->vulkan_xlib_xcb_library = SDL_LoadObject(libX11XCBLibraryName);
   39.24          if(!videoData->vulkan_xlib_xcb_library)
   39.25              goto fail;
   39.26 -        videoData->vulkan_XGetXCBConnection =
   39.27 +        *(void**)&videoData->vulkan_XGetXCBConnection =
   39.28              SDL_LoadFunction(videoData->vulkan_xlib_xcb_library, "XGetXCBConnection");
   39.29          if(!videoData->vulkan_XGetXCBConnection)
   39.30          {
   39.31 @@ -184,7 +184,7 @@
   39.32          PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR =
   39.33              (PFN_vkCreateXcbSurfaceKHR)vkGetInstanceProcAddr((VkInstance)instance,
   39.34                                                               "vkCreateXcbSurfaceKHR");
   39.35 -        VkXcbSurfaceCreateInfoKHR createInfo = {};
   39.36 +        VkXcbSurfaceCreateInfoKHR createInfo;
   39.37          VkResult result;
   39.38          if(!vkCreateXcbSurfaceKHR)
   39.39          {
   39.40 @@ -192,6 +192,7 @@
   39.41                           " extension is not enabled in the Vulkan instance.");
   39.42              return SDL_FALSE;
   39.43          }
   39.44 +        SDL_zero(createInfo);
   39.45          createInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR;
   39.46          createInfo.connection = videoData->vulkan_XGetXCBConnection(videoData->display);
   39.47          if(!createInfo.connection)
   39.48 @@ -214,7 +215,7 @@
   39.49          PFN_vkCreateXlibSurfaceKHR vkCreateXlibSurfaceKHR =
   39.50              (PFN_vkCreateXlibSurfaceKHR)vkGetInstanceProcAddr((VkInstance)instance,
   39.51                                                                "vkCreateXlibSurfaceKHR");
   39.52 -        VkXlibSurfaceCreateInfoKHR createInfo = {};
   39.53 +        VkXlibSurfaceCreateInfoKHR createInfo;
   39.54          VkResult result;
   39.55          if(!vkCreateXlibSurfaceKHR)
   39.56          {
   39.57 @@ -222,6 +223,7 @@
   39.58                           " extension is not enabled in the Vulkan instance.");
   39.59              return SDL_FALSE;
   39.60          }
   39.61 +        SDL_zero(createInfo);
   39.62          createInfo.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR;
   39.63          createInfo.dpy = videoData->display;
   39.64          createInfo.window = (xcb_window_t)windowData->xwindow;
    40.1 --- a/src/video/yuv2rgb/yuv_rgb_sse_func.h	Tue Jan 30 16:53:24 2018 -0800
    40.2 +++ b/src/video/yuv2rgb/yuv_rgb_sse_func.h	Tue Jan 30 18:08:34 2018 -0800
    40.3 @@ -52,7 +52,7 @@
    40.4  { \
    40.5  	__m128i red_mask, tmp1, tmp2, tmp3, tmp4; \
    40.6  \
    40.7 -	red_mask = _mm_set1_epi16(0xF800); \
    40.8 +	red_mask = _mm_set1_epi16((short)0xF800); \
    40.9  	RGB1 = _mm_and_si128(_mm_unpacklo_epi8(_mm_setzero_si128(), R1), red_mask); \
   40.10  	RGB2 = _mm_and_si128(_mm_unpackhi_epi8(_mm_setzero_si128(), R1), red_mask); \
   40.11  	RGB3 = _mm_and_si128(_mm_unpacklo_epi8(_mm_setzero_si128(), R2), red_mask); \
   40.12 @@ -145,7 +145,7 @@
   40.13  #define PACK_PIXEL \
   40.14  	__m128i rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8; \
   40.15  	__m128i rgb_9, rgb_10, rgb_11, rgb_12, rgb_13, rgb_14, rgb_15, rgb_16; \
   40.16 -	__m128i a = _mm_set1_epi8( 0xFF ); \
   40.17 +	__m128i a = _mm_set1_epi8((char)0xFF); \
   40.18  	\
   40.19  	PACK_RGBA_32(r_8_11, r_8_12, g_8_11, g_8_12, b_8_11, b_8_12, a, a, rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8) \
   40.20  	\
   40.21 @@ -156,7 +156,7 @@
   40.22  #define PACK_PIXEL \
   40.23  	__m128i rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8; \
   40.24  	__m128i rgb_9, rgb_10, rgb_11, rgb_12, rgb_13, rgb_14, rgb_15, rgb_16; \
   40.25 -	__m128i a = _mm_set1_epi8( 0xFF ); \
   40.26 +	__m128i a = _mm_set1_epi8((char)0xFF); \
   40.27  	\
   40.28  	PACK_RGBA_32(b_8_11, b_8_12, g_8_11, g_8_12, r_8_11, r_8_12, a, a, rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8) \
   40.29  	\
   40.30 @@ -167,7 +167,7 @@
   40.31  #define PACK_PIXEL \
   40.32  	__m128i rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8; \
   40.33  	__m128i rgb_9, rgb_10, rgb_11, rgb_12, rgb_13, rgb_14, rgb_15, rgb_16; \
   40.34 -	__m128i a = _mm_set1_epi8( 0xFF ); \
   40.35 +	__m128i a = _mm_set1_epi8((char)0xFF); \
   40.36  	\
   40.37  	PACK_RGBA_32(a, a, r_8_11, r_8_12, g_8_11, g_8_12, b_8_11, b_8_12, rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8) \
   40.38  	\
   40.39 @@ -178,7 +178,7 @@
   40.40  #define PACK_PIXEL \
   40.41  	__m128i rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8; \
   40.42  	__m128i rgb_9, rgb_10, rgb_11, rgb_12, rgb_13, rgb_14, rgb_15, rgb_16; \
   40.43 -	__m128i a = _mm_set1_epi8( 0xFF ); \
   40.44 +	__m128i a = _mm_set1_epi8((char)0xFF); \
   40.45  	\
   40.46  	PACK_RGBA_32(a, a, b_8_11, b_8_12, g_8_11, g_8_12, r_8_11, r_8_12, rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8) \
   40.47  	\