diff --git a/DDSView/ddsview.cpp b/DDSView/ddsview.cpp index dc8f75d..3c0ca27 100644 --- a/DDSView/ddsview.cpp +++ b/DDSView/ddsview.cpp @@ -115,7 +115,7 @@ int WINAPI wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, HRESULT hr = GetMetadataFromDDSFile( lpCmdLine, DDS_FLAGS_NONE, mdata ); if ( FAILED(hr) ) { - wchar_t buff[2048] = { 0 }; + wchar_t buff[2048] = {}; swprintf_s( buff, L"Failed to open texture file\n\nFilename = %ls\nHRESULT %08X", lpCmdLine, hr ); MessageBox( nullptr, buff, L"DDSView", MB_OK | MB_ICONEXCLAMATION ); return 0; @@ -136,7 +136,7 @@ int WINAPI wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, { if ( mdata.arraySize > 1 ) { - wchar_t buff[2048] = { 0 }; + wchar_t buff[2048] = {}; swprintf_s( buff, L"Arrays of volume textures are not supported\n\nFilename = %ls\nArray size %Iu", lpCmdLine, mdata.arraySize ); MessageBox( nullptr, buff, L"DDSView", MB_OK | MB_ICONEXCLAMATION ); return 0; @@ -159,7 +159,7 @@ int WINAPI wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, case DXGI_FORMAT_BC7_UNORM_SRGB: if ( g_featureLevel < D3D_FEATURE_LEVEL_11_0 ) { - wchar_t buff[2048] = { 0 }; + wchar_t buff[2048] = {}; swprintf_s( buff, L"BC6H/BC7 requires DirectX 11 hardware\n\nFilename = %ls\nDXGI Format %d\nFeature Level %d", lpCmdLine, mdata.format, g_featureLevel ); MessageBox( nullptr, buff, L"DDSView", MB_OK | MB_ICONEXCLAMATION ); return 0; @@ -172,7 +172,7 @@ int WINAPI wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, hr = g_pd3dDevice->CheckFormatSupport ( mdata.format, &flags ); if ( FAILED(hr) || !(flags & (D3D11_FORMAT_SUPPORT_TEXTURE1D|D3D11_FORMAT_SUPPORT_TEXTURE2D|D3D11_FORMAT_SUPPORT_TEXTURE3D)) ) { - wchar_t buff[2048] = { 0 }; + wchar_t buff[2048] = {}; swprintf_s( buff, L"Format not supported by DirectX hardware\n\nFilename = %ls\nDXGI Format %d\nFeature Level %d\nHRESULT = %08X", lpCmdLine, mdata.format, g_featureLevel, hr ); MessageBox( nullptr, buff, L"DDSView", MB_OK | MB_ICONEXCLAMATION ); return 0; @@ -185,7 +185,7 @@ int WINAPI wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, hr = LoadFromDDSFile( lpCmdLine, DDS_FLAGS_NONE, &mdata, image ); if ( FAILED(hr) ) { - wchar_t buff[2048] = { 0 }; + wchar_t buff[2048] = {}; swprintf_s( buff, L"Failed to load texture file\n\nFilename = %ls\nHRESULT %08X", lpCmdLine, hr ); MessageBox( nullptr, buff, L"DDSView", MB_OK | MB_ICONEXCLAMATION ); return 0; @@ -197,14 +197,14 @@ int WINAPI wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, hr = CreateShaderResourceView( g_pd3dDevice, image.GetImages(), image.GetImageCount(), mdata, &g_pSRV ); if ( FAILED(hr) ) { - wchar_t buff[2048] = { 0 }; + wchar_t buff[2048] = {}; swprintf_s( buff, L"Failed creating texture from file\n\nFilename = %ls\nHRESULT = %08X", lpCmdLine, hr ); MessageBox( nullptr, buff, L"DDSView", MB_OK | MB_ICONEXCLAMATION ); return 0; } // Main message loop - MSG msg = {0}; + MSG msg = {}; while( WM_QUIT != msg.message ) { if( PeekMessage( &msg, nullptr, 0, 0, PM_REMOVE ) ) diff --git a/DirectXTex/DirectXTexDDS.cpp b/DirectXTex/DirectXTexDDS.cpp index 9f68568..30de6b1 100644 --- a/DirectXTex/DirectXTexDDS.cpp +++ b/DirectXTex/DirectXTexDDS.cpp @@ -550,7 +550,7 @@ HRESULT DirectX::_EncodeDDSHeader( flags |= DDS_FLAGS_FORCE_DX10_EXT; } - DDS_PIXELFORMAT ddpf = { 0 }; + DDS_PIXELFORMAT ddpf = {}; if (!(flags & DDS_FLAGS_FORCE_DX10_EXT)) { switch (metadata.format) diff --git a/DirectXTex/DirectXTexResize.cpp b/DirectXTex/DirectXTexResize.cpp index 49c723f..8eb907f 100644 --- a/DirectXTex/DirectXTexResize.cpp +++ b/DirectXTex/DirectXTexResize.cpp @@ -928,7 +928,7 @@ HRESULT DirectX::Resize( bool usewic = !metadata.IsPMAlpha() && UseWICFiltering(metadata.format, filter); - WICPixelFormatGUID pfGUID = { 0 }; + WICPixelFormatGUID pfGUID = {}; bool wicpf = (usewic) ? _DXGIToWIC(metadata.format, pfGUID, true) : false; switch (metadata.dimension) diff --git a/DirectXTex/DirectXTexWIC.cpp b/DirectXTex/DirectXTexWIC.cpp index 3132baf..b10376c 100644 --- a/DirectXTex/DirectXTexWIC.cpp +++ b/DirectXTex/DirectXTexWIC.cpp @@ -801,7 +801,7 @@ namespace if (memcmp(&containerFormat, &GUID_ContainerFormatBmp, sizeof(WICPixelFormatGUID)) == 0 && iswic2) { // Opt-in to the WIC2 support for writing 32-bit Windows BMP files with an alpha channel - PROPBAG2 option = { 0 }; + PROPBAG2 option = {}; option.pstrName = const_cast(L"EnableV5Header32bppBGRA"); VARIANT varValue; @@ -1043,7 +1043,7 @@ HRESULT DirectX::LoadFromWICMemory( // Get metadata TexMetadata mdata; - WICPixelFormatGUID convertGUID = { 0 }; + WICPixelFormatGUID convertGUID = {}; hr = DecodeMetadata(flags, iswic2, decoder.Get(), frame.Get(), mdata, &convertGUID, getMQR); if (FAILED(hr)) return hr; @@ -1104,7 +1104,7 @@ HRESULT DirectX::LoadFromWICFile( // Get metadata TexMetadata mdata; - WICPixelFormatGUID convertGUID = { 0 }; + WICPixelFormatGUID convertGUID = {}; hr = DecodeMetadata(flags, iswic2, decoder.Get(), frame.Get(), mdata, &convertGUID, getMQR); if (FAILED(hr)) return hr; @@ -1170,7 +1170,7 @@ HRESULT DirectX::SaveToWICMemory( if (FAILED(hr)) return hr; - LARGE_INTEGER li = { { 0 } }; + LARGE_INTEGER li = {}; hr = stream->Seek(li, STREAM_SEEK_SET, 0); if (FAILED(hr)) return hr; @@ -1227,7 +1227,7 @@ HRESULT DirectX::SaveToWICMemory( if (FAILED(hr)) return hr; - LARGE_INTEGER li = { { 0 } }; + LARGE_INTEGER li = {}; hr = stream->Seek(li, STREAM_SEEK_SET, 0); if (FAILED(hr)) return hr; diff --git a/DirectXTex/d3dx12.h b/DirectXTex/d3dx12.h index c2c8269..e28e539 100644 --- a/DirectXTex/d3dx12.h +++ b/DirectXTex/d3dx12.h @@ -2600,7 +2600,7 @@ inline HRESULT D3DX12ParsePipelineStream(const D3D12_PIPELINE_STATE_STREAM_DESC& return E_INVALIDARG; } - bool SubobjectSeen[D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID] = {0}; + bool SubobjectSeen[D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID] = {}; for (SIZE_T CurOffset = 0, SizeOfSubobject = 0; CurOffset < Desc.SizeInBytes; CurOffset += SizeOfSubobject) { BYTE* pStream = static_cast(Desc.pPipelineStateSubobjectStream)+CurOffset; diff --git a/DirectXTex/scoped.h b/DirectXTex/scoped.h index 6e553c7..d35c4f0 100644 --- a/DirectXTex/scoped.h +++ b/DirectXTex/scoped.h @@ -49,7 +49,7 @@ public: { if (m_handle) { - FILE_DISPOSITION_INFO info = { 0 }; + FILE_DISPOSITION_INFO info = {}; info.DeleteFile = TRUE; (void)SetFileInformationByHandle(m_handle, FileDispositionInfo, &info, sizeof(info)); } diff --git a/ScreenGrab/ScreenGrab12.cpp b/ScreenGrab/ScreenGrab12.cpp index ccab1a4..ff21dee 100644 --- a/ScreenGrab/ScreenGrab12.cpp +++ b/ScreenGrab/ScreenGrab12.cpp @@ -211,7 +211,7 @@ namespace { if (m_handle) { - FILE_DISPOSITION_INFO info = {0}; + FILE_DISPOSITION_INFO info = {}; info.DeleteFile = TRUE; (void)SetFileInformationByHandle(m_handle, FileDispositionInfo, &info, sizeof(info)); } diff --git a/Texassemble/texassemble.cpp b/Texassemble/texassemble.cpp index 585a27b..b8bafd4 100644 --- a/Texassemble/texassemble.cpp +++ b/Texassemble/texassemble.cpp @@ -526,7 +526,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) DWORD dwFilterOpts = 0; DWORD CrossFileType = WIC_CODEC_BMP; - wchar_t szOutputFile[MAX_PATH] = { 0 }; + wchar_t szOutputFile[MAX_PATH] = {}; // Initialize COM (needed for WIC) HRESULT hr = hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); diff --git a/Texdiag/texdiag.cpp b/Texdiag/texdiag.cpp index 518ce79..f363d7d 100644 --- a/Texdiag/texdiag.cpp +++ b/Texdiag/texdiag.cpp @@ -2977,7 +2977,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) int pixely = -1; DXGI_FORMAT diffFormat = DXGI_FORMAT_B8G8R8A8_UNORM; DWORD diffFileType = WIC_CODEC_BMP; - wchar_t szOutputFile[MAX_PATH] = { 0 }; + wchar_t szOutputFile[MAX_PATH] = {}; // Initialize COM (needed for WIC) HRESULT hr = hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);