tests: squelch clang warnings of using fabs on integer
authorØyvind Kolås <pippin@gimp.org>
Thu, 28 Nov 2019 17:13:09 +0000 (18:13 +0100)
committerØyvind Kolås <pippin@gimp.org>
Thu, 28 Nov 2019 17:13:09 +0000 (18:13 +0100)
tests/cairo_cmyk_hack.c
tests/srgb_to_lab_u8.c

index 3e78aa7f11ebaeb511ab6ca68dac29cab4a7db22..1f308fe39c8d43456cb6058ae78416f24f492abf 100644 (file)
@@ -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;
index 2b0e6ad5f082f48354cbaceeab5d5a4bfc877b21..b99538f1169183a6843cc75bc8e1636549865d24 100644 (file)
@@ -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]);