From fc6a628629003d50564d28f3f8648ef5fb87606a Mon Sep 17 00:00:00 2001 From: Peter Particle Date: Sat, 27 Aug 2016 10:59:27 +0200 Subject: [PATCH] Fix: PFN_vkDebugReportCallbackEXT now correctly uses const(char)* instead of const char* parameter types where applicable --- erupt.py | 17 +++++++++++++++-- source/erupted/types.d | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/erupt.py b/erupt.py index 9c6ad13..5212549 100644 --- a/erupt.py +++ b/erupt.py @@ -306,7 +306,7 @@ def endFeature(self): # write contents of type section contents = self.sections[section] if contents: - # check if opaque structs were registered and write tem into types file + # check if opaque structs were registered and write them into types file if section == 'struct': if self.opaqueStruct: for opaque in self.opaqueStruct: @@ -440,8 +440,21 @@ def genType(self, typeinfo, name): returnType = re.match(re_funcptr, typeinfo.elem.text).group(1) params = "".join(islice(typeinfo.elem.itertext(), 2, None))[2:] if params == "void);" : params = ");" - else: params = ' '.join(' '.join(line.strip() for line in params.splitlines()).split()) + #else: params = ' '.join(' '.join(line.strip() for line in params.splitlines()).split()) + else: + concatParams = "" + for line in params.splitlines(): + lineSplit = line.split() + if len(lineSplit) > 2: + concatParams += ' ' + convertTypeConst(lineSplit[0] + ' ' + lineSplit[1]) + ' ' + lineSplit[2] + else: + concatParams += ' ' + ' '.join( param for param in lineSplit ) + + params = concatParams[2:] + self.appendSection("funcpointer", "alias {0} = {1} function({2}".format(name, returnType, params)) + #write( params, file=self.testsFile ) + elif category == "struct" or category == "union": self.genStruct(typeinfo, name) diff --git a/source/erupted/types.d b/source/erupted/types.d index 14a8865..4803f69 100644 --- a/source/erupted/types.d +++ b/source/erupted/types.d @@ -3577,7 +3577,7 @@ enum VK_DEBUG_REPORT_DEBUG_BIT_EXT = VkDebugReportFlagBitsEXT.VK_DEBUG_REPORT_DE enum VK_DEBUG_REPORT_FLAG_BITS_MAX_ENUM_EXT = VkDebugReportFlagBitsEXT.VK_DEBUG_REPORT_FLAG_BITS_MAX_ENUM_EXT; alias VkDebugReportFlagsEXT = VkFlags; -alias PFN_vkDebugReportCallbackEXT = VkBool32 function(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage, void* pUserData); +alias PFN_vkDebugReportCallbackEXT = VkBool32 function(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const(char)* pLayerPrefix, const(char)* pMessage, void* pUserData); struct VkDebugReportCallbackCreateInfoEXT { VkStructureType sType = VkStructureType.VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT;