d3dcompiler: Use the ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2018-07-20 21:45:54 +02:00 committed by Alexandre Julliard
parent 95bdd7f86d
commit c91a00ce61
2 changed files with 3 additions and 3 deletions

View file

@ -570,7 +570,7 @@ static const struct target_info targets_info[] = {
static const struct target_info * get_target_info(const char *target)
{
LONG min = 0;
LONG max = sizeof(targets_info) / sizeof(targets_info[0]) - 1;
LONG max = ARRAY_SIZE(targets_info) - 1;
LONG cur;
int res;

View file

@ -1165,7 +1165,7 @@ static enum hlsl_base_type expr_common_base_type(enum hlsl_base_type t1, enum hl
};
int t1_idx = -1, t2_idx = -1, i;
for (i = 0; i < sizeof(types) / sizeof(types[0]); ++i)
for (i = 0; i < ARRAY_SIZE(types); ++i)
{
/* Always convert away from HLSL_TYPE_HALF */
if (t1 == types[i])
@ -1943,7 +1943,7 @@ static const char *debug_node_type(enum hlsl_ir_node_type type)
"HLSL_IR_SWIZZLE",
};
if (type >= sizeof(names) / sizeof(names[0]))
if (type >= ARRAY_SIZE(names))
return "Unexpected node type";
return names[type];
}