Two fixes for "Portability issues" Issue #5 thanks @rextimmy!

This commit is contained in:
Adam Sawicki 2017-08-08 11:40:31 +02:00
parent ea6da94c24
commit e97e9b6637
2 changed files with 20 additions and 15 deletions

Binary file not shown.

View File

@ -836,11 +836,11 @@ remove them if not needed.
#if VMA_STATS_STRING_ENABLED #if VMA_STATS_STRING_ENABLED
static inline void VmaUint32ToStr(char* outStr, size_t strLen, uint32_t num) static inline void VmaUint32ToStr(char* outStr, size_t strLen, uint32_t num)
{ {
snprintf(outStr, strLen, "%u", num); snprintf(outStr, strLen, "%u", static_cast<unsigned int>(num));
} }
static inline void VmaUint64ToStr(char* outStr, size_t strLen, uint64_t num) static inline void VmaUint64ToStr(char* outStr, size_t strLen, uint64_t num)
{ {
snprintf(outStr, strLen, "%llu", num); snprintf(outStr, strLen, "%llu", static_cast<unsigned long long>(num));
} }
#endif #endif
@ -2297,14 +2297,12 @@ private:
ALLOCATION_TYPE m_Type; ALLOCATION_TYPE m_Type;
VmaSuballocationType m_SuballocationType; VmaSuballocationType m_SuballocationType;
union
{
// Allocation out of VmaBlock. // Allocation out of VmaBlock.
struct BlockAllocation struct BlockAllocation
{ {
VmaBlock* m_Block; VmaBlock* m_Block;
VkDeviceSize m_Offset; VkDeviceSize m_Offset;
} m_BlockAllocation; };
// Allocation for an object that has its own private VkDeviceMemory. // Allocation for an object that has its own private VkDeviceMemory.
struct OwnAllocation struct OwnAllocation
@ -2313,7 +2311,14 @@ private:
VkDeviceMemory m_hMemory; VkDeviceMemory m_hMemory;
bool m_PersistentMap; bool m_PersistentMap;
void* m_pMappedData; void* m_pMappedData;
} m_OwnAllocation; };
union
{
// Allocation out of VmaBlock.
BlockAllocation m_BlockAllocation;
// Allocation for an object that has its own private VkDeviceMemory.
OwnAllocation m_OwnAllocation;
}; };
}; };