winevulkan: Fix parsing of const function pointer members.

Signed-off-by: Roderick Colenbrander <thunderbird2k@gmail.com>
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Roderick Colenbrander 2018-06-03 15:52:10 -07:00 committed by Alexandre Julliard
parent 42ace9d445
commit 04951e7811
2 changed files with 19 additions and 18 deletions

View File

@ -670,7 +670,8 @@ class VkFunctionPointer(object):
# <type>void</type>* pUserData,
# Parsing of the tail (anything past </type>) is tricky since there
# can be other data on the next line like: const <type>int</type>..
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.

View File

@ -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);