From 04951e78117eb18585e35bcc33c946e9810a1430 Mon Sep 17 00:00:00 2001 From: Roderick Colenbrander Date: Sun, 3 Jun 2018 15:52:10 -0700 Subject: [PATCH] winevulkan: Fix parsing of const function pointer members. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roderick Colenbrander Signed-off-by: Józef Kucia Signed-off-by: Alexandre Julliard --- dlls/winevulkan/make_vulkan | 9 +++++---- include/wine/vulkan.h | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 2265ddc80b7..81148ef0bda 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -670,7 +670,8 @@ class VkFunctionPointer(object): # void* pUserData, # Parsing of the tail (anything past ) is tricky since there # can be other data on the next line like: const int.. - const = begin + + const = True if begin and "const" in begin else False _type = t.text lines = t.tail.split(",\n") if lines[0][0] == "*": @@ -779,7 +780,7 @@ class VkHandle(object): class VkMember(object): - def __init__(self, const=None, _type=None, pointer=None, name=None, array_len=None, dyn_array_len=None, optional=False, + def __init__(self, const=False, _type=None, pointer=None, name=None, array_len=None, dyn_array_len=None, optional=False, extension_structs=None): self.const = const self.name = name @@ -814,7 +815,7 @@ class VkMember(object): name_elem = member.find("name") type_elem = member.find("type") - const = member.text.strip() if member.text else None + const = True if member.text and "const" in member.text else False member_type = None pointer = None array_len = None @@ -948,7 +949,7 @@ class VkMember(object): return conversions def is_const(self): - return self.const is not None + return self.const def is_dynamic_array(self): """ Returns if the member is an array element. diff --git a/include/wine/vulkan.h b/include/wine/vulkan.h index d44687fabf7..24b0ef990ee 100644 --- a/include/wine/vulkan.h +++ b/include/wine/vulkan.h @@ -1251,28 +1251,28 @@ typedef enum VkVertexInputRate typedef void* (VKAPI_PTR * PFN_vkAllocationFunction)( void *pUserData, - const size_t size, - const size_t alignment, - const VkSystemAllocationScope allocationScope); + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); typedef void (VKAPI_PTR * PFN_vkFreeFunction)( void *pUserData, - const void *pMemory); + void *pMemory); typedef void (VKAPI_PTR * PFN_vkInternalAllocationNotification)( void *pUserData, - const size_t size, - const VkInternalAllocationType allocationType, - const VkSystemAllocationScope allocationScope); + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); typedef void (VKAPI_PTR * PFN_vkInternalFreeNotification)( void *pUserData, - const size_t size, - const VkInternalAllocationType allocationType, - const VkSystemAllocationScope allocationScope); + size_t size, + VkInternalAllocationType allocationType, + VkSystemAllocationScope allocationScope); typedef void* (VKAPI_PTR * PFN_vkReallocationFunction)( void *pUserData, - const void *pOriginal, - const size_t size, - const size_t alignment, - const VkSystemAllocationScope allocationScope); + void *pOriginal, + size_t size, + size_t alignment, + VkSystemAllocationScope allocationScope); typedef void (VKAPI_PTR * PFN_vkVoidFunction)( void);