Jeff Smith : d3d8/tests: Use compare_uint() in compare_float() instead of abs().
Module: wine Branch: master Commit: f6f25c5ed15da25e9a2c36af1bcaf6d0a0bf2fa9 URL: https://gitlab.winehq.org/wine/wine/-/commit/f6f25c5ed15da25e9a2c36af1bcaf6d... Author: Jeff Smith <whydoubt(a)gmail.com> Date: Wed Aug 2 22:48:05 2023 -0500 d3d8/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/d3d8/tests/visual.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index 264a4230a75..f80ff86010e 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -85,10 +85,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)
participants (1)
-
Alexandre Julliard