[Commits] SDL: ISO C correct fix for casting void* to function pointer

libsdl.org revision control commits-owner at libsdl.org
Sun Feb 11 15:29:39 PST 2018


details:   https://hg.libsdl.org/SDL/rev/b3944d2ef793
changeset: 11863:b3944d2ef793
user:      Sam Lantinga <slouken at libsdl.org>
date:      Sun Feb 11 15:29:36 2018 -0800
description:
ISO C correct fix for casting void* to function pointer

diffstat:

 src/video/windows/SDL_windowsvulkan.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 0f2ae46e429c -r b3944d2ef793 src/video/windows/SDL_windowsvulkan.c
--- a/src/video/windows/SDL_windowsvulkan.c	Sun Feb 11 18:16:01 2018 -0500
+++ b/src/video/windows/SDL_windowsvulkan.c	Sun Feb 11 15:29:36 2018 -0800
@@ -57,7 +57,7 @@
         return -1;
     SDL_strlcpy(_this->vulkan_config.loader_path, path,
                 SDL_arraysize(_this->vulkan_config.loader_path));
-    vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr) SDL_LoadFunction(
+    *(void **)&vkGetInstanceProcAddr = SDL_LoadFunction(
         _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
     if(!vkGetInstanceProcAddr)
         goto fail;


More information about the commits mailing list