1
0
mirror of https://github.com/microsoft/DirectXTex synced 2024-12-26 03:11:02 +00:00

Minor code review

This commit is contained in:
Chuck Walbourn 2020-01-17 12:20:39 -08:00
parent a2cb6fa763
commit 20a685d62f
5 changed files with 25 additions and 10 deletions

View File

@ -277,10 +277,13 @@ IWICImagingFactory* DirectX::GetWICFactory(bool& iswic2) noexcept
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
InitOnceExecuteOnce(&s_initOnce,
if (!InitOnceExecuteOnce(&s_initOnce,
InitializeWICFactory,
nullptr,
reinterpret_cast<LPVOID*>(&g_Factory));
reinterpret_cast<LPVOID*>(&g_Factory)))
{
return nullptr;
}
iswic2 = g_WIC2;
return g_Factory;

View File

@ -751,10 +751,13 @@ namespace
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
IWICImagingFactory* factory = nullptr;
InitOnceExecuteOnce(&s_initOnce,
if (!InitOnceExecuteOnce(&s_initOnce,
InitializeWICFactory,
nullptr,
reinterpret_cast<LPVOID*>(&factory));
reinterpret_cast<LPVOID*>(&factory)))
{
return nullptr;
}
return factory;
}

View File

@ -828,10 +828,13 @@ namespace
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
IWICImagingFactory2* factory = nullptr;
(void)InitOnceExecuteOnce(&s_initOnce,
if (!InitOnceExecuteOnce(&s_initOnce,
InitializeWICFactory,
nullptr,
reinterpret_cast<LPVOID*>(&factory));
reinterpret_cast<LPVOID*>(&factory)))
{
return nullptr;
}
return factory;
}

View File

@ -208,10 +208,13 @@ namespace
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
IWICImagingFactory* factory = nullptr;
(void)InitOnceExecuteOnce(&s_initOnce,
if (!InitOnceExecuteOnce(&s_initOnce,
InitializeWICFactory,
nullptr,
reinterpret_cast<LPVOID*>(&factory));
reinterpret_cast<LPVOID*>(&factory)))
{
return nullptr;
}
return factory;
}

View File

@ -166,10 +166,13 @@ namespace
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
IWICImagingFactory2* factory = nullptr;
(void)InitOnceExecuteOnce(&s_initOnce,
if (!InitOnceExecuteOnce(&s_initOnce,
InitializeWICFactory,
nullptr,
reinterpret_cast<LPVOID*>(&factory));
reinterpret_cast<LPVOID*>(&factory)))
{
return nullptr;
}
return factory;
}