From 83ce4553ea2bf08e2957b7ab2eb6833d93dbf377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Fri, 13 Apr 2018 12:37:37 +0200 Subject: [PATCH] libs/vkd3d-shader: Introduce VKD3DSPR_INVALID. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes clang warnings. Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- 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 0b5c3cf3..5f87eae5 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 04e6b096..09c2e1dc 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