dxgi: Introduce 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 2018-05-30 12:18:35 +02:00 committed by Alexandre Julliard
parent 79a189b9ad
commit c377644ca7
2 changed files with 4 additions and 2 deletions

View File

@ -40,6 +40,8 @@
#include "wine/wined3d.h"
#include "wine/winedxgi.h"
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
enum dxgi_frame_latency
{
DXGI_FRAME_LATENCY_DEFAULT = 3,

View File

@ -655,7 +655,7 @@ D3D_FEATURE_LEVEL dxgi_check_feature_level_support(struct dxgi_factory *factory,
shader_model = min(caps.VertexShaderVersion, caps.PixelShaderVersion);
for (i = 0; i < level_count; ++i)
{
for (j = 0; j < sizeof(feature_levels_sm) / sizeof(feature_levels_sm[0]); ++j)
for (j = 0; j < ARRAY_SIZE(feature_levels_sm); ++j)
{
if (feature_levels[i] == feature_levels_sm[j].feature_level)
{
@ -671,7 +671,7 @@ D3D_FEATURE_LEVEL dxgi_check_feature_level_support(struct dxgi_factory *factory,
if (selected_feature_level)
break;
if (j == sizeof(feature_levels_sm) / sizeof(feature_levels_sm[0]))
if (j == ARRAY_SIZE(feature_levels_sm))
FIXME("Unexpected feature level %#x.\n", feature_levels[i]);
else
TRACE("Feature level %s not supported, trying next fallback if available.\n",