Skip to content

Commit e5bb757

Browse files
committed
ExtendedTools: Tidy up PresentMon wrapper
1 parent 169f459 commit e5bb757

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

plugins/ExtendedTools/PresentMon/PresentMon.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static void CheckForTerminatedRealtimeProcesses(
4848
)
4949
{
5050
LARGE_INTEGER performanceCounter;
51-
PhQueryPerformanceCounter(&performanceCounter, NULL);
51+
PhQueryPerformanceCounter(&performanceCounter, nullptr);
5252
terminatedProcesses->emplace_back(processId, performanceCounter.QuadPart);
5353

5454
PhClearReference(reinterpret_cast<PVOID*>(&processInfo->ProcessItem));
@@ -347,14 +347,14 @@ VOID PresentMonUpdateProcessStats(
347347

348348
EtAddGpuFrameToHashTable(
349349
ProcessId,
350-
frameLatency,
351-
framesPerSecond,
352-
displayLatency,
353-
displayFramesPerSecond,
354-
msBetweenPresents,
355-
msInPresentApi,
356-
msUntilRenderComplete,
357-
msUntilDisplayed,
350+
static_cast<FLOAT>(frameLatency),
351+
static_cast<FLOAT>(framesPerSecond),
352+
static_cast<FLOAT>(displayLatency),
353+
static_cast<FLOAT>(displayFramesPerSecond),
354+
static_cast<FLOAT>(msBetweenPresents),
355+
static_cast<FLOAT>(msInPresentApi),
356+
static_cast<FLOAT>(msUntilRenderComplete),
357+
static_cast<FLOAT>(msUntilDisplayed),
358358
runtime,
359359
presentMode
360360
);
@@ -427,7 +427,7 @@ VOID StartOutputThread(
427427
{
428428
HANDLE threadHandle;
429429

430-
if (NT_SUCCESS(PhCreateThreadEx(&threadHandle, PresentMonOutputThread, NULL)))
430+
if (NT_SUCCESS(PhCreateThreadEx(&threadHandle, PresentMonOutputThread, nullptr)))
431431
{
432432
PhSetThreadName(threadHandle, L"FpsEtwOutputThread");
433433
NtClose(threadHandle);
@@ -442,7 +442,7 @@ VOID StopOutputThread(
442442
)
443443
{
444444
InterlockedExchange(&QuitOutputThread, 1);
445-
//NtWaitForSingleObject(OutputThreadHandle, FALSE, NULL);
445+
//NtWaitForSingleObject(OutputThreadHandle, FALSE, nullptr);
446446
}
447447

448448
static NTSTATUS PresentMonTraceThread(
@@ -454,7 +454,7 @@ static NTSTATUS PresentMonTraceThread(
454454

455455
while (TRUE)
456456
{
457-
while (!QuitOutputThread && (result = ProcessTrace(&traceHandle, 1, NULL, NULL)) == ERROR_SUCCESS)
457+
while (!QuitOutputThread && (result = ProcessTrace(&traceHandle, 1, nullptr, nullptr)) == ERROR_SUCCESS)
458458
NOTHING;
459459

460460
if (QuitOutputThread)
@@ -480,7 +480,7 @@ VOID StartConsumerThread(
480480
{
481481
HANDLE threadHandle;
482482

483-
if (NT_SUCCESS(PhCreateThreadEx(&threadHandle, PresentMonTraceThread, (PVOID)traceHandle)))
483+
if (NT_SUCCESS(PhCreateThreadEx(&threadHandle, PresentMonTraceThread, reinterpret_cast<PVOID>(traceHandle))))
484484
{
485485
PhSetThreadName(threadHandle, L"FpsEtwConsumerThread");
486486
NtClose(threadHandle);
@@ -495,5 +495,5 @@ VOID WaitForConsumerThreadToExit(
495495
)
496496
{
497497
InterlockedExchange(&QuitOutputThread, 1);
498-
//NtWaitForSingleObject(ConsumerThreadHandle, FALSE, NULL);
498+
//NtWaitForSingleObject(ConsumerThreadHandle, FALSE, nullptr);
499499
}

0 commit comments

Comments
 (0)