configure: Build with -Wtype-limits.

libs/vkd3d-shader/tpf.c: In function ‘write_sm4_unary_op_with_two_destinations’:
libs/vkd3d-shader/tpf.c:4489:24: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(1 - dst_idx >= 0);
                        ^~
libs/vkd3d-shader/tpf.c: In function ‘write_sm4_binary_op_with_two_destinations’:
libs/vkd3d-shader/tpf.c:4549:24: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(1 - dst_idx >= 0);
                        ^~
This commit is contained in:
Henri Verbeet 2024-02-22 13:03:16 +01:00 committed by Alexandre Julliard
parent d155071f22
commit 7029d821be
Notes: Alexandre Julliard 2024-02-22 23:05:00 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/668
2 changed files with 3 additions and 4 deletions

View File

@ -67,6 +67,7 @@ AS_IF([test "x${GCC}" = "xyes"],
VKD3D_CHECK_CFLAGS([-Wpointer-arith])
VKD3D_CHECK_CFLAGS([-Wshadow])
VKD3D_CHECK_CFLAGS([-Wshift-overflow=2])
VKD3D_CHECK_CFLAGS([-Wtype-limits])
VKD3D_CHECK_CFLAGS([-Wunused-but-set-parameter])
VKD3D_CHECK_CFLAGS([-Wvla])
VKD3D_CHECK_CFLAGS([-Wl,--no-undefined])])

View File

@ -4477,7 +4477,7 @@ static void write_sm4_unary_op(const struct tpf_writer *tpf, enum vkd3d_sm4_opco
}
static void write_sm4_unary_op_with_two_destinations(const struct tpf_writer *tpf, enum vkd3d_sm4_opcode opcode,
const struct hlsl_ir_node *dst, unsigned dst_idx, const struct hlsl_ir_node *src)
const struct hlsl_ir_node *dst, unsigned int dst_idx, const struct hlsl_ir_node *src)
{
struct sm4_instruction instr;
@ -4486,7 +4486,6 @@ static void write_sm4_unary_op_with_two_destinations(const struct tpf_writer *tp
assert(dst_idx < ARRAY_SIZE(instr.dsts));
sm4_dst_from_node(&instr.dsts[dst_idx], dst);
assert(1 - dst_idx >= 0);
instr.dsts[1 - dst_idx].reg.type = VKD3DSPR_NULL;
instr.dsts[1 - dst_idx].reg.dimension = VSIR_DIMENSION_NONE;
instr.dsts[1 - dst_idx].reg.idx_count = 0;
@ -4536,7 +4535,7 @@ static void write_sm4_binary_op_dot(const struct tpf_writer *tpf, enum vkd3d_sm4
}
static void write_sm4_binary_op_with_two_destinations(const struct tpf_writer *tpf,
enum vkd3d_sm4_opcode opcode, const struct hlsl_ir_node *dst, unsigned dst_idx,
enum vkd3d_sm4_opcode opcode, const struct hlsl_ir_node *dst, unsigned int dst_idx,
const struct hlsl_ir_node *src1, const struct hlsl_ir_node *src2)
{
struct sm4_instruction instr;
@ -4546,7 +4545,6 @@ static void write_sm4_binary_op_with_two_destinations(const struct tpf_writer *t
assert(dst_idx < ARRAY_SIZE(instr.dsts));
sm4_dst_from_node(&instr.dsts[dst_idx], dst);
assert(1 - dst_idx >= 0);
instr.dsts[1 - dst_idx].reg.type = VKD3DSPR_NULL;
instr.dsts[1 - dst_idx].reg.dimension = VSIR_DIMENSION_NONE;
instr.dsts[1 - dst_idx].reg.idx_count = 0;