From: Øyvind Kolås Date: Thu, 28 Nov 2019 17:13:09 +0000 (+0100) Subject: tests: squelch clang warnings of using fabs on integer X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~10^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f9009f8d9b29cf7d96f251bcfbdb8402298a76b5;p=babl.git tests: squelch clang warnings of using fabs on integer --- diff --git a/tests/cairo_cmyk_hack.c b/tests/cairo_cmyk_hack.c index 3e78aa7..1f308fe 100644 --- a/tests/cairo_cmyk_hack.c +++ b/tests/cairo_cmyk_hack.c @@ -57,7 +57,7 @@ test (void) for (i = 0; i < PIXELS * 5; i++) { - if (fabs (dest_buf[i] - source_buf[i]) > TOLERANCE) + if (fabs (dest_buf[i] - source_buf[i] * 1.0) > TOLERANCE) { fprintf (stderr, "%i is wrong\n", i); OK = 0; diff --git a/tests/srgb_to_lab_u8.c b/tests/srgb_to_lab_u8.c index 2b0e6ad..b99538f 100644 --- a/tests/srgb_to_lab_u8.c +++ b/tests/srgb_to_lab_u8.c @@ -53,7 +53,7 @@ test (void) for (i = 0; i < PIXELS * 3; i++) { - if (fabs (destination_buf[i] - reference_buf[i]) > TOLERANCE) + if (fabs (1.0 * destination_buf[i] - reference_buf[i]) > TOLERANCE) { fprintf (stderr, "%2i (%2i%%3=%i, %2i/3=%i) is %i should be %i", i, i, i % 3, i, i / 3, destination_buf[i], reference_buf[i]);