From 54d356e2f33a4ebe570bbbf1136946790215b635 Mon Sep 17 00:00:00 2001 From: Menno Vink Date: Sun, 27 Mar 2022 17:48:07 +0200 Subject: [PATCH 1/2] C4062 fix --- include/vk_mem_alloc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 2cf4094..b74232a 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -13841,6 +13841,9 @@ bool VmaDefragmentationContext_T::ComputeDefragmentation_Extensive(VmaBlockVecto } break; } + case StateExtensive::Operation::Cleanup: + // Cleanup is handled below so that other operations may reuse the cleanup code. This case is here to prevent the unhandled enum value warning (C4062). + break; } if (vectorState.operation == StateExtensive::Operation::Cleanup) From 11cbcfcfc547bdb7a2132701cb63234f210d0ac9 Mon Sep 17 00:00:00 2001 From: Menno Vink Date: Sun, 27 Mar 2022 18:34:29 +0200 Subject: [PATCH 2/2] Simplify the code to keep xcode happy --- include/vk_mem_alloc.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index b74232a..c424ab9 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -5879,9 +5879,14 @@ private: void PostMinorCounter() { if(m_MinorCounter < m_MajorCounter) + { ++m_MinorCounter; + } else if(m_MajorCounter > 0) - --m_MajorCounter, --m_MinorCounter; + { + --m_MajorCounter; + --m_MinorCounter; + } } };