Module: wine Branch: master Commit: a6d828b3675cdaa51b7489cb60b0ea71d4bf95c7 URL: https://gitlab.winehq.org/wine/wine/-/commit/a6d828b3675cdaa51b7489cb60b0ea7...
Author: Jeff Smith whydoubt@gmail.com Date: Wed Aug 2 22:48:11 2023 -0500
d3d9/tests: Use compare_uint() in compare_float() instead of abs().
The result of abs(INT_MIN) is INT_MIN, which breaks the ulps comparison.
---
dlls/d3d9/tests/visual.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index cb0a2549b2e..29b95419bed 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -97,10 +97,7 @@ static BOOL compare_float(float f, float g, unsigned int ulps) if (y < 0) y = INT_MIN - y;
- if (abs(x - y) > ulps) - return FALSE; - - return TRUE; + return compare_uint(x, y, ulps); }
static BOOL compare_vec4(const struct vec4 *vec, float x, float y, float z, float w, unsigned int ulps)