Fix wrong pointer casts in win32 surface code
authorCharles Giessen <charles@lunarg.com>
Tue, 19 Dec 2023 17:12:29 +0000 (10:12 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Tue, 19 Dec 2023 17:51:50 +0000 (10:51 -0700)
The bad pattern was detected using clang/gcc but only on linux, so the
win32 code path never saw the fix.

loader/extension_manual.c

index feadd6de46cf969909a6344cad48a8cfd090ba62..b8ed8a33eb41ad784349f7002ac9ef8606e5e1c6 100644 (file)
@@ -322,7 +322,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDeviceGroupSurfacePresentModes2EXT(
         abort(); /* Intentionally fail so user can correct issue. */
     }
     VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pSurfaceInfo->surface;
-    if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[icd_index]) {
+    if (NULL != icd_surface->real_icd_surfaces && NULL != (void *)(uintptr_t)icd_surface->real_icd_surfaces[icd_index]) {
         VkPhysicalDeviceSurfaceInfo2KHR surface_info_copy;
         surface_info_copy.sType = pSurfaceInfo->sType;
         surface_info_copy.pNext = pSurfaceInfo->pNext;