From 2b5268b898f577aefecb85649a5b5673ed9b2711 Mon Sep 17 00:00:00 2001 From: Jonathan Glines Date: Wed, 21 Dec 2022 15:01:23 -0500 Subject: [PATCH] Fix Clang 12 compile errors for NvPerfUtility headers Compile errors include missing EOL newline, missing override keyword for member function, and implicit long to int conversion. --- .../redist/NvPerfUtility/include/NvPerfDeviceProperties.h | 2 +- .../PerfSDK/redist/NvPerfUtility/include/NvPerfInit.h | 4 ++-- .../redist/NvPerfUtility/include/NvPerfRangeProfiler.h | 2 +- .../redist/NvPerfUtility/include/NvPerfRangeProfilerD3D11.h | 2 +- .../redist/NvPerfUtility/include/NvPerfRangeProfilerD3D12.h | 2 +- .../redist/NvPerfUtility/include/NvPerfRangeProfilerOpenGL.h | 2 +- .../redist/NvPerfUtility/include/NvPerfRangeProfilerVulkan.h | 2 +- .../PerfSDK/redist/NvPerfUtility/include/NvPerfVulkan.h | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfDeviceProperties.h b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfDeviceProperties.h index f4c36a588..6338277cc 100644 --- a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfDeviceProperties.h +++ b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfDeviceProperties.h @@ -120,4 +120,4 @@ namespace nv { namespace perf { } return SetDeviceClockState(nvperfDeviceIndex, clockSetting); } -}} \ No newline at end of file +}} diff --git a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfInit.h b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfInit.h index 8d674df43..015d128b0 100644 --- a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfInit.h +++ b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfInit.h @@ -121,7 +121,7 @@ namespace nv { namespace perf { inline size_t FormatTime(LogTimeStamp* pTimestamp, char* pBuf, size_t size) { const struct tm* ltm = localtime(&pTimestamp->tv_sec); - int milliseconds = pTimestamp->tv_usec / 1000; + int milliseconds = static_cast(pTimestamp->tv_usec / 1000); return FormatTimeCommon(pBuf, size, (uint32_t)ltm->tm_hour, (uint32_t)ltm->tm_min, (uint32_t)ltm->tm_sec, (uint32_t)milliseconds); } @@ -225,7 +225,7 @@ namespace nv { namespace perf { if (GetEnvVariable("NV_PERF_LOG_FILE_FLUSH_SEVERITY", envValue)) { char* pEnd = nullptr; - int severity = strtol(envValue.c_str(), &pEnd, 0); + int severity = static_cast(strtol(envValue.c_str(), &pEnd, 0)); if (0 <= severity && severity < (int)LogSeverity::COUNT) { flushFileSeverity = (LogSeverity)severity; diff --git a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfiler.h b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfiler.h index 809092684..eb397f331 100644 --- a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfiler.h +++ b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfiler.h @@ -330,4 +330,4 @@ namespace nv { namespace perf { namespace profiler { } }; -}}} \ No newline at end of file +}}} diff --git a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerD3D11.h b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerD3D11.h index d16159576..0a502a08f 100644 --- a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerD3D11.h +++ b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerD3D11.h @@ -162,7 +162,7 @@ namespace nv { namespace perf { namespace profiler { return true; } - virtual bool DecodeCounters(std::vector& counterDataImage, std::vector& counterDataScratch, bool& onePassDecoded, bool& allPassesDecoded) const + virtual bool DecodeCounters(std::vector& counterDataImage, std::vector& counterDataScratch, bool& onePassDecoded, bool& allPassesDecoded) const override { NVPW_D3D11_Profiler_DeviceContext_DecodeCounters_Params decodeParams = { NVPW_D3D11_Profiler_DeviceContext_DecodeCounters_Params_STRUCT_SIZE }; decodeParams.pDeviceContext = pDeviceContext.Get(); diff --git a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerD3D12.h b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerD3D12.h index 6eca8a343..257ccefd4 100644 --- a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerD3D12.h +++ b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerD3D12.h @@ -170,7 +170,7 @@ namespace nv { namespace perf { namespace profiler { return true; } - virtual bool DecodeCounters(std::vector& counterDataImage, std::vector& counterDataScratch, bool& onePassDecoded, bool& allPassesDecoded) const + virtual bool DecodeCounters(std::vector& counterDataImage, std::vector& counterDataScratch, bool& onePassDecoded, bool& allPassesDecoded) const override { NVPW_D3D12_Profiler_Queue_DecodeCounters_Params decodeParams = { NVPW_D3D12_Profiler_Queue_DecodeCounters_Params_STRUCT_SIZE }; decodeParams.pCommandQueue = pCommandQueue.Get(); diff --git a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerOpenGL.h b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerOpenGL.h index ce7f26f1c..b0b99281f 100644 --- a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerOpenGL.h +++ b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerOpenGL.h @@ -165,7 +165,7 @@ namespace nv { namespace perf { namespace profiler { } return true; } - virtual bool DecodeCounters(std::vector& counterDataImage, std::vector& counterDataScratch, bool& onePassDecoded, bool& allPassesDecoded) const + virtual bool DecodeCounters(std::vector& counterDataImage, std::vector& counterDataScratch, bool& onePassDecoded, bool& allPassesDecoded) const override { NVPW_OpenGL_Profiler_GraphicsContext_DecodeCounters_Params decodeParams = { NVPW_OpenGL_Profiler_GraphicsContext_DecodeCounters_Params_STRUCT_SIZE }; decodeParams.counterDataImageSize = counterDataImage.size(); diff --git a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerVulkan.h b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerVulkan.h index e54d6c292..852efe6f4 100644 --- a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerVulkan.h +++ b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfRangeProfilerVulkan.h @@ -255,7 +255,7 @@ namespace nv { namespace perf { namespace profiler { return true; }); } - virtual bool DecodeCounters(std::vector& counterDataImage, std::vector& counterDataScratch, bool& onePassDecoded, bool& allPassesDecoded) const + virtual bool DecodeCounters(std::vector& counterDataImage, std::vector& counterDataScratch, bool& onePassDecoded, bool& allPassesDecoded) const override { NVPW_VK_Profiler_Queue_DecodeCounters_Params decodeParams = { NVPW_VK_Profiler_Queue_DecodeCounters_Params_STRUCT_SIZE }; decodeParams.queue = queue; diff --git a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfVulkan.h b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfVulkan.h index d7a1b0b1d..7e21e8859 100644 --- a/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfVulkan.h +++ b/renderdoc/driver/ihv/nv/official/PerfSDK/redist/NvPerfUtility/include/NvPerfVulkan.h @@ -773,4 +773,4 @@ namespace nv { namespace perf { namespace sampler { return true; } -}}} // nv::perf::sampler \ No newline at end of file +}}} // nv::perf::sampler