d3d11: Use ARRAY_SIZE() macro.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2017-03-23 12:15:51 +01:00 committed by Alexandre Julliard
parent acd7d2e09a
commit 45aaffd142
2 changed files with 3 additions and 3 deletions

View File

@ -386,7 +386,7 @@ static HRESULT d3d_query_init(struct d3d_query *query, struct d3d_device *device
/* D3D11_QUERY_SO_OVERFLOW_PREDICATE */ WINED3D_QUERY_TYPE_SO_OVERFLOW,
};
if (desc->Query >= sizeof(query_type_map) / sizeof(*query_type_map))
if (desc->Query >= ARRAY_SIZE(query_type_map))
{
FIXME("Unhandled query type %#x.\n", desc->Query);
return E_INVALIDARG;

View File

@ -118,7 +118,7 @@ HRESULT WINAPI D3D11CoreRegisterLayers(void)
{DXGI_DEVICE_LAYER_D3D10_DEVICE, layer_init, layer_get_size, layer_create, layer_set_feature_level},
};
DXGID3D10RegisterLayers(layers, sizeof(layers)/sizeof(*layers));
DXGID3D10RegisterLayers(layers, ARRAY_SIZE(layers));
return S_OK;
}
@ -265,7 +265,7 @@ HRESULT WINAPI D3D11CreateDevice(IDXGIAdapter *adapter, D3D_DRIVER_TYPE driver_t
if (!feature_levels)
{
feature_levels = default_feature_levels;
levels = sizeof(default_feature_levels) / sizeof(default_feature_levels[0]);
levels = ARRAY_SIZE(default_feature_levels);
}
hr = D3D11CoreCreateDevice(factory, adapter, flags, feature_levels, levels, &device);
IDXGIAdapter_Release(adapter);