disable -Wdouble-promotion

It's more annoying than helpful.

Change-Id: Ic78138a51750f1f0c5148b8af04a08089350bd77
Reviewed-on: https://skia-review.googlesource.com/120164
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/bench.c b/bench.c
index b272e2e..f82aaca 100644
--- a/bench.c
+++ b/bench.c
@@ -80,7 +80,7 @@
 
     clock_t ticks = clock() - start;
     printf("%d loops in %g ticks, %.3g ns / pixel\n",
-            loops, (double)ticks, (double)ticks / (CLOCKS_PER_SEC * 1e-9) / (loops * NPIXELS));
+            loops, (double)ticks, ticks / (CLOCKS_PER_SEC * 1e-9) / (loops * NPIXELS));
 
     free(src_buf);
     free(dst_buf);
diff --git a/build/android b/build/android
index 78bc286..9a6cbef 100644
--- a/build/android
+++ b/build/android
@@ -4,7 +4,8 @@
 ndk_api = 24
 
 cc      = $ndk/toolchains/llvm/prebuilt/*/bin/clang -target $target
-cflags  = -fcolor-diagnostics -Weverything -Wno-padded -Wno-float-equal -Wno-vector-conversion $
+cflags  = -fcolor-diagnostics -Weverything $
+          -Wno-padded -Wno-double-promotion -Wno-float-equal -Wno-vector-conversion $
           --sysroot $ndk/sysroot $
           -I $ndk/sysroot/usr/include/$target
 ldflags = -pie -fuse-ld=gold $
diff --git a/build/android-arm b/build/android-arm
index 2c81296..ea1a1b1 100644
--- a/build/android-arm
+++ b/build/android-arm
@@ -4,7 +4,8 @@
 ndk_api = 24
 
 cc      = $ndk/toolchains/llvm/prebuilt/*/bin/clang -target $target
-cflags  = -fcolor-diagnostics -Weverything -Wno-padded -Wno-float-equal -Wno-vector-conversion $
+cflags  = -fcolor-diagnostics -Weverything $
+          -Wno-padded -Wno-double-promotion -Wno-float-equal -Wno-vector-conversion $
           -march=armv7-a -mthumb $
           --sysroot $ndk/sysroot $
           -I $ndk/sysroot/usr/include/$target
diff --git a/build/clang b/build/clang
index 9ac1cce..9560053 100644
--- a/build/clang
+++ b/build/clang
@@ -1,5 +1,6 @@
 cc     = clang
-cflags = -fcolor-diagnostics -Weverything -Wno-padded -Wno-float-equal -Wno-reserved-id-macro
+cflags = -fcolor-diagnostics -Weverything $
+         -Wno-padded -Wno-double-promotion -Wno-float-equal -Wno-reserved-id-macro
 out    = out/clang$mode
 
 include build/local
diff --git a/build/ios b/build/ios
index 55a2fce..bfcb019 100644
--- a/build/ios
+++ b/build/ios
@@ -1,5 +1,6 @@
 cc     = clang -arch arm64 -isysroot `xcrun --sdk iphoneos --show-sdk-path`
-cflags = -fcolor-diagnostics -Weverything -Wno-padded -Wno-float-equal -Wno-vector-conversion
+cflags = -fcolor-diagnostics -Weverything $
+         -Wno-padded -Wno-double-promotion -Wno-float-equal -Wno-vector-conversion
 out    = out/ios$mode
 
 rule run
diff --git a/iccdump.c b/iccdump.c
index 748de4a..ae678d0 100644
--- a/iccdump.c
+++ b/iccdump.c
@@ -163,14 +163,14 @@
             "0 \\\\le x < %.5f: %.5fx + %.5f, "                    // 0 <= x < d: cx + f
             "%.5f \\\\le x \\\\le 1: (%.5fx + %.5f)^{%.5f} + %.5f" // d <= x <= 1: (ax + b)^g + e
             "\\\\right\\\\}\"\n",
-            (double)tf->d, (double)tf->c, (double)tf->f,
-            (double)tf->d, (double)tf->a, (double)tf->b, (double)tf->g, (double)tf->e);
+            tf->d, tf->c, tf->f,
+            tf->d, tf->a, tf->b, tf->g, tf->e);
     fprintf(fp, "},\n");
 }
 
 static void desmos_TF13(FILE* fp, const skcms_TF13* tf, const char* color) {
-    double A = (double)tf->A,
-           B = (double)tf->B;
+    double A = tf->A,
+           B = tf->B;
     fprintf(fp, "{\n");
     fprintf(fp, " \"type\": \"expression\",\n");
     fprintf(fp, " \"id\": \"%d\",\n", desmos_id++);
@@ -312,7 +312,7 @@
     for (int i = 0; i < 256; ++i) {
         float x = i / 255.0f;
         float t = skcms_TransferFunction_eval(tf, x);
-        fprintf(fp, "%g, %g\n", (double)x, (double)t);
+        fprintf(fp, "%g, %g\n", x, t);
     }
     fprintf(fp, "\"/>\n");
 }
@@ -423,9 +423,9 @@
             float bSum = m->vals[0][2] + m->vals[1][2] + m->vals[2][2];
             fprintf(fp, "<polygon fill=\"none\" stroke=\"black\" "
                     "vector-effect=\"non-scaling-stroke\" points=\"%g,%g %g,%g %g,%g\"/>\n",
-                    (double)(m->vals[0][0] / rSum), (double)(m->vals[1][0] / rSum),
-                    (double)(m->vals[0][1] / gSum), (double)(m->vals[1][1] / gSum),
-                    (double)(m->vals[0][2] / bSum), (double)(m->vals[1][2] / bSum));
+                    (m->vals[0][0] / rSum), (m->vals[1][0] / rSum),
+                    (m->vals[0][1] / gSum), (m->vals[1][1] / gSum),
+                    (m->vals[0][2] / bSum), (m->vals[1][2] / bSum));
 
             svg_pop_group(fp);
             svg_close(fp);
diff --git a/src/LinearAlgebra.c b/src/LinearAlgebra.c
index 4fe539c..9ef7079 100644
--- a/src/LinearAlgebra.c
+++ b/src/LinearAlgebra.c
@@ -11,22 +11,22 @@
 #include <float.h>
 
 bool skcms_Matrix4x4_invert(const skcms_Matrix4x4* src, skcms_Matrix4x4* dst) {
-    double a00 = (double)src->vals[0][0],
-           a01 = (double)src->vals[1][0],
-           a02 = (double)src->vals[2][0],
-           a03 = (double)src->vals[3][0],
-           a10 = (double)src->vals[0][1],
-           a11 = (double)src->vals[1][1],
-           a12 = (double)src->vals[2][1],
-           a13 = (double)src->vals[3][1],
-           a20 = (double)src->vals[0][2],
-           a21 = (double)src->vals[1][2],
-           a22 = (double)src->vals[2][2],
-           a23 = (double)src->vals[3][2],
-           a30 = (double)src->vals[0][3],
-           a31 = (double)src->vals[1][3],
-           a32 = (double)src->vals[2][3],
-           a33 = (double)src->vals[3][3];
+    double a00 = src->vals[0][0],
+           a01 = src->vals[1][0],
+           a02 = src->vals[2][0],
+           a03 = src->vals[3][0],
+           a10 = src->vals[0][1],
+           a11 = src->vals[1][1],
+           a12 = src->vals[2][1],
+           a13 = src->vals[3][1],
+           a20 = src->vals[0][2],
+           a21 = src->vals[1][2],
+           a22 = src->vals[2][2],
+           a23 = src->vals[3][2],
+           a30 = src->vals[0][3],
+           a31 = src->vals[1][3],
+           a32 = src->vals[2][3],
+           a33 = src->vals[3][3];
 
     double b00 = a00*a11 - a01*a10,
            b01 = a00*a12 - a02*a10,
@@ -53,7 +53,7 @@
     }
 
     double invdet = 1.0 / determinant;
-    if (invdet > +(double)FLT_MAX || invdet < -(double)FLT_MAX || !isfinitef_((float)invdet)) {
+    if (invdet > +FLT_MAX || invdet < -FLT_MAX || !isfinitef_((float)invdet)) {
         return false;
     }
 
@@ -97,15 +97,15 @@
 }
 
 bool skcms_Matrix3x3_invert(const skcms_Matrix3x3* src, skcms_Matrix3x3* dst) {
-    double a00 = (double)src->vals[0][0],
-           a01 = (double)src->vals[1][0],
-           a02 = (double)src->vals[2][0],
-           a10 = (double)src->vals[0][1],
-           a11 = (double)src->vals[1][1],
-           a12 = (double)src->vals[2][1],
-           a20 = (double)src->vals[0][2],
-           a21 = (double)src->vals[1][2],
-           a22 = (double)src->vals[2][2];
+    double a00 = src->vals[0][0],
+           a01 = src->vals[1][0],
+           a02 = src->vals[2][0],
+           a10 = src->vals[0][1],
+           a11 = src->vals[1][1],
+           a12 = src->vals[2][1],
+           a20 = src->vals[0][2],
+           a21 = src->vals[1][2],
+           a22 = src->vals[2][2];
 
     double b0 = a00*a11 - a01*a10,
            b1 = a00*a12 - a02*a10,
diff --git a/test_only.c b/test_only.c
index 791a663..b247a0f 100644
--- a/test_only.c
+++ b/test_only.c
@@ -131,8 +131,7 @@
 
 static void dump_transfer_function(FILE* fp, const char* name, const skcms_TransferFunction* tf) {
     fprintf(fp, "%4s : %.9g, %.9g, %.9g, %.9g, %.9g, %.9g, %.9g", name,
-           (double)tf->g, (double)tf->a, (double)tf->b, (double)tf->c,
-           (double)tf->d, (double)tf->e, (double)tf->f);
+            tf->g, tf->a, tf->b, tf->c, tf->d, tf->e, tf->f);
     if (is_sRGB(tf)) {
         fprintf(fp, " (sRGB)");
     } else if (is_linear(tf)) {
@@ -145,18 +144,16 @@
                                           float max_error, bool for_unit_test) {
     if (for_unit_test) {
         fprintf(fp, "  ~= : %.6g, %.6g, %.6g, %.6g, %.6g, %.6g, %.6g  (Max error: %.2g)",
-                (double)tf->g, (double)tf->a, (double)tf->b, (double)tf->c,
-                (double)tf->d, (double)tf->e, (double)tf->f, (double)max_error);
+                tf->g, tf->a, tf->b, tf->c, tf->d, tf->e, tf->f, max_error);
     } else {
         fprintf(fp, "  ~= : %.9g, %.9g, %.9g, %.9g, %.9g, %.9g, %.9g  (Max error: %.9g)",
-                (double)tf->g, (double)tf->a, (double)tf->b, (double)tf->c,
-                (double)tf->d, (double)tf->e, (double)tf->f, (double)max_error);
+                tf->g, tf->a, tf->b, tf->c, tf->d, tf->e, tf->f, max_error);
     }
     if (tf->d > 0) {
         // Has both linear and nonlinear sections, include the discontinuity at D
         float l_at_d = (tf->c * tf->d + tf->f);
         float n_at_d = powf_(tf->a * tf->d + tf->b, tf->g) + tf->e;
-        fprintf(fp, " (D-gap: %.*g)", for_unit_test ? 2 : 9, (double)(n_at_d - l_at_d));
+        fprintf(fp, " (D-gap: %.*g)", for_unit_test ? 2 : 9, (n_at_d - l_at_d));
     }
     if (is_linear(tf)) {
         fprintf(fp, " (Linear)");
@@ -168,8 +165,7 @@
                              float max_error, bool for_unit_test) {
     (void)for_unit_test;
     fprintf(fp, "  ~= : %.4gx^3 + %.4gx^2 + %.4gx (Max error: %.4g)\n",
-            (double)tf->A, (double)tf->B, (double)(1 - tf->A - tf->B),
-            (double)max_error);
+            tf->A, tf->B, (1 - tf->A - tf->B), max_error);
 }
 
 static void dump_curve(FILE* fp, const char* name, const skcms_Curve* curve, bool for_unit_test) {
@@ -247,9 +243,9 @@
         fprintf(fp, " XYZ : | %.9f %.9f %.9f |\n"
                     "       | %.9f %.9f %.9f |\n"
                     "       | %.9f %.9f %.9f |\n",
-               (double)toXYZ.vals[0][0], (double)toXYZ.vals[0][1], (double)toXYZ.vals[0][2],
-               (double)toXYZ.vals[1][0], (double)toXYZ.vals[1][1], (double)toXYZ.vals[1][2],
-               (double)toXYZ.vals[2][0], (double)toXYZ.vals[2][1], (double)toXYZ.vals[2][2]);
+               toXYZ.vals[0][0], toXYZ.vals[0][1], toXYZ.vals[0][2],
+               toXYZ.vals[1][0], toXYZ.vals[1][1], toXYZ.vals[1][2],
+               toXYZ.vals[2][0], toXYZ.vals[2][1], toXYZ.vals[2][2]);
     }
 
     if (profile->has_A2B) {
@@ -281,9 +277,9 @@
             fprintf(fp, "Mtrx : | %.9f %.9f %.9f %.9f |\n"
                         "       | %.9f %.9f %.9f %.9f |\n"
                         "       | %.9f %.9f %.9f %.9f |\n",
-                   (double)m->vals[0][0], (double)m->vals[0][1], (double)m->vals[0][2], (double)m->vals[0][3],
-                   (double)m->vals[1][0], (double)m->vals[1][1], (double)m->vals[1][2], (double)m->vals[1][3],
-                   (double)m->vals[2][0], (double)m->vals[2][1], (double)m->vals[2][2], (double)m->vals[2][3]);
+                   m->vals[0][0], m->vals[0][1], m->vals[0][2], m->vals[0][3],
+                   m->vals[1][0], m->vals[1][1], m->vals[1][2], m->vals[1][3],
+                   m->vals[2][0], m->vals[2][1], m->vals[2][2], m->vals[2][3]);
         }
 
         {