Skip to content

Commit abf747a

Browse files
Removed hack for clang compiler error. It didn't work anyway.
1 parent 655b87f commit abf747a

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/vk_mem_alloc.h

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3061,29 +3061,21 @@ static void VmaWriteMagicValue(void* pData, VkDeviceSize offset)
30613061
{
30623062
uint32_t* pDst = (uint32_t*)((char*)pData + offset);
30633063
const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
3064-
// This condition is to silence clang compiler error: "comparison of unsigned expression < 0 is always false"
3065-
if(numberCount > 0)
3064+
for(size_t i = 0; i < numberCount; ++i, ++pDst)
30663065
{
3067-
for(size_t i = 0; i < numberCount; ++i, ++pDst)
3068-
{
3069-
*pDst = VMA_CORRUPTION_DETECTION_MAGIC_VALUE;
3070-
}
3066+
*pDst = VMA_CORRUPTION_DETECTION_MAGIC_VALUE;
30713067
}
30723068
}
30733069

30743070
static bool VmaValidateMagicValue(const void* pData, VkDeviceSize offset)
30753071
{
30763072
const uint32_t* pSrc = (const uint32_t*)((const char*)pData + offset);
30773073
const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
3078-
// This condition is to silence clang compiler error: "comparison of unsigned expression < 0 is always false"
3079-
if(numberCount > 0)
3074+
for(size_t i = 0; i < numberCount; ++i, ++pSrc)
30803075
{
3081-
for(size_t i = 0; i < numberCount; ++i, ++pSrc)
3076+
if(*pSrc != VMA_CORRUPTION_DETECTION_MAGIC_VALUE)
30823077
{
3083-
if(*pSrc != VMA_CORRUPTION_DETECTION_MAGIC_VALUE)
3084-
{
3085-
return false;
3086-
}
3078+
return false;
30873079
}
30883080
}
30893081
return true;

0 commit comments

Comments
 (0)