revert the recent typecast assignment changes (see bug #4079)
authorsezero <sezero@users.sourceforge.net>
Mon, 12 Feb 2018 17:00:00 +0300
changeset 11872e917e911dab6
parent 11871 c207c3ab46ee
child 11873 96157e099383
revert the recent typecast assignment changes (see bug #4079)

also change the void* typedefs for the two vulkan function
pointers added in vulkan_internal.h into generic function
pointer typedefs.
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/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_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_mirvulkan.c
src/video/uikit/SDL_uikitvulkan.m
src/video/wayland/SDL_waylanddyn.c
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
     1.1 --- a/src/audio/SDL_audio.c	Tue Feb 13 13:25:59 2018 -0800
     1.2 +++ b/src/audio/SDL_audio.c	Mon Feb 12 17:00:00 2018 +0300
     1.3 @@ -151,11 +151,11 @@
     1.4          return SDL_FALSE;
     1.5      }
     1.6  
     1.7 -    *(void **)&SRC_src_new = SDL_LoadFunction(SRC_lib, "src_new");
     1.8 -    *(void **)&SRC_src_process = SDL_LoadFunction(SRC_lib, "src_process");
     1.9 -    *(void **)&SRC_src_reset = SDL_LoadFunction(SRC_lib, "src_reset");
    1.10 -    *(void **)&SRC_src_delete = SDL_LoadFunction(SRC_lib, "src_delete");
    1.11 -    *(void **)&SRC_src_strerror = SDL_LoadFunction(SRC_lib, "src_strerror");
    1.12 +    SRC_src_new = (SRC_STATE* (*)(int converter_type, int channels, int *error))SDL_LoadFunction(SRC_lib, "src_new");
    1.13 +    SRC_src_process = (int (*)(SRC_STATE *state, SRC_DATA *data))SDL_LoadFunction(SRC_lib, "src_process");
    1.14 +    SRC_src_reset = (int(*)(SRC_STATE *state))SDL_LoadFunction(SRC_lib, "src_reset");
    1.15 +    SRC_src_delete = (SRC_STATE* (*)(SRC_STATE *state))SDL_LoadFunction(SRC_lib, "src_delete");
    1.16 +    SRC_src_strerror = (const char* (*)(int error))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 Feb 13 13:25:59 2018 -0800
     2.2 +++ b/src/audio/directsound/SDL_directsound.c	Mon Feb 12 17:00:00 2018 +0300
     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 -            *(void**)&p##f = SDL_LoadFunction(DSoundDLL, #f); \
     2.8 +            p##f = (fn##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 Feb 13 13:25:59 2018 -0800
     3.2 +++ b/src/audio/wasapi/SDL_wasapi_win32.c	Mon Feb 12 17:00:00 2018 +0300
     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 -        *(void **)&pAvSetMmThreadCharacteristicsW = GetProcAddress(libavrt, "AvSetMmThreadCharacteristicsW");
     3.8 -        *(void **)&pAvRevertMmThreadCharacteristics = GetProcAddress(libavrt, "AvRevertMmThreadCharacteristics");
     3.9 +        pAvSetMmThreadCharacteristicsW = (pfnAvSetMmThreadCharacteristicsW) GetProcAddress(libavrt, "AvSetMmThreadCharacteristicsW");
    3.10 +        pAvRevertMmThreadCharacteristics = (pfnAvRevertMmThreadCharacteristics) GetProcAddress(libavrt, "AvRevertMmThreadCharacteristics");
    3.11      }
    3.12  
    3.13      return 0;
     4.1 --- a/src/core/linux/SDL_dbus.c	Tue Feb 13 13:25:59 2018 -0800
     4.2 +++ b/src/core/linux/SDL_dbus.c	Mon Feb 12 17:00:00 2018 +0300
     4.3 @@ -33,7 +33,7 @@
     4.4  LoadDBUSSyms(void)
     4.5  {
     4.6      #define SDL_DBUS_SYM2(x, y) \
     4.7 -        if (!(*(void**)&dbus.x = SDL_LoadFunction(dbus_handle, #y))) return -1
     4.8 +        if (!(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 Feb 13 13:25:59 2018 -0800
     5.2 +++ b/src/core/windows/SDL_xinput.c	Mon Feb 12 17:00:00 2018 +0300
     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 -    *(void**)&SDL_XInputGetState = GetProcAddress((HMODULE)s_pXInputDLL, (LPCSTR)100);
     5.8 +    SDL_XInputGetState = (XInputGetState_t)GetProcAddress((HMODULE)s_pXInputDLL, (LPCSTR)100);
     5.9      if (!SDL_XInputGetState) {
    5.10 -        *(void**)&SDL_XInputGetState = GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetState");
    5.11 +        SDL_XInputGetState = (XInputGetState_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetState");
    5.12      }
    5.13 -    *(void**)&SDL_XInputSetState = GetProcAddress((HMODULE)s_pXInputDLL, "XInputSetState");
    5.14 -    *(void**)&SDL_XInputGetCapabilities = GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetCapabilities");
    5.15 -    *(void**)&SDL_XInputGetBatteryInformation = GetProcAddress( (HMODULE)s_pXInputDLL, "XInputGetBatteryInformation" );
    5.16 +    SDL_XInputSetState = (XInputSetState_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputSetState");
    5.17 +    SDL_XInputGetCapabilities = (XInputGetCapabilities_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetCapabilities");
    5.18 +    SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)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 Feb 13 13:25:59 2018 -0800
     6.2 +++ b/src/dynapi/SDL_dynapi.c	Mon Feb 12 17:00:00 2018 +0300
     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 -        *(void **)&entry = get_sdlapi_entry(libname, "SDL_DYNAPI_entry");
     6.8 +        entry = (SDL_DYNAPI_ENTRYFN) 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/filesystem/windows/SDL_sysfilesystem.c	Tue Feb 13 13:25:59 2018 -0800
     7.2 +++ b/src/filesystem/windows/SDL_sysfilesystem.c	Mon Feb 12 17:00:00 2018 +0300
     7.3 @@ -50,7 +50,7 @@
     7.4          return NULL;
     7.5      }
     7.6  
     7.7 -    *(void**)&pGetModuleFileNameExW = GetProcAddress(psapi, "GetModuleFileNameExW");
     7.8 +    pGetModuleFileNameExW = (GetModuleFileNameExW_t)GetProcAddress(psapi, "GetModuleFileNameExW");
     7.9      if (!pGetModuleFileNameExW) {
    7.10          WIN_SetError("Couldn't find GetModuleFileNameExW");
    7.11          FreeLibrary(psapi);
     8.1 --- a/src/render/direct3d11/SDL_render_d3d11.c	Tue Feb 13 13:25:59 2018 -0800
     8.2 +++ b/src/render/direct3d11/SDL_render_d3d11.c	Mon Feb 12 17:00:00 2018 +0300
     8.3 @@ -568,7 +568,7 @@
     8.4          goto done;
     8.5      }
     8.6  
     8.7 -    *(void**)&CreateDXGIFactoryFunc = SDL_LoadFunction(data->hDXGIMod, "CreateDXGIFactory");
     8.8 +    CreateDXGIFactoryFunc = (PFN_CREATE_DXGI_FACTORY)SDL_LoadFunction(data->hDXGIMod, "CreateDXGIFactory");
     8.9      if (!CreateDXGIFactoryFunc) {
    8.10          result = E_FAIL;
    8.11          goto done;
    8.12 @@ -580,7 +580,7 @@
    8.13          goto done;
    8.14      }
    8.15  
    8.16 -    *(void**)D3D11CreateDeviceFunc = SDL_LoadFunction(data->hD3D11Mod, "D3D11CreateDevice");
    8.17 +    D3D11CreateDeviceFunc = (PFN_D3D11_CREATE_DEVICE)SDL_LoadFunction(data->hD3D11Mod, "D3D11CreateDevice");
    8.18      if (!D3D11CreateDeviceFunc) {
    8.19          result = E_FAIL;
    8.20          goto done;
     9.1 --- a/src/render/opengl/SDL_render_gl.c	Tue Feb 13 13:25:59 2018 -0800
     9.2 +++ b/src/render/opengl/SDL_render_gl.c	Mon Feb 12 17:00:00 2018 +0300
     9.3 @@ -272,7 +272,7 @@
     9.4  #else
     9.5  #define SDL_PROC(ret,func,params) \
     9.6      do { \
     9.7 -        *(void **)&data->func = SDL_GL_GetProcAddress(#func); \
     9.8 +        data->func = SDL_GL_GetProcAddress(#func); \
     9.9          if ( ! data->func ) { \
    9.10              return SDL_SetError("Couldn't load GL function %s: %s", #func, SDL_GetError()); \
    9.11          } \
    9.12 @@ -490,9 +490,7 @@
    9.13          data->debug_enabled = SDL_TRUE;
    9.14      }
    9.15      if (data->debug_enabled && SDL_GL_ExtensionSupported("GL_ARB_debug_output")) {
    9.16 -        PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc;
    9.17 -       
    9.18 -        *(void **)&glDebugMessageCallbackARBFunc = SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
    9.19 +        PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
    9.20  
    9.21          data->GL_ARB_debug_output_supported = SDL_TRUE;
    9.22          data->glGetPointerv(GL_DEBUG_CALLBACK_FUNCTION_ARB, (GLvoid **)(char *)&data->next_error_callback);
    9.23 @@ -521,7 +519,7 @@
    9.24  
    9.25      /* Check for multitexture support */
    9.26      if (SDL_GL_ExtensionSupported("GL_ARB_multitexture")) {
    9.27 -        *(void **)&data->glActiveTextureARB = SDL_GL_GetProcAddress("glActiveTextureARB");
    9.28 +        data->glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) SDL_GL_GetProcAddress("glActiveTextureARB");
    9.29          if (data->glActiveTextureARB) {
    9.30              data->GL_ARB_multitexture_supported = SDL_TRUE;
    9.31              data->glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &data->num_texture_units);
    9.32 @@ -549,11 +547,16 @@
    9.33  
    9.34      if (SDL_GL_ExtensionSupported("GL_EXT_framebuffer_object")) {
    9.35          data->GL_EXT_framebuffer_object_supported = SDL_TRUE;
    9.36 -        *(void**)&data->glGenFramebuffersEXT = SDL_GL_GetProcAddress("glGenFramebuffersEXT");
    9.37 -        *(void**)&data->glDeleteFramebuffersEXT = SDL_GL_GetProcAddress("glDeleteFramebuffersEXT");
    9.38 -        *(void**)&data->glFramebufferTexture2DEXT = SDL_GL_GetProcAddress("glFramebufferTexture2DEXT");
    9.39 -        *(void**)&data->glBindFramebufferEXT = SDL_GL_GetProcAddress("glBindFramebufferEXT");
    9.40 -        *(void**)&data->glCheckFramebufferStatusEXT = SDL_GL_GetProcAddress("glCheckFramebufferStatusEXT");
    9.41 +        data->glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)
    9.42 +            SDL_GL_GetProcAddress("glGenFramebuffersEXT");
    9.43 +        data->glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)
    9.44 +            SDL_GL_GetProcAddress("glDeleteFramebuffersEXT");
    9.45 +        data->glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)
    9.46 +            SDL_GL_GetProcAddress("glFramebufferTexture2DEXT");
    9.47 +        data->glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)
    9.48 +            SDL_GL_GetProcAddress("glBindFramebufferEXT");
    9.49 +        data->glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)
    9.50 +            SDL_GL_GetProcAddress("glCheckFramebufferStatusEXT");
    9.51          renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE;
    9.52      }
    9.53      data->framebuffers = NULL;
    9.54 @@ -1610,9 +1613,7 @@
    9.55  
    9.56          GL_ClearErrors(renderer);
    9.57          if (data->GL_ARB_debug_output_supported) {
    9.58 -            PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc;
    9.59 -            
    9.60 -            *(void **)&glDebugMessageCallbackARBFunc = SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
    9.61 +            PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
    9.62  
    9.63              /* Uh oh, we don't have a safe way of removing ourselves from the callback chain, if it changed after we set our callback. */
    9.64              /* For now, just always replace the callback with the original one */
    10.1 --- a/src/render/opengl/SDL_shaders_gl.c	Tue Feb 13 13:25:59 2018 -0800
    10.2 +++ b/src/render/opengl/SDL_shaders_gl.c	Mon Feb 12 17:00:00 2018 +0300
    10.3 @@ -453,20 +453,20 @@
    10.4          SDL_GL_ExtensionSupported("GL_ARB_shading_language_100") &&
    10.5          SDL_GL_ExtensionSupported("GL_ARB_vertex_shader") &&
    10.6          SDL_GL_ExtensionSupported("GL_ARB_fragment_shader")) {
    10.7 -        *(void**)&ctx->glGetError = SDL_GL_GetProcAddress("glGetError");
    10.8 -        *(void **)&ctx->glAttachObjectARB = SDL_GL_GetProcAddress("glAttachObjectARB");
    10.9 -        *(void **)&ctx->glCompileShaderARB = SDL_GL_GetProcAddress("glCompileShaderARB");
   10.10 -        *(void **)&ctx->glCreateProgramObjectARB = SDL_GL_GetProcAddress("glCreateProgramObjectARB");
   10.11 -        *(void **)&ctx->glCreateShaderObjectARB = SDL_GL_GetProcAddress("glCreateShaderObjectARB");
   10.12 -        *(void **)&ctx->glDeleteObjectARB = SDL_GL_GetProcAddress("glDeleteObjectARB");
   10.13 -        *(void **)&ctx->glGetInfoLogARB = SDL_GL_GetProcAddress("glGetInfoLogARB");
   10.14 -        *(void **)&ctx->glGetObjectParameterivARB = SDL_GL_GetProcAddress("glGetObjectParameterivARB");
   10.15 -        *(void **)&ctx->glGetUniformLocationARB = SDL_GL_GetProcAddress("glGetUniformLocationARB");
   10.16 -        *(void **)&ctx->glLinkProgramARB = SDL_GL_GetProcAddress("glLinkProgramARB");
   10.17 -        *(void **)&ctx->glShaderSourceARB = SDL_GL_GetProcAddress("glShaderSourceARB");
   10.18 -        *(void **)&ctx->glUniform1iARB = SDL_GL_GetProcAddress("glUniform1iARB");
   10.19 -        *(void **)&ctx->glUniform1fARB = SDL_GL_GetProcAddress("glUniform1fARB");
   10.20 -        *(void **)&ctx->glUseProgramObjectARB = SDL_GL_GetProcAddress("glUseProgramObjectARB");
   10.21 +        ctx->glGetError = (GLenum (*)(void)) SDL_GL_GetProcAddress("glGetError");
   10.22 +        ctx->glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) SDL_GL_GetProcAddress("glAttachObjectARB");
   10.23 +        ctx->glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) SDL_GL_GetProcAddress("glCompileShaderARB");
   10.24 +        ctx->glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glCreateProgramObjectARB");
   10.25 +        ctx->glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) SDL_GL_GetProcAddress("glCreateShaderObjectARB");
   10.26 +        ctx->glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) SDL_GL_GetProcAddress("glDeleteObjectARB");
   10.27 +        ctx->glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC) SDL_GL_GetProcAddress("glGetInfoLogARB");
   10.28 +        ctx->glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) SDL_GL_GetProcAddress("glGetObjectParameterivARB");
   10.29 +        ctx->glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) SDL_GL_GetProcAddress("glGetUniformLocationARB");
   10.30 +        ctx->glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) SDL_GL_GetProcAddress("glLinkProgramARB");
   10.31 +        ctx->glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) SDL_GL_GetProcAddress("glShaderSourceARB");
   10.32 +        ctx->glUniform1iARB = (PFNGLUNIFORM1IARBPROC) SDL_GL_GetProcAddress("glUniform1iARB");
   10.33 +        ctx->glUniform1fARB = (PFNGLUNIFORM1FARBPROC) SDL_GL_GetProcAddress("glUniform1fARB");
   10.34 +        ctx->glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glUseProgramObjectARB");
   10.35          if (ctx->glGetError &&
   10.36              ctx->glAttachObjectARB &&
   10.37              ctx->glCompileShaderARB &&
    11.1 --- a/src/render/opengles/SDL_render_gles.c	Tue Feb 13 13:25:59 2018 -0800
    11.2 +++ b/src/render/opengles/SDL_render_gles.c	Mon Feb 12 17:00:00 2018 +0300
    11.3 @@ -198,14 +198,14 @@
    11.4  #else
    11.5  #define SDL_PROC(ret,func,params) \
    11.6      do { \
    11.7 -        *(void**)&data->func = SDL_GL_GetProcAddress(#func); \
    11.8 +        data->func = SDL_GL_GetProcAddress(#func); \
    11.9          if ( ! data->func ) { \
   11.10              return SDL_SetError("Couldn't load GLES function %s: %s", #func, SDL_GetError()); \
   11.11          } \
   11.12      } while ( 0 );
   11.13  #define SDL_PROC_OES(ret,func,params) \
   11.14      do { \
   11.15 -        *(void**)&data->func = SDL_GL_GetProcAddress(#func); \
   11.16 +        data->func = SDL_GL_GetProcAddress(#func); \
   11.17      } while ( 0 );    
   11.18  #endif /* __SDL_NOGETPROCADDR__ */
   11.19  
    12.1 --- a/src/render/opengles2/SDL_render_gles2.c	Tue Feb 13 13:25:59 2018 -0800
    12.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Mon Feb 12 17:00:00 2018 +0300
    12.3 @@ -290,11 +290,11 @@
    12.4  #endif
    12.5  
    12.6  #if defined __SDL_NOGETPROCADDR__
    12.7 -#define SDL_PROC(ret,func,params) *(void**)&data->func=func;
    12.8 +#define SDL_PROC(ret,func,params) data->func=func;
    12.9  #else
   12.10  #define SDL_PROC(ret,func,params) \
   12.11      do { \
   12.12 -        *(void **)&data->func = SDL_GL_GetProcAddress(#func); \
   12.13 +        data->func = SDL_GL_GetProcAddress(#func); \
   12.14          if ( ! data->func ) { \
   12.15              return SDL_SetError("Couldn't load GLES2 function %s: %s", #func, SDL_GetError()); \
   12.16          } \
    13.1 --- a/src/thread/pthread/SDL_systhread.c	Tue Feb 13 13:25:59 2018 -0800
    13.2 +++ b/src/thread/pthread/SDL_systhread.c	Mon Feb 12 17:00:00 2018 +0300
    13.3 @@ -91,7 +91,11 @@
    13.4      #if defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__)
    13.5      if (!checked_setname) {
    13.6          void *fn = dlsym(RTLD_DEFAULT, "pthread_setname_np");
    13.7 -        *(void **)&ppthread_setname_np = fn;
    13.8 +        #if defined(__MACOSX__) || defined(__IPHONEOS__)
    13.9 +        ppthread_setname_np = (int(*)(const char*)) fn;
   13.10 +        #elif defined(__LINUX__)
   13.11 +        ppthread_setname_np = (int(*)(pthread_t, const char*)) fn;
   13.12 +        #endif
   13.13          checked_setname = SDL_TRUE;
   13.14      }
   13.15      #endif
    14.1 --- a/src/thread/windows/SDL_systhread.c	Tue Feb 13 13:25:59 2018 -0800
    14.2 +++ b/src/thread/windows/SDL_systhread.c	Mon Feb 12 17:00:00 2018 +0300
    14.3 @@ -178,7 +178,7 @@
    14.4          if (!kernel32) {
    14.5              kernel32 = LoadLibraryW(L"kernel32.dll");
    14.6              if (kernel32) {
    14.7 -                *(void**)&pSetThreadDescription = GetProcAddress(kernel32, "SetThreadDescription");
    14.8 +                pSetThreadDescription = (pfnSetThreadDescription) GetProcAddress(kernel32, "SetThreadDescription");
    14.9              }
   14.10          }
   14.11  
    15.1 --- a/src/video/SDL_blit.c	Tue Feb 13 13:25:59 2018 -0800
    15.2 +++ b/src/video/SDL_blit.c	Mon Feb 12 17:00:00 2018 +0300
    15.3 @@ -82,7 +82,7 @@
    15.4          info->dst_pitch = dst->pitch;
    15.5          info->dst_skip =
    15.6              info->dst_pitch - info->dst_w * info->dst_fmt->BytesPerPixel;
    15.7 -        *(void**)&RunBlit = src->map->data;
    15.8 +        RunBlit = (SDL_BlitFunc) src->map->data;
    15.9  
   15.10          /* Run the actual software blit */
   15.11          RunBlit(info);
   15.12 @@ -282,7 +282,7 @@
   15.13              blit = SDL_Blit_Slow;
   15.14          }
   15.15      }
   15.16 -    *(SDL_BlitFunc *)&map->data = blit;
   15.17 +    map->data = blit;
   15.18  
   15.19      /* Make sure we have a blit function */
   15.20      if (blit == NULL) {
    16.1 --- a/src/video/SDL_egl.c	Tue Feb 13 13:25:59 2018 -0800
    16.2 +++ b/src/video/SDL_egl.c	Mon Feb 12 17:00:00 2018 +0300
    16.3 @@ -86,7 +86,7 @@
    16.4  _this->egl_data->NAME = (void *)NAME;
    16.5  #else
    16.6  #define LOAD_FUNC(NAME) \
    16.7 -*(void**)&_this->egl_data->NAME = SDL_LoadFunction(_this->egl_data->dll_handle, #NAME); \
    16.8 +_this->egl_data->NAME = SDL_LoadFunction(_this->egl_data->dll_handle, #NAME); \
    16.9  if (!_this->egl_data->NAME) \
   16.10  { \
   16.11      return SDL_SetError("Could not retrieve EGL function " #NAME); \
   16.12 @@ -417,7 +417,7 @@
   16.13              _this->egl_data->egl_display = _this->egl_data->eglGetPlatformDisplay(platform, (void *)(size_t)native_display, NULL);
   16.14          } else {
   16.15              if (SDL_EGL_HasExtension(_this, SDL_EGL_CLIENT_EXTENSION, "EGL_EXT_platform_base")) {
   16.16 -                *(void**)&_this->egl_data->eglGetPlatformDisplayEXT = SDL_EGL_GetProcAddress(_this, "eglGetPlatformDisplayEXT");
   16.17 +                _this->egl_data->eglGetPlatformDisplayEXT = SDL_EGL_GetProcAddress(_this, "eglGetPlatformDisplayEXT");
   16.18                  if (_this->egl_data->eglGetPlatformDisplayEXT) {
   16.19                      _this->egl_data->egl_display = _this->egl_data->eglGetPlatformDisplayEXT(platform, (void *)(size_t)native_display, NULL);
   16.20                  }
    17.1 --- a/src/video/SDL_video.c	Tue Feb 13 13:25:59 2018 -0800
    17.2 +++ b/src/video/SDL_video.c	Mon Feb 12 17:00:00 2018 +0300
    17.3 @@ -224,7 +224,7 @@
    17.4                  const GLubyte *(APIENTRY * glGetStringFunc) (GLenum);
    17.5                  const char *vendor = NULL;
    17.6  
    17.7 -                *(void**)&glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
    17.8 +                glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
    17.9                  if (glGetStringFunc) {
   17.10                      vendor = (const char *) glGetStringFunc(GL_VENDOR);
   17.11                  }
   17.12 @@ -2870,7 +2870,7 @@
   17.13  
   17.14      /* Lookup the available extensions */
   17.15  
   17.16 -    *(void**)&glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
   17.17 +    glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
   17.18      if (!glGetStringFunc) {
   17.19          return SDL_FALSE;
   17.20      }
   17.21 @@ -2881,8 +2881,8 @@
   17.22          GLint num_exts = 0;
   17.23          GLint i;
   17.24  
   17.25 -        *(void**)&glGetStringiFunc = SDL_GL_GetProcAddress("glGetStringi");
   17.26 -        *(void**)&glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
   17.27 +        glGetStringiFunc = SDL_GL_GetProcAddress("glGetStringi");
   17.28 +        glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
   17.29          if ((!glGetStringiFunc) || (!glGetIntegervFunc)) {
   17.30              return SDL_FALSE;
   17.31          }
   17.32 @@ -3342,13 +3342,13 @@
   17.33      }
   17.34  
   17.35  #if SDL_VIDEO_OPENGL
   17.36 -    *(void**)&glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
   17.37 +    glGetStringFunc = SDL_GL_GetProcAddress("glGetString");
   17.38      if (!glGetStringFunc) {
   17.39          return -1;
   17.40      }
   17.41  
   17.42      if (attachmentattrib && isAtLeastGL3((const char *) glGetStringFunc(GL_VERSION))) {
   17.43 -        *(void**)&glGetFramebufferAttachmentParameterivFunc = SDL_GL_GetProcAddress("glGetFramebufferAttachmentParameteriv");
   17.44 +        glGetFramebufferAttachmentParameterivFunc = SDL_GL_GetProcAddress("glGetFramebufferAttachmentParameteriv");
   17.45  
   17.46          if (glGetFramebufferAttachmentParameterivFunc) {
   17.47              glGetFramebufferAttachmentParameterivFunc(GL_FRAMEBUFFER, attachment, attachmentattrib, (GLint *) value);
   17.48 @@ -3359,7 +3359,7 @@
   17.49  #endif
   17.50      {
   17.51          void (APIENTRY *glGetIntegervFunc) (GLenum pname, GLint * params);
   17.52 -        *(void**)&glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
   17.53 +        glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv");
   17.54          if (glGetIntegervFunc) {
   17.55              glGetIntegervFunc(attrib, (GLint *) value);
   17.56          } else {
   17.57 @@ -3367,7 +3367,7 @@
   17.58          }
   17.59      }
   17.60  
   17.61 -    *(void**)&glGetErrorFunc = SDL_GL_GetProcAddress("glGetError");
   17.62 +    glGetErrorFunc = SDL_GL_GetProcAddress("glGetError");
   17.63      if (!glGetErrorFunc) {
   17.64          return -1;
   17.65      }
   17.66 @@ -3995,7 +3995,6 @@
   17.67  
   17.68  void *SDL_Vulkan_GetVkGetInstanceProcAddr(void)
   17.69  {
   17.70 -    void *func = NULL;
   17.71      if (!_this) {
   17.72          SDL_UninitializedVideo();
   17.73          return NULL;
   17.74 @@ -4004,8 +4003,7 @@
   17.75          SDL_SetError("No Vulkan loader has been loaded");
   17.76          return NULL;
   17.77      }
   17.78 -    *(PFN_vkGetInstanceProcAddr*)&func =  _this->vulkan_config.vkGetInstanceProcAddr;
   17.79 -    return func;
   17.80 +    return _this->vulkan_config.vkGetInstanceProcAddr;
   17.81  }
   17.82  
   17.83  void SDL_Vulkan_UnloadLibrary(void)
    18.1 --- a/src/video/SDL_vulkan_internal.h	Tue Feb 13 13:25:59 2018 -0800
    18.2 +++ b/src/video/SDL_vulkan_internal.h	Mon Feb 12 17:00:00 2018 +0300
    18.3 @@ -81,8 +81,8 @@
    18.4  /* No SDL Vulkan support, just include the header for typedefs */
    18.5  #include "SDL_vulkan.h"
    18.6  
    18.7 -typedef void* PFN_vkGetInstanceProcAddr;
    18.8 -typedef void* PFN_vkEnumerateInstanceExtensionProperties;
    18.9 +typedef void (*PFN_vkGetInstanceProcAddr) ();
   18.10 +typedef int  (*PFN_vkEnumerateInstanceExtensionProperties) ();
   18.11  
   18.12  #endif /* SDL_VIDEO_VULKAN */
   18.13  
    19.1 --- a/src/video/android/SDL_androidvulkan.c	Tue Feb 13 13:25:59 2018 -0800
    19.2 +++ b/src/video/android/SDL_androidvulkan.c	Mon Feb 12 17:00:00 2018 +0300
    19.3 @@ -56,13 +56,13 @@
    19.4          return -1;
    19.5      SDL_strlcpy(_this->vulkan_config.loader_path, path,
    19.6                  SDL_arraysize(_this->vulkan_config.loader_path));
    19.7 -    *(void**)&vkGetInstanceProcAddr = SDL_LoadFunction(
    19.8 +    vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
    19.9          _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
   19.10      if(!vkGetInstanceProcAddr)
   19.11          goto fail;
   19.12 -    _this->vulkan_config.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
   19.13 +    _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
   19.14      _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
   19.15 -        (PFN_vkEnumerateInstanceExtensionProperties)_this->vulkan_config.vkGetInstanceProcAddr(
   19.16 +        (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
   19.17              VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   19.18      if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties)
   19.19          goto fail;
    20.1 --- a/src/video/cocoa/SDL_cocoavulkan.m	Tue Feb 13 13:25:59 2018 -0800
    20.2 +++ b/src/video/cocoa/SDL_cocoavulkan.m	Mon Feb 12 17:00:00 2018 +0300
    20.3 @@ -83,7 +83,7 @@
    20.4          }
    20.5          SDL_strlcpy(_this->vulkan_config.loader_path, path,
    20.6                      SDL_arraysize(_this->vulkan_config.loader_path));
    20.7 -        *(void**)&vkGetInstanceProcAddr = SDL_LoadFunction(
    20.8 +        vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
    20.9              _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
   20.10      }
   20.11  
   20.12 @@ -95,9 +95,9 @@
   20.13          goto fail;
   20.14      }
   20.15  
   20.16 -    _this->vulkan_config.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
   20.17 +    _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
   20.18      _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
   20.19 -        (PFN_vkEnumerateInstanceExtensionProperties)_this->vulkan_config.vkGetInstanceProcAddr(
   20.20 +        (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
   20.21              VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   20.22      if (!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) {
   20.23          goto fail;
    21.1 --- a/src/video/mir/SDL_mirdyn.c	Tue Feb 13 13:25:59 2018 -0800
    21.2 +++ b/src/video/mir/SDL_mirdyn.c	Mon Feb 12 17:00:00 2018 +0300
    21.3 @@ -139,7 +139,7 @@
    21.4  #include "SDL_mirsym.h"
    21.5  
    21.6  #define SDL_MIR_MODULE(modname) thismod = &SDL_MIR_HAVE_##modname;
    21.7 -#define SDL_MIR_SYM(rc,fn,params) *(void**)&MIR_##fn = MIR_GetSym(#fn,thismod);
    21.8 +#define SDL_MIR_SYM(rc,fn,params) MIR_##fn = (SDL_DYNMIRFN_##fn) MIR_GetSym(#fn,thismod);
    21.9  #define SDL_MIR_SYM_CONST(type,name) MIR_##name = *(SDL_DYMMIRCONST_##name*) MIR_GetSym(#name,thismod);
   21.10  #include "SDL_mirsym.h"
   21.11  
    22.1 --- a/src/video/mir/SDL_mirvulkan.c	Tue Feb 13 13:25:59 2018 -0800
    22.2 +++ b/src/video/mir/SDL_mirvulkan.c	Mon Feb 12 17:00:00 2018 +0300
    22.3 @@ -56,13 +56,14 @@
    22.4          return -1;
    22.5      SDL_strlcpy(_this->vulkan_config.loader_path, path,
    22.6                  SDL_arraysize(_this->vulkan_config.loader_path));
    22.7 -    *(void**)&vkGetInstanceProcAddr = SDL_LoadFunction(
    22.8 +    vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
    22.9          _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
   22.10      if(!vkGetInstanceProcAddr)
   22.11          goto fail;
   22.12 -    _this->vulkan_config.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
   22.13 +    _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
   22.14      _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
   22.15 -        (PFN_vkEnumerateInstanceExtensionProperties)_this->vulkan_config.vkGetInstanceProcAddr(VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   22.16 +        (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
   22.17 +            VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   22.18      if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties)
   22.19          goto fail;
   22.20      extensions = SDL_Vulkan_CreateInstanceExtensionsList(
    23.1 --- a/src/video/uikit/SDL_uikitvulkan.m	Tue Feb 13 13:25:59 2018 -0800
    23.2 +++ b/src/video/uikit/SDL_uikitvulkan.m	Mon Feb 12 17:00:00 2018 +0300
    23.3 @@ -84,7 +84,8 @@
    23.4          }
    23.5          SDL_strlcpy(_this->vulkan_config.loader_path, path,
    23.6                      SDL_arraysize(_this->vulkan_config.loader_path));
    23.7 -        *(void**)&vkGetInstanceProcAddr = SDL_LoadFunction(
    23.8 +        vkGetInstanceProcAddr =
    23.9 +            (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
   23.10                                      _this->vulkan_config.loader_handle,
   23.11                                      "vkGetInstanceProcAddr");
   23.12      }
    24.1 --- a/src/video/wayland/SDL_waylanddyn.c	Tue Feb 13 13:25:59 2018 -0800
    24.2 +++ b/src/video/wayland/SDL_waylanddyn.c	Mon Feb 12 17:00:00 2018 +0300
    24.3 @@ -147,7 +147,7 @@
    24.4  #include "SDL_waylandsym.h"
    24.5  
    24.6  #define SDL_WAYLAND_MODULE(modname) thismod = &SDL_WAYLAND_HAVE_##modname;
    24.7 -#define SDL_WAYLAND_SYM(rc,fn,params) *(void**)&WAYLAND_##fn = WAYLAND_GetSym(#fn,thismod);
    24.8 +#define SDL_WAYLAND_SYM(rc,fn,params) WAYLAND_##fn = (SDL_DYNWAYLANDFN_##fn) WAYLAND_GetSym(#fn,thismod);
    24.9  #define SDL_WAYLAND_INTERFACE(iface) WAYLAND_##iface = (struct wl_interface *) WAYLAND_GetSym(#iface,thismod);
   24.10  #include "SDL_waylandsym.h"
   24.11  
    25.1 --- a/src/video/wayland/SDL_waylandvulkan.c	Tue Feb 13 13:25:59 2018 -0800
    25.2 +++ b/src/video/wayland/SDL_waylandvulkan.c	Mon Feb 12 17:00:00 2018 +0300
    25.3 @@ -56,12 +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 -    *(void**)&vkGetInstanceProcAddr = SDL_LoadFunction(_this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
    25.8 +    vkGetInstanceProcAddr = (PFN_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 = vkGetInstanceProcAddr;
   25.13 +    _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
   25.14      _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
   25.15 -        (PFN_vkEnumerateInstanceExtensionProperties)_this->vulkan_config.vkGetInstanceProcAddr(
   25.16 +        (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
   25.17              VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   25.18      if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties)
   25.19          goto fail;
    26.1 --- a/src/video/windows/SDL_windowsevents.c	Tue Feb 13 13:25:59 2018 -0800
    26.2 +++ b/src/video/windows/SDL_windowsevents.c	Mon Feb 12 17:00:00 2018 +0300
    26.3 @@ -1086,9 +1086,7 @@
    26.4      HMODULE handle = GetModuleHandleW(L"ntdll.dll");
    26.5      if (handle) {
    26.6          typedef LONG(WINAPI* RtlGetVersionPtr)(struct SDL_WIN_OSVERSIONINFOW*);
    26.7 -        RtlGetVersionPtr getVersionPtr;
    26.8 -       
    26.9 -        *(void**)&getVersionPtr = GetProcAddress(handle, "RtlGetVersion");
   26.10 +        RtlGetVersionPtr getVersionPtr = (RtlGetVersionPtr)GetProcAddress(handle, "RtlGetVersion");
   26.11          if (getVersionPtr != NULL) {
   26.12              struct SDL_WIN_OSVERSIONINFOW info;
   26.13              SDL_zero(info);
    27.1 --- a/src/video/windows/SDL_windowskeyboard.c	Tue Feb 13 13:25:59 2018 -0800
    27.2 +++ b/src/video/windows/SDL_windowskeyboard.c	Mon Feb 12 17:00:00 2018 +0300
    27.3 @@ -354,10 +354,10 @@
    27.4          SDL_ClearError();
    27.5          return;
    27.6      }
    27.7 -    *(void**)&videodata->ImmLockIMC = SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMC");
    27.8 -    *(void**)&videodata->ImmUnlockIMC = SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMC");
    27.9 -    *(void**)&videodata->ImmLockIMCC = SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMCC");
   27.10 -    *(void**)&videodata->ImmUnlockIMCC = SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMCC");
   27.11 +    videodata->ImmLockIMC = (LPINPUTCONTEXT2 (WINAPI *)(HIMC))SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMC");
   27.12 +    videodata->ImmUnlockIMC = (BOOL (WINAPI *)(HIMC))SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMC");
   27.13 +    videodata->ImmLockIMCC = (LPVOID (WINAPI *)(HIMCC))SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMCC");
   27.14 +    videodata->ImmUnlockIMCC = (BOOL (WINAPI *)(HIMCC))SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMCC");
   27.15  
   27.16      IME_SetWindow(videodata, hwnd);
   27.17      videodata->ime_himc = ImmGetContext(hwnd);
   27.18 @@ -654,9 +654,9 @@
   27.19      if (!hime)
   27.20          return;
   27.21  
   27.22 -    *(void**)&videodata->GetReadingString =
   27.23 +    videodata->GetReadingString = (UINT (WINAPI *)(HIMC, UINT, LPWSTR, PINT, BOOL*, PUINT))
   27.24          SDL_LoadFunction(hime, "GetReadingString");
   27.25 -    *(void**)&videodata->ShowReadingWindow =
   27.26 +    videodata->ShowReadingWindow = (BOOL (WINAPI *)(HIMC, BOOL))
   27.27          SDL_LoadFunction(hime, "ShowReadingWindow");
   27.28  
   27.29      if (videodata->ShowReadingWindow) {
    28.1 --- a/src/video/windows/SDL_windowsopengl.c	Tue Feb 13 13:25:59 2018 -0800
    28.2 +++ b/src/video/windows/SDL_windowsopengl.c	Mon Feb 12 17:00:00 2018 +0300
    28.3 @@ -119,15 +119,15 @@
    28.4  
    28.5      /* Load function pointers */
    28.6      handle = _this->gl_config.dll_handle;
    28.7 -    *(void**)&_this->gl_data->wglGetProcAddress =
    28.8 +    _this->gl_data->wglGetProcAddress = (void *(WINAPI *) (const char *))
    28.9          SDL_LoadFunction(handle, "wglGetProcAddress");
   28.10 -    *(void**)&_this->gl_data->wglCreateContext =
   28.11 +    _this->gl_data->wglCreateContext = (HGLRC(WINAPI *) (HDC))
   28.12          SDL_LoadFunction(handle, "wglCreateContext");
   28.13 -    *(void**)&_this->gl_data->wglDeleteContext =
   28.14 +    _this->gl_data->wglDeleteContext = (BOOL(WINAPI *) (HGLRC))
   28.15          SDL_LoadFunction(handle, "wglDeleteContext");
   28.16 -    *(void**)&_this->gl_data->wglMakeCurrent =
   28.17 +    _this->gl_data->wglMakeCurrent = (BOOL(WINAPI *) (HDC, HGLRC))
   28.18          SDL_LoadFunction(handle, "wglMakeCurrent");
   28.19 -    *(void**)&_this->gl_data->wglShareLists =
   28.20 +    _this->gl_data->wglShareLists = (BOOL(WINAPI *) (HGLRC, HGLRC))
   28.21          SDL_LoadFunction(handle, "wglShareLists");
   28.22  
   28.23      if (!_this->gl_data->wglGetProcAddress ||
   28.24 @@ -409,7 +409,7 @@
   28.25      }
   28.26      _this->gl_data->wglMakeCurrent(hdc, hglrc);
   28.27  
   28.28 -    *(void**)&wglGetExtensionsStringARB =
   28.29 +    wglGetExtensionsStringARB = (const char *(WINAPI *) (HDC))
   28.30          _this->gl_data->wglGetProcAddress("wglGetExtensionsStringARB");
   28.31      if (wglGetExtensionsStringARB) {
   28.32          extensions = wglGetExtensionsStringARB(hdc);
   28.33 @@ -420,9 +420,13 @@
   28.34      /* Check for WGL_ARB_pixel_format */
   28.35      _this->gl_data->HAS_WGL_ARB_pixel_format = SDL_FALSE;
   28.36      if (HasExtension("WGL_ARB_pixel_format", extensions)) {
   28.37 -        *(void**)&_this->gl_data->wglChoosePixelFormatARB =
   28.38 +        _this->gl_data->wglChoosePixelFormatARB = (BOOL(WINAPI *)
   28.39 +                                                   (HDC, const int *,
   28.40 +                                                    const FLOAT *, UINT,
   28.41 +                                                    int *, UINT *))
   28.42              WIN_GL_GetProcAddress(_this, "wglChoosePixelFormatARB");
   28.43 -        *(void**)&_this->gl_data->wglGetPixelFormatAttribivARB =
   28.44 +        _this->gl_data->wglGetPixelFormatAttribivARB =
   28.45 +            (BOOL(WINAPI *) (HDC, int, int, UINT, const int *, int *))
   28.46              WIN_GL_GetProcAddress(_this, "wglGetPixelFormatAttribivARB");
   28.47  
   28.48          if ((_this->gl_data->wglChoosePixelFormatARB != NULL) &&
   28.49 @@ -434,9 +438,9 @@
   28.50      /* Check for WGL_EXT_swap_control */
   28.51      _this->gl_data->HAS_WGL_EXT_swap_control_tear = SDL_FALSE;
   28.52      if (HasExtension("WGL_EXT_swap_control", extensions)) {
   28.53 -        *(void**)&_this->gl_data->wglSwapIntervalEXT =
   28.54 +        _this->gl_data->wglSwapIntervalEXT =
   28.55              WIN_GL_GetProcAddress(_this, "wglSwapIntervalEXT");
   28.56 -        *(void**)&_this->gl_data->wglGetSwapIntervalEXT =
   28.57 +        _this->gl_data->wglGetSwapIntervalEXT =
   28.58              WIN_GL_GetProcAddress(_this, "wglGetSwapIntervalEXT");
   28.59          if (HasExtension("WGL_EXT_swap_control_tear", extensions)) {
   28.60              _this->gl_data->HAS_WGL_EXT_swap_control_tear = SDL_TRUE;
   28.61 @@ -717,8 +721,9 @@
   28.62              return NULL;
   28.63          }
   28.64  
   28.65 -        *(void**)&wglCreateContextAttribsARB =
   28.66 -            _this->gl_data->wglGetProcAddress("wglCreateContextAttribsARB");
   28.67 +        wglCreateContextAttribsARB =
   28.68 +            (PFNWGLCREATECONTEXTATTRIBSARBPROC) _this->gl_data->
   28.69 +            wglGetProcAddress("wglCreateContextAttribsARB");
   28.70          if (!wglCreateContextAttribsARB) {
   28.71              SDL_SetError("GL 3.x is not supported");
   28.72              context = temp_context;
    29.1 --- a/src/video/windows/SDL_windowsvideo.c	Tue Feb 13 13:25:59 2018 -0800
    29.2 +++ b/src/video/windows/SDL_windowsvideo.c	Mon Feb 12 17:00:00 2018 +0300
    29.3 @@ -113,16 +113,16 @@
    29.4  
    29.5      data->userDLL = SDL_LoadObject("USER32.DLL");
    29.6      if (data->userDLL) {
    29.7 -        *(void**)&data->CloseTouchInputHandle = SDL_LoadFunction(data->userDLL, "CloseTouchInputHandle");
    29.8 -        *(void**)&data->GetTouchInputInfo = SDL_LoadFunction(data->userDLL, "GetTouchInputInfo");
    29.9 -        *(void**)&data->RegisterTouchWindow = SDL_LoadFunction(data->userDLL, "RegisterTouchWindow");
   29.10 +        data->CloseTouchInputHandle = (BOOL (WINAPI *)(HTOUCHINPUT)) SDL_LoadFunction(data->userDLL, "CloseTouchInputHandle");
   29.11 +        data->GetTouchInputInfo = (BOOL (WINAPI *)(HTOUCHINPUT, UINT, PTOUCHINPUT, int)) SDL_LoadFunction(data->userDLL, "GetTouchInputInfo");
   29.12 +        data->RegisterTouchWindow = (BOOL (WINAPI *)(HWND, ULONG)) SDL_LoadFunction(data->userDLL, "RegisterTouchWindow");
   29.13      } else {
   29.14          SDL_ClearError();
   29.15      }
   29.16  
   29.17      data->shcoreDLL = SDL_LoadObject("SHCORE.DLL");
   29.18      if (data->shcoreDLL) {
   29.19 -        *(void**)&data->GetDpiForMonitor = SDL_LoadFunction(data->shcoreDLL, "GetDpiForMonitor");
   29.20 +        data->GetDpiForMonitor = (HRESULT (WINAPI *)(HMONITOR, MONITOR_DPI_TYPE, UINT *, UINT *)) SDL_LoadFunction(data->shcoreDLL, "GetDpiForMonitor");
   29.21      } else {
   29.22          SDL_ClearError();
   29.23      }
   29.24 @@ -256,7 +256,7 @@
   29.25          typedef HRESULT (WINAPI *Direct3DCreate9Ex_t)(UINT SDKVersion, IDirect3D9Ex **ppD3D);
   29.26          Direct3DCreate9Ex_t Direct3DCreate9ExFunc;
   29.27  
   29.28 -        *(void**)&Direct3DCreate9ExFunc = SDL_LoadFunction(*pD3DDLL, "Direct3DCreate9Ex");
   29.29 +        Direct3DCreate9ExFunc = (Direct3DCreate9Ex_t)SDL_LoadFunction(*pD3DDLL, "Direct3DCreate9Ex");
   29.30          if (Direct3DCreate9ExFunc) {
   29.31              IDirect3D9Ex *pDirect3D9ExInterface;
   29.32              HRESULT hr = Direct3DCreate9ExFunc(D3D_SDK_VERSION, &pDirect3D9ExInterface);
   29.33 @@ -271,7 +271,7 @@
   29.34          }
   29.35  #endif /* USE_D3D9EX */
   29.36  
   29.37 -        *(void**)&Direct3DCreate9Func = SDL_LoadFunction(*pD3DDLL, "Direct3DCreate9");
   29.38 +        Direct3DCreate9Func = (Direct3DCreate9_t)SDL_LoadFunction(*pD3DDLL, "Direct3DCreate9");
   29.39          if (Direct3DCreate9Func) {
   29.40              *pDirect3D9Interface = Direct3DCreate9Func(D3D_SDK_VERSION);
   29.41              if (*pDirect3D9Interface) {
   29.42 @@ -338,7 +338,9 @@
   29.43      if (*pDXGIDLL) {
   29.44          HRESULT (WINAPI *CreateDXGI)(REFIID riid, void **ppFactory);
   29.45  
   29.46 -        *(void**)&CreateDXGI = SDL_LoadFunction(*pDXGIDLL, "CreateDXGIFactory");
   29.47 +        CreateDXGI =
   29.48 +            (HRESULT (WINAPI *) (REFIID, void**)) SDL_LoadFunction(*pDXGIDLL,
   29.49 +            "CreateDXGIFactory");
   29.50          if (CreateDXGI) {
   29.51              GUID dxgiGUID = {0x7b7166ec,0x21c7,0x44ae,{0xb2,0x1a,0xc9,0xae,0x32,0x1a,0xe3,0x69}};
   29.52              if (!SUCCEEDED(CreateDXGI(&dxgiGUID, (void**)pDXGIFactory))) {
    30.1 --- a/src/video/windows/SDL_windowsvulkan.c	Tue Feb 13 13:25:59 2018 -0800
    30.2 +++ b/src/video/windows/SDL_windowsvulkan.c	Mon Feb 12 17:00:00 2018 +0300
    30.3 @@ -57,13 +57,13 @@
    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 -    *(void **)&vkGetInstanceProcAddr = SDL_LoadFunction(
    30.8 +    vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
    30.9          _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
   30.10      if(!vkGetInstanceProcAddr)
   30.11          goto fail;
   30.12 -    _this->vulkan_config.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
   30.13 +    _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
   30.14      _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
   30.15 -        (PFN_vkEnumerateInstanceExtensionProperties)_this->vulkan_config.vkGetInstanceProcAddr(
   30.16 +        (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
   30.17              VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   30.18      if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties)
   30.19          goto fail;
    31.1 --- a/src/video/winrt/SDL_winrtopengles.cpp	Tue Feb 13 13:25:59 2018 -0800
    31.2 +++ b/src/video/winrt/SDL_winrtopengles.cpp	Mon Feb 12 17:00:00 2018 +0300
    31.3 @@ -63,8 +63,7 @@
    31.4      }
    31.5  
    31.6      /* Load ANGLE/WinRT-specific functions */
    31.7 -    CreateWinrtEglWindow_Old_Function CreateWinrtEglWindow;
    31.8 -    *(void**)&CreateWinrtEglWindow =  SDL_LoadFunction(_this->egl_data->egl_dll_handle, "CreateWinrtEglWindow");
    31.9 +    CreateWinrtEglWindow_Old_Function CreateWinrtEglWindow = (CreateWinrtEglWindow_Old_Function) SDL_LoadFunction(_this->egl_data->egl_dll_handle, "CreateWinrtEglWindow");
   31.10      if (CreateWinrtEglWindow) {
   31.11          /* 'CreateWinrtEglWindow' was found, which means that an an older
   31.12           * version of ANGLE/WinRT is being used.  Continue setting up EGL,
    32.1 --- a/src/video/x11/SDL_x11dyn.c	Tue Feb 13 13:25:59 2018 -0800
    32.2 +++ b/src/video/x11/SDL_x11dyn.c	Mon Feb 12 17:00:00 2018 +0300
    32.3 @@ -172,12 +172,14 @@
    32.4  #include "SDL_x11sym.h"
    32.5  
    32.6  #define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname;
    32.7 -#define SDL_X11_SYM(a,fn,x,y,z) *(void**)&X11_##fn = X11_GetSym(#fn,thismod);
    32.8 +#define SDL_X11_SYM(a,fn,x,y,z) X11_##fn = (SDL_DYNX11FN_##fn) X11_GetSym(#fn,thismod);
    32.9  #include "SDL_x11sym.h"
   32.10  
   32.11  #ifdef X_HAVE_UTF8_STRING
   32.12 -        *(void**)&X11_XCreateIC = X11_GetSym("XCreateIC", &SDL_X11_HAVE_UTF8);
   32.13 -        *(void**)&X11_XGetICValues = X11_GetSym("XGetICValues", &SDL_X11_HAVE_UTF8);
   32.14 +        X11_XCreateIC = (SDL_DYNX11FN_XCreateIC)
   32.15 +                        X11_GetSym("XCreateIC", &SDL_X11_HAVE_UTF8);
   32.16 +        X11_XGetICValues = (SDL_DYNX11FN_XGetICValues)
   32.17 +                        X11_GetSym("XGetICValues", &SDL_X11_HAVE_UTF8);
   32.18  #endif
   32.19  
   32.20          if (SDL_X11_HAVE_BASEXLIB) {
    33.1 --- a/src/video/x11/SDL_x11opengl.c	Tue Feb 13 13:25:59 2018 -0800
    33.2 +++ b/src/video/x11/SDL_x11opengl.c	Mon Feb 12 17:00:00 2018 +0300
    33.3 @@ -189,21 +189,29 @@
    33.4  
    33.5      /* Load function pointers */
    33.6      handle = _this->gl_config.dll_handle;
    33.7 -    *(void**)&_this->gl_data->glXQueryExtension =
    33.8 +    _this->gl_data->glXQueryExtension =
    33.9 +        (Bool (*)(Display *, int *, int *))
   33.10              GL_LoadFunction(handle, "glXQueryExtension");
   33.11 -    *(void**)&_this->gl_data->glXGetProcAddress =
   33.12 +    _this->gl_data->glXGetProcAddress =
   33.13 +        (void *(*)(const GLubyte *))
   33.14              GL_LoadFunction(handle, "glXGetProcAddressARB");
   33.15 -    *(void**)&_this->gl_data->glXChooseVisual =
   33.16 +    _this->gl_data->glXChooseVisual =
   33.17 +        (XVisualInfo * (*)(Display *, int, int *))
   33.18              X11_GL_GetProcAddress(_this, "glXChooseVisual");
   33.19 -    *(void**)&_this->gl_data->glXCreateContext =
   33.20 +    _this->gl_data->glXCreateContext =
   33.21 +        (GLXContext(*)(Display *, XVisualInfo *, GLXContext, int))
   33.22              X11_GL_GetProcAddress(_this, "glXCreateContext");
   33.23 -    *(void**)&_this->gl_data->glXDestroyContext =
   33.24 +    _this->gl_data->glXDestroyContext =
   33.25 +        (void (*)(Display *, GLXContext))
   33.26              X11_GL_GetProcAddress(_this, "glXDestroyContext");
   33.27 -    *(void**)&_this->gl_data->glXMakeCurrent =
   33.28 +    _this->gl_data->glXMakeCurrent =
   33.29 +        (int (*)(Display *, GLXDrawable, GLXContext))
   33.30              X11_GL_GetProcAddress(_this, "glXMakeCurrent");
   33.31 -    *(void**)&_this->gl_data->glXSwapBuffers =
   33.32 +    _this->gl_data->glXSwapBuffers =
   33.33 +        (void (*)(Display *, GLXDrawable))
   33.34              X11_GL_GetProcAddress(_this, "glXSwapBuffers");
   33.35 -    *(void**)&_this->gl_data->glXQueryDrawable =
   33.36 +    _this->gl_data->glXQueryDrawable =
   33.37 +        (void (*)(Display*,GLXDrawable,int,unsigned int*))
   33.38              X11_GL_GetProcAddress(_this, "glXQueryDrawable");
   33.39  
   33.40      if (!_this->gl_data->glXQueryExtension ||
   33.41 @@ -333,11 +341,13 @@
   33.42  
   33.43      vinfo = X11_GL_GetVisual(_this, display, screen);
   33.44      if (vinfo) {
   33.45 -        GLXContext (*glXGetCurrentContextFunc)(void);
   33.46 -        GLXDrawable (*glXGetCurrentDrawableFunc)(void);
   33.47 +        GLXContext (*glXGetCurrentContextFunc) (void) =
   33.48 +            (GLXContext(*)(void))
   33.49 +                X11_GL_GetProcAddress(_this, "glXGetCurrentContext");
   33.50  
   33.51 -        *(void**)&glXGetCurrentContextFunc = X11_GL_GetProcAddress(_this, "glXGetCurrentContext");
   33.52 -        *(void**)&glXGetCurrentDrawableFunc = X11_GL_GetProcAddress(_this, "glXGetCurrentDrawable");
   33.53 +        GLXDrawable (*glXGetCurrentDrawableFunc) (void) =
   33.54 +            (GLXDrawable(*)(void))
   33.55 +                X11_GL_GetProcAddress(_this, "glXGetCurrentDrawable");
   33.56  
   33.57          if (glXGetCurrentContextFunc && glXGetCurrentDrawableFunc) {
   33.58              XSetWindowAttributes xattr;
   33.59 @@ -363,7 +373,9 @@
   33.60          X11_XFree(vinfo);
   33.61      }
   33.62  
   33.63 -    *(void**)&glXQueryExtensionsStringFunc = X11_GL_GetProcAddress(_this, "glXQueryExtensionsString");
   33.64 +    glXQueryExtensionsStringFunc =
   33.65 +        (const char *(*)(Display *, int)) X11_GL_GetProcAddress(_this,
   33.66 +                                                                "glXQueryExtensionsString");
   33.67      if (glXQueryExtensionsStringFunc) {
   33.68          extensions = glXQueryExtensionsStringFunc(display, screen);
   33.69      } else {
   33.70 @@ -373,7 +385,8 @@
   33.71      /* Check for GLX_EXT_swap_control(_tear) */
   33.72      _this->gl_data->HAS_GLX_EXT_swap_control_tear = SDL_FALSE;
   33.73      if (HasExtension("GLX_EXT_swap_control", extensions)) {
   33.74 -        *(void**)&_this->gl_data->glXSwapIntervalEXT =
   33.75 +        _this->gl_data->glXSwapIntervalEXT =
   33.76 +            (void (*)(Display*,GLXDrawable,int))
   33.77                  X11_GL_GetProcAddress(_this, "glXSwapIntervalEXT");
   33.78          if (HasExtension("GLX_EXT_swap_control_tear", extensions)) {
   33.79              _this->gl_data->HAS_GLX_EXT_swap_control_tear = SDL_TRUE;
   33.80 @@ -382,23 +395,26 @@
   33.81  
   33.82      /* Check for GLX_MESA_swap_control */
   33.83      if (HasExtension("GLX_MESA_swap_control", extensions)) {
   33.84 -        *(void**)&_this->gl_data->glXSwapIntervalMESA =
   33.85 -                X11_GL_GetProcAddress(_this, "glXSwapIntervalMESA");
   33.86 -        *(void**)&_this->gl_data->glXGetSwapIntervalMESA =
   33.87 -                X11_GL_GetProcAddress(_this, "glXGetSwapIntervalMESA");
   33.88 +        _this->gl_data->glXSwapIntervalMESA =
   33.89 +            (int(*)(int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalMESA");
   33.90 +        _this->gl_data->glXGetSwapIntervalMESA =
   33.91 +            (int(*)(void)) X11_GL_GetProcAddress(_this,
   33.92 +                                                   "glXGetSwapIntervalMESA");
   33.93      }
   33.94  
   33.95      /* Check for GLX_SGI_swap_control */
   33.96      if (HasExtension("GLX_SGI_swap_control", extensions)) {
   33.97 -        *(void**)&_this->gl_data->glXSwapIntervalSGI =
   33.98 -                 X11_GL_GetProcAddress(_this, "glXSwapIntervalSGI");
   33.99 +        _this->gl_data->glXSwapIntervalSGI =
  33.100 +            (int (*)(int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalSGI");
  33.101      }
  33.102  
  33.103      /* Check for GLX_ARB_create_context */
  33.104      if (HasExtension("GLX_ARB_create_context", extensions)) {
  33.105 -        *(void**)&_this->gl_data->glXCreateContextAttribsARB =
  33.106 +        _this->gl_data->glXCreateContextAttribsARB =
  33.107 +            (GLXContext (*)(Display*,GLXFBConfig,GLXContext,Bool,const int *))
  33.108                  X11_GL_GetProcAddress(_this, "glXCreateContextAttribsARB");
  33.109 -        *(void**)&_this->gl_data->glXChooseFBConfig =
  33.110 +        _this->gl_data->glXChooseFBConfig =
  33.111 +            (GLXFBConfig *(*)(Display *, int, const int *, int *))
  33.112                  X11_GL_GetProcAddress(_this, "glXChooseFBConfig");
  33.113      }
  33.114  
    34.1 --- a/src/video/x11/SDL_x11vulkan.c	Tue Feb 13 13:25:59 2018 -0800
    34.2 +++ b/src/video/x11/SDL_x11vulkan.c	Mon Feb 12 17:00:00 2018 +0300
    34.3 @@ -57,14 +57,14 @@
    34.4      if(!_this->vulkan_config.loader_handle)
    34.5          return -1;
    34.6      SDL_strlcpy(_this->vulkan_config.loader_path, path, SDL_arraysize(_this->vulkan_config.loader_path));
    34.7 -    *(void**)&vkGetInstanceProcAddr = SDL_LoadFunction(
    34.8 +    vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction(
    34.9          _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
   34.10      if(!vkGetInstanceProcAddr)
   34.11          goto fail;
   34.12 -    _this->vulkan_config.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
   34.13 +    _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr;
   34.14      _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
   34.15 -        (PFN_vkEnumerateInstanceExtensionProperties)
   34.16 -        _this->vulkan_config.vkGetInstanceProcAddr(VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   34.17 +        (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)(
   34.18 +            VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
   34.19      if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties)
   34.20          goto fail;
   34.21      extensions = SDL_Vulkan_CreateInstanceExtensionsList(
   34.22 @@ -108,7 +108,7 @@
   34.23          videoData->vulkan_xlib_xcb_library = SDL_LoadObject(libX11XCBLibraryName);
   34.24          if(!videoData->vulkan_xlib_xcb_library)
   34.25              goto fail;
   34.26 -        *(void**)&videoData->vulkan_XGetXCBConnection =
   34.27 +        videoData->vulkan_XGetXCBConnection =
   34.28              SDL_LoadFunction(videoData->vulkan_xlib_xcb_library, "XGetXCBConnection");
   34.29          if(!videoData->vulkan_XGetXCBConnection)
   34.30          {