Skip to content

Commit

Permalink
Fix ptrdiff vs size_t sign warnings
Browse files Browse the repository at this point in the history
Cosmetic changes
  • Loading branch information
darksylinc committed Nov 26, 2024
1 parent 969f6cc commit c381f7e
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions RenderSystems/Vulkan/src/OgreVulkanDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ namespace Ogre
vkEnumerateInstanceExtensionProperties( 0, &numExtensions, availableExtensions.begin() );
checkVkResult( result, "vkEnumerateInstanceExtensionProperties" );

for( auto &ext : availableExtensions )
for( const VkExtensionProperties &ext : availableExtensions )
{
LogManager::getSingleton().logMessage( "Vulkan: Found instance extension: " +
String( ext.extensionName ) );
String( ext.extensionName ) );
}

// Enumerate supported layers
FastArray<VkLayerProperties> availableLayers;
Expand Down Expand Up @@ -188,15 +190,15 @@ namespace Ogre
" is present but it's not. This is normal. Ignoring." );
return true;
};
auto &eix = externalInstance->instanceExtensions;
eix.resize( std::remove_if( eix.begin(), eix.end(), extFilter ) - eix.begin() );
FastArray<VkExtensionProperties> &eix = externalInstance->instanceExtensions;
eix.resize( size_t( std::remove_if( eix.begin(), eix.end(), extFilter ) - eix.begin() ) );
availableExtensions = eix;
for( auto &ext : eix )
for( const VkExtensionProperties &ext : eix )
enabledExtensions.push_back( ext.extensionName );

// Filter wrongly-provided layers
std::set<String> layers;
for( auto &layer : availableLayers )
for( const VkLayerProperties &layer : availableLayers )
layers.insert( layer.layerName );
auto layerFilter = [&layers]( const VkLayerProperties &elem ) {
if( layers.find( elem.layerName ) != layers.end() )
Expand All @@ -206,10 +208,10 @@ namespace Ogre
" is present but it's not. This is normal. Ignoring." );
return true;
};
auto &eil = externalInstance->instanceLayers;
eil.resize( std::remove_if( eil.begin(), eil.end(), layerFilter ) - eil.begin() );
FastArray<VkLayerProperties> &eil = externalInstance->instanceLayers;
eil.resize( size_t( std::remove_if( eil.begin(), eil.end(), layerFilter ) - eil.begin() ) );
availableLayers = eil;
for( auto &layer : eil )
for( VkLayerProperties &layer : eil )
enabledLayers.push_back( layer.layerName );

#if OGRE_DEBUG_MODE >= OGRE_DEBUG_HIGH
Expand Down Expand Up @@ -720,7 +722,7 @@ namespace Ogre
return true;
};
FastArray<VkExtensionProperties> edx = externalDevice->deviceExtensions;
edx.resize( std::remove_if( edx.begin(), edx.end(), extFilter ) - edx.begin() );
edx.resize( size_t( std::remove_if( edx.begin(), edx.end(), extFilter ) - edx.begin() ) );

mDeviceExtensions.reserve( edx.size() );
for( auto &ext : edx )
Expand Down

0 comments on commit c381f7e

Please sign in to comment.