From 838fea8166ec534a75ca3777b9069b3693a2d94b Mon Sep 17 00:00:00 2001 From: Mark Young Date: Wed, 12 Oct 2016 14:18:44 -0600 Subject: loader: gh1026- Fix compiler warnings Fixed the compiler fixes encountered in the loader. Change-Id: I4b3bb34b2d7e2231ccae61c684029af337d7c25e --- loader/wsi.c | 62 ++++++++++-------------------------------------------------- 1 file changed, 10 insertions(+), 52 deletions(-) (limited to 'loader') diff --git a/loader/wsi.c b/loader/wsi.c index acea82d4..1cd55722 100644 --- a/loader/wsi.c +++ b/loader/wsi.c @@ -34,53 +34,6 @@ // the ICDs. #define ICD_VER_SUPPORTS_ICD_SURFACE_KHR 3 -static const VkExtensionProperties wsi_surface_extension_info = { - .extensionName = VK_KHR_SURFACE_EXTENSION_NAME, - .specVersion = VK_KHR_SURFACE_SPEC_VERSION, -}; - -#ifdef VK_USE_PLATFORM_WIN32_KHR -static const VkExtensionProperties wsi_win32_surface_extension_info = { - .extensionName = VK_KHR_WIN32_SURFACE_EXTENSION_NAME, - .specVersion = VK_KHR_WIN32_SURFACE_SPEC_VERSION, -}; -#endif // VK_USE_PLATFORM_WIN32_KHR - -#ifdef VK_USE_PLATFORM_MIR_KHR -static const VkExtensionProperties wsi_mir_surface_extension_info = { - .extensionName = VK_KHR_MIR_SURFACE_EXTENSION_NAME, - .specVersion = VK_KHR_MIR_SURFACE_SPEC_VERSION, -}; -#endif // VK_USE_PLATFORM_MIR_KHR - -#ifdef VK_USE_PLATFORM_WAYLAND_KHR -static const VkExtensionProperties wsi_wayland_surface_extension_info = { - .extensionName = VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, - .specVersion = VK_KHR_WAYLAND_SURFACE_SPEC_VERSION, -}; -#endif // VK_USE_PLATFORM_WAYLAND_KHR - -#ifdef VK_USE_PLATFORM_XCB_KHR -static const VkExtensionProperties wsi_xcb_surface_extension_info = { - .extensionName = VK_KHR_XCB_SURFACE_EXTENSION_NAME, - .specVersion = VK_KHR_XCB_SURFACE_SPEC_VERSION, -}; -#endif // VK_USE_PLATFORM_XCB_KHR - -#ifdef VK_USE_PLATFORM_XLIB_KHR -static const VkExtensionProperties wsi_xlib_surface_extension_info = { - .extensionName = VK_KHR_XLIB_SURFACE_EXTENSION_NAME, - .specVersion = VK_KHR_XLIB_SURFACE_SPEC_VERSION, -}; -#endif // VK_USE_PLATFORM_XLIB_KHR - -#ifdef VK_USE_PLATFORM_ANDROID_KHR -static const VkExtensionProperties wsi_android_surface_extension_info = { - .extensionName = VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, - .specVersion = VK_KHR_ANDROID_SURFACE_REVISION, -}; -#endif // VK_USE_PLATFORM_ANDROID_KHR - void wsi_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo) { ptr_instance->wsi_surface_enabled = false; @@ -599,6 +552,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWin32SurfaceKHR( VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { VkResult vkRes = VK_SUCCESS; + VkIcdSurface *pIcdSurface = NULL; // Initialize pSurface to NULL just to be safe. *pSurface = VK_NULL_HANDLE; // First, check to ensure the appropriate extension was enabled: @@ -612,7 +566,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWin32SurfaceKHR( } // Next, if so, proceed with the implementation of this function: - VkIcdSurface *pIcdSurface = AllocateIcdSurfaceStruct( + pIcdSurface = AllocateIcdSurfaceStruct( ptr_instance, sizeof(pIcdSurface->win_surf.base), sizeof(pIcdSurface->win_surf), true); if (pIcdSurface == NULL) { @@ -728,6 +682,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMirSurfaceKHR( VkInstance instance, const VkMirSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { VkResult vkRes = VK_SUCCESS; + VkIcdSurface *pIcdSurface = NULL; // First, check to ensure the appropriate extension was enabled: struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_mir_surface_enabled) { @@ -739,7 +694,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMirSurfaceKHR( } // Next, if so, proceed with the implementation of this function: - VkIcdSurface *pIcdSurface = AllocateIcdSurfaceStruct( + pIcdSurface = AllocateIcdSurfaceStruct( ptr_instance, sizeof(pIcdSurface->mir_surf.base), sizeof(pIcdSurface->mir_surf), true); if (pIcdSurface == NULL) { @@ -858,6 +813,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR( VkInstance instance, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { VkResult vkRes = VK_SUCCESS; + VkIcdSurface *pIcdSurface = NULL; // First, check to ensure the appropriate extension was enabled: struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_wayland_surface_enabled) { @@ -869,7 +825,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateWaylandSurfaceKHR( } // Next, if so, proceed with the implementation of this function: - VkIcdSurface *pIcdSurface = AllocateIcdSurfaceStruct( + pIcdSurface = AllocateIcdSurfaceStruct( ptr_instance, sizeof(pIcdSurface->wayland_surf.base), sizeof(pIcdSurface->wayland_surf), true); if (pIcdSurface == NULL) { @@ -989,6 +945,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXcbSurfaceKHR( VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { VkResult vkRes = VK_SUCCESS; + VkIcdSurface *pIcdSurface = NULL; // First, check to ensure the appropriate extension was enabled: struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_xcb_surface_enabled) { @@ -1000,7 +957,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXcbSurfaceKHR( } // Next, if so, proceed with the implementation of this function: - VkIcdSurface *pIcdSurface = AllocateIcdSurfaceStruct( + pIcdSurface = AllocateIcdSurfaceStruct( ptr_instance, sizeof(pIcdSurface->xcb_surf.base), sizeof(pIcdSurface->xcb_surf), true); if (pIcdSurface == NULL) { @@ -1119,6 +1076,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXlibSurfaceKHR( VkInstance instance, const VkXlibSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) { VkResult vkRes = VK_SUCCESS; + VkIcdSurface *pIcdSurface = NULL; // First, check to ensure the appropriate extension was enabled: struct loader_instance *ptr_instance = loader_get_instance(instance); if (!ptr_instance->wsi_xlib_surface_enabled) { @@ -1130,7 +1088,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateXlibSurfaceKHR( } // Next, if so, proceed with the implementation of this function: - VkIcdSurface *pIcdSurface = AllocateIcdSurfaceStruct( + pIcdSurface = AllocateIcdSurfaceStruct( ptr_instance, sizeof(pIcdSurface->xlib_surf.base), sizeof(pIcdSurface->xlib_surf), true); if (pIcdSurface == NULL) { -- cgit v1.2.3