From 5e8166e2841b59a528c9159791010a1ece298956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Mon, 9 Jan 2023 11:32:23 +0100 Subject: [PATCH] Handle potential shadowing of function parameter name "objectType" with class member. (#1476) --- VulkanHppGenerator.cpp | 6 +++++- VulkanHppGenerator.hpp | 1 + vulkan/vulkan_funcs.hpp | 40 +++++++++++++++++++-------------------- vulkan/vulkan_handles.hpp | 20 ++++++++++---------- 4 files changed, 36 insertions(+), 31 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 756a457..ad93f97 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -508,8 +508,11 @@ void VulkanHppGenerator::prepareRAIIHandles() } distributeSecondLevelCommands( m_RAIISpecialFunctions ); +} - // we rename a couple of function parameters to prevent this warning, treated as an error: +void VulkanHppGenerator::prepareVulkanFuncs() +{ + // rename a couple of function parameters to prevent this warning, treated as an error: // warning C4458: declaration of 'objectType' hides class member for ( auto & command : m_commands ) { @@ -13622,6 +13625,7 @@ int main( int argc, char ** argv ) generator.generateVulkanHppFile(); generator.generateVulkanEnumsHppFile(); generator.generateVulkanFormatTraitsHppFile(); + generator.prepareVulkanFuncs(); generator.generateVulkanFuncsHppFile(); generator.generateVulkanHandlesHppFile(); generator.generateVulkanHashHppFile(); diff --git a/VulkanHppGenerator.hpp b/VulkanHppGenerator.hpp index d381de4..7314c95 100644 --- a/VulkanHppGenerator.hpp +++ b/VulkanHppGenerator.hpp @@ -88,6 +88,7 @@ public: void generateVulkanStructsHppFile() const; void generateVulkanToStringHppFile() const; void prepareRAIIHandles(); + void prepareVulkanFuncs(); private: struct TypeInfo diff --git a/vulkan/vulkan_funcs.hpp b/vulkan/vulkan_funcs.hpp index a1100d2..18c92f0 100644 --- a/vulkan/vulkan_funcs.hpp +++ b/vulkan/vulkan_funcs.hpp @@ -6777,7 +6777,7 @@ namespace VULKAN_HPP_NAMESPACE #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, uint64_t data, @@ -6785,11 +6785,11 @@ namespace VULKAN_HPP_NAMESPACE { VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); return static_cast( - d.vkSetPrivateData( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), data ) ); + d.vkSetPrivateData( m_device, static_cast( objectType_ ), objectHandle, static_cast( privateDataSlot ), data ) ); } #else template - VULKAN_HPP_INLINE typename ResultValueType::type Device::setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, + VULKAN_HPP_INLINE typename ResultValueType::type Device::setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, uint64_t data, @@ -6798,7 +6798,7 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); VkResult result = - d.vkSetPrivateData( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), data ); + d.vkSetPrivateData( m_device, static_cast( objectType_ ), objectHandle, static_cast( privateDataSlot ), data ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setPrivateData" ); return createResultValueType( static_cast( result ) ); @@ -6806,19 +6806,19 @@ namespace VULKAN_HPP_NAMESPACE #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ template - VULKAN_HPP_INLINE void Device::getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, + VULKAN_HPP_INLINE void Device::getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, uint64_t * pData, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT { VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPrivateData( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), pData ); + d.vkGetPrivateData( m_device, static_cast( objectType_ ), objectHandle, static_cast( privateDataSlot ), pData ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t Device::getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t Device::getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT @@ -6826,7 +6826,7 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); uint64_t data; - d.vkGetPrivateData( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), &data ); + d.vkGetPrivateData( m_device, static_cast( objectType_ ), objectHandle, static_cast( privateDataSlot ), &data ); return data; } @@ -9155,7 +9155,7 @@ namespace VULKAN_HPP_NAMESPACE template VULKAN_HPP_INLINE void Instance::debugReportMessageEXT( VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags, - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType, + VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType_, uint64_t object, size_t location, int32_t messageCode, @@ -9166,7 +9166,7 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); d.vkDebugReportMessageEXT( m_instance, static_cast( flags ), - static_cast( objectType ), + static_cast( objectType_ ), object, location, messageCode, @@ -9177,7 +9177,7 @@ namespace VULKAN_HPP_NAMESPACE #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE template VULKAN_HPP_INLINE void Instance::debugReportMessageEXT( VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags, - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType, + VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType_, uint64_t object, size_t location, int32_t messageCode, @@ -9189,7 +9189,7 @@ namespace VULKAN_HPP_NAMESPACE d.vkDebugReportMessageEXT( m_instance, static_cast( flags ), - static_cast( objectType ), + static_cast( objectType_ ), object, location, messageCode, @@ -17928,7 +17928,7 @@ namespace VULKAN_HPP_NAMESPACE #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, uint64_t data, @@ -17936,11 +17936,11 @@ namespace VULKAN_HPP_NAMESPACE { VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); return static_cast( - d.vkSetPrivateDataEXT( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), data ) ); + d.vkSetPrivateDataEXT( m_device, static_cast( objectType_ ), objectHandle, static_cast( privateDataSlot ), data ) ); } #else template - VULKAN_HPP_INLINE typename ResultValueType::type Device::setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, + VULKAN_HPP_INLINE typename ResultValueType::type Device::setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, uint64_t data, @@ -17949,7 +17949,7 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); VkResult result = - d.vkSetPrivateDataEXT( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), data ); + d.vkSetPrivateDataEXT( m_device, static_cast( objectType_ ), objectHandle, static_cast( privateDataSlot ), data ); resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setPrivateDataEXT" ); return createResultValueType( static_cast( result ) ); @@ -17957,19 +17957,19 @@ namespace VULKAN_HPP_NAMESPACE #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ template - VULKAN_HPP_INLINE void Device::getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, + VULKAN_HPP_INLINE void Device::getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, uint64_t * pData, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT { VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPrivateDataEXT( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), pData ); + d.vkGetPrivateDataEXT( m_device, static_cast( objectType_ ), objectHandle, static_cast( privateDataSlot ), pData ); } #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t Device::getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t Device::getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT @@ -17977,7 +17977,7 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); uint64_t data; - d.vkGetPrivateDataEXT( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), &data ); + d.vkGetPrivateDataEXT( m_device, static_cast( objectType_ ), objectHandle, static_cast( privateDataSlot ), &data ); return data; } diff --git a/vulkan/vulkan_handles.hpp b/vulkan/vulkan_handles.hpp index b88ea3e..608030c 100644 --- a/vulkan/vulkan_handles.hpp +++ b/vulkan/vulkan_handles.hpp @@ -9627,14 +9627,14 @@ namespace VULKAN_HPP_NAMESPACE #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE template - VULKAN_HPP_NODISCARD Result setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, + VULKAN_HPP_NODISCARD Result setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, uint64_t data, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; #else template - typename ResultValueType::type setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, + typename ResultValueType::type setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, uint64_t data, @@ -9642,14 +9642,14 @@ namespace VULKAN_HPP_NAMESPACE #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ template - void getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, + void getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, uint64_t * pData, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE template - VULKAN_HPP_NODISCARD uint64_t getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, + VULKAN_HPP_NODISCARD uint64_t getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; @@ -11630,14 +11630,14 @@ namespace VULKAN_HPP_NAMESPACE #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE template - VULKAN_HPP_NODISCARD Result setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, + VULKAN_HPP_NODISCARD Result setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, uint64_t data, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; #else template - typename ResultValueType::type setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, + typename ResultValueType::type setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, uint64_t data, @@ -11645,14 +11645,14 @@ namespace VULKAN_HPP_NAMESPACE #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ template - void getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, + void getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, uint64_t * pData, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE template - VULKAN_HPP_NODISCARD uint64_t getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, + VULKAN_HPP_NODISCARD uint64_t getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, uint64_t objectHandle, VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; @@ -14268,7 +14268,7 @@ namespace VULKAN_HPP_NAMESPACE template void debugReportMessageEXT( VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags, - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType, + VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType_, uint64_t object, size_t location, int32_t messageCode, @@ -14278,7 +14278,7 @@ namespace VULKAN_HPP_NAMESPACE #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE template void debugReportMessageEXT( VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags, - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType, + VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType_, uint64_t object, size_t location, int32_t messageCode,