mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
tests: Use compare_uint() in compare_float().
Comparing the result of abs() is broken in the case that x - y == INT_MIN.
This commit is contained in:
committed by
Alexandre Julliard
parent
bdfec4886d
commit
69ecfdfb0b
Notes:
Alexandre Julliard
2023-06-27 23:35:17 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/247
@@ -74,13 +74,6 @@ static void set_viewport(D3D12_VIEWPORT *vp, float x, float y,
|
||||
vp->MaxDepth = max_depth;
|
||||
}
|
||||
|
||||
static bool compare_uint(unsigned int x, unsigned int y, unsigned int max_diff)
|
||||
{
|
||||
unsigned int diff = x > y ? x - y : y - x;
|
||||
|
||||
return diff <= max_diff;
|
||||
}
|
||||
|
||||
static bool compare_color(DWORD c1, DWORD c2, BYTE max_diff)
|
||||
{
|
||||
return compare_uint(c1 & 0xff, c2 & 0xff, max_diff)
|
||||
|
Reference in New Issue
Block a user