Convert internal functions to use Internal namespace instead of leading underscore (#266)

Fixes clang v13 -Wreserved-identifier warning
This commit is contained in:
Chuck Walbourn
2022-02-20 14:47:07 -08:00
committed by GitHub
parent 192e674537
commit 469c65406a
24 changed files with 1132 additions and 1074 deletions

View File

@@ -216,7 +216,7 @@ namespace
#endif
}
IWICImagingFactory* _GetWIC() noexcept
IWICImagingFactory* GetWIC() noexcept
{
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
@@ -234,7 +234,7 @@ namespace
}
//---------------------------------------------------------------------------------
DXGI_FORMAT _WICToDXGI(const GUID& guid) noexcept
DXGI_FORMAT WICToDXGI(const GUID& guid) noexcept
{
for (size_t i = 0; i < std::size(g_WICFormats); ++i)
{
@@ -254,9 +254,9 @@ namespace
}
//---------------------------------------------------------------------------------
size_t _WICBitsPerPixel(REFGUID targetGuid) noexcept
size_t WICBitsPerPixel(REFGUID targetGuid) noexcept
{
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return 0;
@@ -449,7 +449,7 @@ namespace
size_t bpp = 0;
DXGI_FORMAT format = _WICToDXGI(pixelFormat);
DXGI_FORMAT format = WICToDXGI(pixelFormat);
if (format == DXGI_FORMAT_UNKNOWN)
{
if (memcmp(&GUID_WICPixelFormat96bppRGBFixedPoint, &pixelFormat, sizeof(WICPixelFormatGUID)) == 0)
@@ -477,9 +477,9 @@ namespace
{
memcpy_s(&convertGUID, sizeof(WICPixelFormatGUID), &g_WICConvert[i].target, sizeof(GUID));
format = _WICToDXGI(g_WICConvert[i].target);
format = WICToDXGI(g_WICConvert[i].target);
assert(format != DXGI_FORMAT_UNKNOWN);
bpp = _WICBitsPerPixel(convertGUID);
bpp = WICBitsPerPixel(convertGUID);
break;
}
}
@@ -490,7 +490,7 @@ namespace
}
else
{
bpp = _WICBitsPerPixel(pixelFormat);
bpp = WICBitsPerPixel(pixelFormat);
}
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
@@ -609,7 +609,7 @@ namespace
else if (twidth != width || theight != height)
{
// Resize
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return E_NOINTERFACE;
@@ -660,7 +660,7 @@ namespace
else
{
// Format conversion but no resize
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return E_NOINTERFACE;
@@ -921,7 +921,7 @@ HRESULT DirectX::CreateWICTextureFromMemoryEx(
if (wicDataSize > UINT32_MAX)
return HRESULT_FROM_WIN32(ERROR_FILE_TOO_LARGE);
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return E_NOINTERFACE;
@@ -1055,7 +1055,7 @@ HRESULT DirectX::CreateWICTextureFromFileEx(
return E_INVALIDARG;
}
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return E_NOINTERFACE;

View File

@@ -177,7 +177,7 @@ namespace
ifactory)) ? TRUE : FALSE;
}
IWICImagingFactory2* _GetWIC() noexcept
IWICImagingFactory2* GetWIC() noexcept
{
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
@@ -253,7 +253,7 @@ namespace
}
//---------------------------------------------------------------------------------
DXGI_FORMAT _WICToDXGI(const GUID& guid) noexcept
DXGI_FORMAT WICToDXGI(const GUID& guid) noexcept
{
for (size_t i = 0; i < std::size(g_WICFormats); ++i)
{
@@ -265,9 +265,9 @@ namespace
}
//---------------------------------------------------------------------------------
size_t _WICBitsPerPixel(REFGUID targetGuid) noexcept
size_t WICBitsPerPixel(REFGUID targetGuid) noexcept
{
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return 0;
@@ -398,7 +398,7 @@ namespace
size_t bpp = 0;
DXGI_FORMAT format = _WICToDXGI(pixelFormat);
DXGI_FORMAT format = WICToDXGI(pixelFormat);
if (format == DXGI_FORMAT_UNKNOWN)
{
for (size_t i = 0; i < std::size(g_WICConvert); ++i)
@@ -407,9 +407,9 @@ namespace
{
memcpy_s(&convertGUID, sizeof(WICPixelFormatGUID), &g_WICConvert[i].target, sizeof(GUID));
format = _WICToDXGI(g_WICConvert[i].target);
format = WICToDXGI(g_WICConvert[i].target);
assert(format != DXGI_FORMAT_UNKNOWN);
bpp = _WICBitsPerPixel(convertGUID);
bpp = WICBitsPerPixel(convertGUID);
break;
}
}
@@ -419,7 +419,7 @@ namespace
}
else
{
bpp = _WICBitsPerPixel(pixelFormat);
bpp = WICBitsPerPixel(pixelFormat);
}
if (loadFlags & WIC_LOADER_FORCE_RGBA32)
@@ -510,7 +510,7 @@ namespace
else if (twidth != width || theight != height)
{
// Resize
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return E_NOINTERFACE;
@@ -561,7 +561,7 @@ namespace
else
{
// Format conversion but no resize
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return E_NOINTERFACE;
@@ -708,7 +708,7 @@ HRESULT DirectX::LoadWICTextureFromMemoryEx(
if (wicDataSize > UINT32_MAX)
return HRESULT_FROM_WIN32(ERROR_FILE_TOO_LARGE);
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return E_NOINTERFACE;
@@ -789,7 +789,7 @@ HRESULT DirectX::LoadWICTextureFromFileEx(
if (!d3dDevice || !fileName || !texture)
return E_INVALIDARG;
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return E_NOINTERFACE;

View File

@@ -197,7 +197,7 @@ namespace
#endif
}
IWICImagingFactory* _GetWIC() noexcept
IWICImagingFactory* GetWIC() noexcept
{
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
@@ -215,7 +215,7 @@ namespace
}
//---------------------------------------------------------------------------------
D3DFORMAT _WICToD3D9(const GUID& guid) noexcept
D3DFORMAT WICToD3D9(const GUID& guid) noexcept
{
for (size_t i = 0; i < std::size(g_WICFormats); ++i)
{
@@ -331,7 +331,7 @@ namespace
WICPixelFormatGUID convertGUID;
memcpy_s(&convertGUID, sizeof(WICPixelFormatGUID), &pixelFormat, sizeof(GUID));
D3DFORMAT format = _WICToD3D9(pixelFormat);
D3DFORMAT format = WICToD3D9(pixelFormat);
if (format == D3DFMT_UNKNOWN)
{
for (size_t i = 0; i < std::size(g_WICConvert); ++i)
@@ -340,7 +340,7 @@ namespace
{
memcpy_s(&convertGUID, sizeof(WICPixelFormatGUID), &g_WICConvert[i].target, sizeof(GUID));
format = _WICToD3D9(g_WICConvert[i].target);
format = WICToD3D9(g_WICConvert[i].target);
assert(format != D3DFMT_UNKNOWN);
break;
}
@@ -417,7 +417,7 @@ namespace
else if (twidth != width || theight != height)
{
// Resize
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return E_NOINTERFACE;
@@ -484,7 +484,7 @@ namespace
else
{
// Format conversion but no resize
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return E_NOINTERFACE;
@@ -569,7 +569,7 @@ HRESULT DirectX::CreateWICTextureFromMemoryEx(
if (wicDataSize > UINT32_MAX)
return HRESULT_FROM_WIN32(ERROR_FILE_TOO_LARGE);
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return E_NOINTERFACE;
@@ -627,7 +627,7 @@ HRESULT DirectX::CreateWICTextureFromFileEx(
if (!d3dDevice || !fileName || !texture)
return E_INVALIDARG;
auto pWIC = _GetWIC();
auto pWIC = GetWIC();
if (!pWIC)
return E_NOINTERFACE;