Replaced _countof / ARRAYSIZE with std::size

This commit is contained in:
Chuck Walbourn
2021-01-02 12:44:35 -08:00
parent 2f8e8120ae
commit f764da5176
15 changed files with 38 additions and 37 deletions

View File

@@ -701,7 +701,7 @@ namespace
wchar_t version[32] = {};
wchar_t appName[_MAX_PATH] = {};
if (GetModuleFileNameW(nullptr, appName, _countof(appName)))
if (GetModuleFileNameW(nullptr, appName, static_cast<UINT>(std::size(appName))))
{
DWORD size = GetFileVersionInfoSizeW(appName, nullptr);
if (size > 0)
@@ -919,7 +919,7 @@ namespace
D3D_FEATURE_LEVEL fl;
HRESULT hr = s_DynamicD3D11CreateDevice(pAdapter.Get(),
(pAdapter) ? D3D_DRIVER_TYPE_UNKNOWN : D3D_DRIVER_TYPE_HARDWARE,
nullptr, createDeviceFlags, featureLevels, _countof(featureLevels),
nullptr, createDeviceFlags, featureLevels, static_cast<UINT>(std::size(featureLevels)),
D3D11_SDK_VERSION, pDevice, &fl, nullptr);
if (SUCCEEDED(hr))
{