Handle potential shadowing of function parameter name "objectType" with class member. (#1476)

This commit is contained in:
Andreas Süßenbach 2023-01-09 11:32:23 +01:00 committed by GitHub
parent c4343f6ed8
commit 5e8166e284
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 31 deletions

View File

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

View File

@ -88,6 +88,7 @@ public:
void generateVulkanStructsHppFile() const;
void generateVulkanToStringHppFile() const;
void prepareRAIIHandles();
void prepareVulkanFuncs();
private:
struct TypeInfo

View File

@ -6777,7 +6777,7 @@ namespace VULKAN_HPP_NAMESPACE
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
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<Result>(
d.vkSetPrivateData( m_device, static_cast<VkObjectType>( objectType ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), data ) );
d.vkSetPrivateData( m_device, static_cast<VkObjectType>( objectType_ ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), data ) );
}
#else
template <typename Dispatch>
VULKAN_HPP_INLINE typename ResultValueType<void>::type Device::setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType,
VULKAN_HPP_INLINE typename ResultValueType<void>::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<VkObjectType>( objectType ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), data );
d.vkSetPrivateData( m_device, static_cast<VkObjectType>( objectType_ ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), data );
resultCheck( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setPrivateData" );
return createResultValueType( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ) );
@ -6806,19 +6806,19 @@ namespace VULKAN_HPP_NAMESPACE
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
template <typename Dispatch>
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<VkObjectType>( objectType ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), pData );
d.vkGetPrivateData( m_device, static_cast<VkObjectType>( objectType_ ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), pData );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
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<VkObjectType>( objectType ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), &data );
d.vkGetPrivateData( m_device, static_cast<VkObjectType>( objectType_ ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), &data );
return data;
}
@ -9155,7 +9155,7 @@ namespace VULKAN_HPP_NAMESPACE
template <typename Dispatch>
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<VkDebugReportFlagsEXT>( flags ),
static_cast<VkDebugReportObjectTypeEXT>( objectType ),
static_cast<VkDebugReportObjectTypeEXT>( objectType_ ),
object,
location,
messageCode,
@ -9177,7 +9177,7 @@ namespace VULKAN_HPP_NAMESPACE
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
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<VkDebugReportFlagsEXT>( flags ),
static_cast<VkDebugReportObjectTypeEXT>( objectType ),
static_cast<VkDebugReportObjectTypeEXT>( objectType_ ),
object,
location,
messageCode,
@ -17928,7 +17928,7 @@ namespace VULKAN_HPP_NAMESPACE
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
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<Result>(
d.vkSetPrivateDataEXT( m_device, static_cast<VkObjectType>( objectType ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), data ) );
d.vkSetPrivateDataEXT( m_device, static_cast<VkObjectType>( objectType_ ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), data ) );
}
#else
template <typename Dispatch>
VULKAN_HPP_INLINE typename ResultValueType<void>::type Device::setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType,
VULKAN_HPP_INLINE typename ResultValueType<void>::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<VkObjectType>( objectType ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), data );
d.vkSetPrivateDataEXT( m_device, static_cast<VkObjectType>( objectType_ ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), data );
resultCheck( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setPrivateDataEXT" );
return createResultValueType( static_cast<VULKAN_HPP_NAMESPACE::Result>( result ) );
@ -17957,19 +17957,19 @@ namespace VULKAN_HPP_NAMESPACE
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
template <typename Dispatch>
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<VkObjectType>( objectType ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), pData );
d.vkGetPrivateDataEXT( m_device, static_cast<VkObjectType>( objectType_ ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), pData );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
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<VkObjectType>( objectType ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), &data );
d.vkGetPrivateDataEXT( m_device, static_cast<VkObjectType>( objectType_ ), objectHandle, static_cast<VkPrivateDataSlot>( privateDataSlot ), &data );
return data;
}

View File

@ -9627,14 +9627,14 @@ namespace VULKAN_HPP_NAMESPACE
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
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 Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
typename ResultValueType<void>::type setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType,
typename ResultValueType<void>::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 <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
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 <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
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 <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
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 Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
typename ResultValueType<void>::type setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType,
typename ResultValueType<void>::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 <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
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 <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
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 <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
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 <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
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,