From 52a02b5556b22153d2d3972ac7d6f93bb4a7a226 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 26 Apr 2021 21:25:30 -0700 Subject: [PATCH] Code review feedback --- Texconv/texconv.cpp | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/Texconv/texconv.cpp b/Texconv/texconv.cpp index 6ef176d..e031704 100644 --- a/Texconv/texconv.cpp +++ b/Texconv/texconv.cpp @@ -1853,17 +1853,11 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) mipLevels = 1; } - LARGE_INTEGER qpcFreq; - if (!QueryPerformanceFrequency(&qpcFreq)) - { - qpcFreq.QuadPart = 0; - } + LARGE_INTEGER qpcFreq = {}; + (void)QueryPerformanceFrequency(&qpcFreq); - LARGE_INTEGER qpcStart; - if (!QueryPerformanceCounter(&qpcStart)) - { - qpcStart.QuadPart = 0; - } + LARGE_INTEGER qpcStart = {}; + (void)QueryPerformanceCounter(&qpcStart); // Convert images bool sizewarn = false; @@ -3599,12 +3593,11 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) if (dwOptions & (uint64_t(1) << OPT_TIMING)) { - LARGE_INTEGER qpcEnd; - if (QueryPerformanceCounter(&qpcEnd)) - { - LONGLONG delta = qpcEnd.QuadPart - qpcStart.QuadPart; - wprintf(L"\n Processing time: %f seconds\n", double(delta) / double(qpcFreq.QuadPart)); - } + LARGE_INTEGER qpcEnd = {}; + (void)QueryPerformanceCounter(&qpcEnd); + + LONGLONG delta = qpcEnd.QuadPart - qpcStart.QuadPart; + wprintf(L"\n Processing time: %f seconds\n", double(delta) / double(qpcFreq.QuadPart)); } return retVal;