From 7918e9af5ee7abfe88be3d262b8bb1809e632526 Mon Sep 17 00:00:00 2001 From: Stephen Saunders Date: Wed, 5 May 2021 12:33:53 -0400 Subject: [PATCH] Fixed uint64_t print formatting in Allocator_VK.cpp --- neo/renderer/Vulkan/Allocator_VK.cpp | 35 ++++++++-------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/neo/renderer/Vulkan/Allocator_VK.cpp b/neo/renderer/Vulkan/Allocator_VK.cpp index 40809021..d184e23f 100644 --- a/neo/renderer/Vulkan/Allocator_VK.cpp +++ b/neo/renderer/Vulkan/Allocator_VK.cpp @@ -497,14 +497,9 @@ void idVulkanBlock::Print() idLib::Printf( "Usage: %s\n", memoryUsageStrings[ usage ] ); idLib::Printf( "Count: %d\n", count ); - // RB: FIXME different sizes of VulkanDeviceSize on different platforms? -#if defined(__APPLE__) - idLib::Printf( "Size: %llu\n", size ); - idLib::Printf( "Allocated: %llu\n", allocated ); -#else - idLib::Printf( "Size: %lu\n", size ); - idLib::Printf( "Allocated: %lu\n", allocated ); -#endif + // SRS - Changed %lu to %PRIu64 pre-defined macro to handle platform differences + idLib::Printf( "Size: %" PRIu64"\n", size ); + idLib::Printf( "Allocated: %" PRIu64"\n", allocated ); idLib::Printf( "Next Block: %u\n", nextBlockId ); idLib::Printf( "------------------------\n" ); @@ -513,13 +508,9 @@ void idVulkanBlock::Print() idLib::Printf( "{\n" ); idLib::Printf( "\tId: %u\n", current->id ); -#if defined(__APPLE__) - idLib::Printf( "\tSize: %llu\n", current->size ); - idLib::Printf( "\tOffset: %llu\n", current->offset ); -#else - idLib::Printf( "\tSize: %lu\n", current->size ); - idLib::Printf( "\tOffset: %lu\n", current->offset ); -#endif + // SRS - Changed %lu to %PRIu64 pre-defined macro to handle platform differences + idLib::Printf( "\tSize: %" PRIu64"\n", current->size ); + idLib::Printf( "\tOffset: %" PRIu64"\n", current->offset ); idLib::Printf( "\tType: %s\n", allocationTypeStrings[ current->type ] ); idLib::Printf( "}\n" ); @@ -692,11 +683,8 @@ void idVulkanAllocator::Print() { idLib::Printf( "Device Local MB: %d\n", int( deviceLocalMemoryBytes / 1024 * 1024 ) ); idLib::Printf( "Host Visible MB: %d\n", int( hostVisibleMemoryBytes / 1024 * 1024 ) ); -#if defined(__APPLE__) - idLib::Printf( "Buffer Granularity: %llu\n", bufferImageGranularity ); -#else - idLib::Printf( "Buffer Granularity: %lu\n", bufferImageGranularity ); -#endif + // SRS - Changed %lu to %PRIu64 pre-defined macro to handle platform differences + idLib::Printf( "Buffer Granularity: %" PRIu64"\n", bufferImageGranularity ); idLib::Printf( "\n" ); for( int i = 0; i < VK_MAX_MEMORY_TYPES; ++i ) @@ -720,11 +708,8 @@ CONSOLE_COMMAND( Vulkan_PrintHeapInfo, "Print out the heap information for this { VkMemoryHeap heap = props.memoryHeaps[ i ]; -#if defined(__APPLE__) - idLib::Printf( "id=%d, size=%llu, flags=", i, heap.size ); -#else - idLib::Printf( "id=%d, size=%lu, flags=", i, heap.size ); -#endif + // SRS - Changed %lu to %PRIu64 pre-defined macro to handle platform differences + idLib::Printf( "id=%d, size=%" PRIu64", flags=", i, heap.size ); if( heap.flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT ) { idLib::Printf( "DEVICE_LOCAL" );