mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/hlsl: Properly compare integers in compare_param_hlsl_types().
As pointed out by Giovanni Mascellani, modular subtraction doesn't produce a total order; in particular, it's not transitive. The nature of the types being compared here makes it unlikely this will be an issue in practice, but it's both fragile and setting a poor example. Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
850badd38c
commit
790ab754d5
@@ -158,6 +158,11 @@ static inline uint32_t vkd3d_make_u32(uint16_t low, uint16_t high)
|
||||
return low | ((uint32_t)high << 16);
|
||||
}
|
||||
|
||||
static inline int vkd3d_u32_compare(uint32_t x, uint32_t y)
|
||||
{
|
||||
return (x > y) - (x < y);
|
||||
}
|
||||
|
||||
static inline int ascii_isupper(int c)
|
||||
{
|
||||
return 'A' <= c && c <= 'Z';
|
||||
|
Reference in New Issue
Block a user