wsi/x11: use WSI_FROM_HANDLE() instead of pointer casts
authorEric Engestrom <eric.engestrom@intel.com>
Sun, 25 Nov 2018 15:15:09 +0000 (15:15 +0000)
committerEric Engestrom <eric.engestrom@intel.com>
Mon, 11 Mar 2019 10:49:36 +0000 (10:49 +0000)
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/vulkan/wsi/wsi_common_x11.c

index 0aa71ca6f2ec6cfeab5320d441b47a99fd3ef9fc..04ef9148f906f5d2bd94073ae7d624c7a5d618b4 100644 (file)
@@ -720,6 +720,7 @@ struct x11_swapchain {
 
    struct x11_image                             images[0];
 };
+WSI_DEFINE_NONDISP_HANDLE_CASTS(x11_swapchain, VkSwapchainKHR)
 
 /**
  * Update the swapchain status with the result of an operation, and return
@@ -1360,7 +1361,7 @@ x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
     * mode which provokes reallocation when anything changes, to make
     * sure we have the most optimal allocation.
     */
-   struct x11_swapchain *old_chain = (void *)(intptr_t) pCreateInfo->oldSwapchain;
+   WSI_FROM_HANDLE(x11_swapchain, old_chain, pCreateInfo->oldSwapchain);
    if (old_chain)
       chain->last_present_mode = old_chain->last_present_mode;
    else