From: Józef Kucia jkucia@codeweavers.com
Fixes clang warnings.
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 4 ++-- libs/vkd3d-shader/vkd3d_shader_private.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 0b5c3cf38076..5f87eae55f7d 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -1378,8 +1378,8 @@ static BOOL shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr token = *(*ptr)++;
register_type = (token & VKD3D_SM4_REGISTER_TYPE_MASK) >> VKD3D_SM4_REGISTER_TYPE_SHIFT; - if (register_type >= sizeof(register_type_table) / sizeof(*register_type_table) - || register_type_table[register_type] == ~0u) + if (register_type >= ARRAY_SIZE(register_type_table) + || register_type_table[register_type] == VKD3DSPR_INVALID) { FIXME("Unhandled register type %#x.\n", register_type); param->type = VKD3DSPR_TEMP; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 04e6b0961281..09c2e1dc4381 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -352,6 +352,8 @@ enum vkd3d_shader_register_type VKD3DSPR_COVERAGE, VKD3DSPR_SAMPLEMASK, VKD3DSPR_GSINSTID, + + VKD3DSPR_INVALID = ~0u, };
enum vkd3d_shader_resource_type