From 2c7b5e8298b1f5a2c8263fd164a3c01ade20c32d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=92=80=E5=A2=83=E7=9F=B3?= Date: Thu, 24 Aug 2023 11:20:55 +0800 Subject: [PATCH] fix potential compile errors if strict mode (/permissive-) is enabled --- src/D3D12Sample.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/D3D12Sample.cpp b/src/D3D12Sample.cpp index b5ce491..705cff1 100644 --- a/src/D3D12Sample.cpp +++ b/src/D3D12Sample.cpp @@ -1801,13 +1801,14 @@ int Main2(int argc, wchar_t** argv) return (int)ExitCode::Help; } - std::unique_ptr DXGIUsage(new DXGIUsage()); - DXGIUsage->Init(); - g_DXGIUsage = DXGIUsage.get(); + // variable name should not same as class name + std::unique_ptr dxgiUsage = std::make_unique(); + dxgiUsage->Init(); + g_DXGIUsage = dxgiUsage.get(); if(g_CommandLineParameters.m_List) { - DXGIUsage->PrintAdapterList(); + dxgiUsage->PrintAdapterList(); return (int)ExitCode::GPUList; }