diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c index 36e793ed01c..10c6d01878a 100644 --- a/dlls/d3dcompiler_43/compiler.c +++ b/dlls/d3dcompiler_43/compiler.c @@ -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; diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 79f3be8840d..b0232f375d6 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -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]; }