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.
This commit is contained in:
Jonathan Glines
2022-12-21 15:01:23 -05:00
committed by Baldur Karlsson
parent 1f2af20458
commit 2b5268b898
8 changed files with 9 additions and 9 deletions
@@ -120,4 +120,4 @@ namespace nv { namespace perf {
}
return SetDeviceClockState(nvperfDeviceIndex, clockSetting);
}
}}
}}
@@ -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<int>(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<int>(strtol(envValue.c_str(), &pEnd, 0));
if (0 <= severity && severity < (int)LogSeverity::COUNT)
{
flushFileSeverity = (LogSeverity)severity;
@@ -330,4 +330,4 @@ namespace nv { namespace perf { namespace profiler {
}
};
}}}
}}}
@@ -162,7 +162,7 @@ namespace nv { namespace perf { namespace profiler {
return true;
}
virtual bool DecodeCounters(std::vector<uint8_t>& counterDataImage, std::vector<uint8_t>& counterDataScratch, bool& onePassDecoded, bool& allPassesDecoded) const
virtual bool DecodeCounters(std::vector<uint8_t>& counterDataImage, std::vector<uint8_t>& 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();
@@ -170,7 +170,7 @@ namespace nv { namespace perf { namespace profiler {
return true;
}
virtual bool DecodeCounters(std::vector<uint8_t>& counterDataImage, std::vector<uint8_t>& counterDataScratch, bool& onePassDecoded, bool& allPassesDecoded) const
virtual bool DecodeCounters(std::vector<uint8_t>& counterDataImage, std::vector<uint8_t>& 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();
@@ -165,7 +165,7 @@ namespace nv { namespace perf { namespace profiler {
}
return true;
}
virtual bool DecodeCounters(std::vector<uint8_t>& counterDataImage, std::vector<uint8_t>& counterDataScratch, bool& onePassDecoded, bool& allPassesDecoded) const
virtual bool DecodeCounters(std::vector<uint8_t>& counterDataImage, std::vector<uint8_t>& 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();
@@ -255,7 +255,7 @@ namespace nv { namespace perf { namespace profiler {
return true;
});
}
virtual bool DecodeCounters(std::vector<uint8_t>& counterDataImage, std::vector<uint8_t>& counterDataScratch, bool& onePassDecoded, bool& allPassesDecoded) const
virtual bool DecodeCounters(std::vector<uint8_t>& counterDataImage, std::vector<uint8_t>& 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;
@@ -773,4 +773,4 @@ namespace nv { namespace perf { namespace sampler {
return true;
}
}}} // nv::perf::sampler
}}} // nv::perf::sampler