centralize and clean up disabled warnings

It's easier to handle these all together.
A few don't seem to trigger for me anymore, so they're removed.

It seems easier to just paper over the one -Wbad-function-cast
site than to disable it.

Change-Id: I9edccf99b304240cf26d0b237d0c068f47c6331c
Reviewed-on: https://skia-review.googlesource.com/139166
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/build/android b/build/android
index c775dc8..fb780cb 100644
--- a/build/android
+++ b/build/android
@@ -5,7 +5,6 @@
 
 cc      = $ndk/toolchains/llvm/prebuilt/*/bin/clang -target $target
 cflags  = -fcolor-diagnostics -Weverything $
-          -Wno-padded -Wno-double-promotion -Wno-float-equal -Wno-bad-function-cast $
           --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 173b7ff..e04beb5 100644
--- a/build/android-arm
+++ b/build/android-arm
@@ -5,7 +5,6 @@
 
 cc      = $ndk/toolchains/llvm/prebuilt/*/bin/clang -target $target
 cflags  = -fcolor-diagnostics -Weverything $
-          -Wno-padded -Wno-double-promotion -Wno-float-equal -Wno-bad-function-cast $
           -march=armv7-a -mthumb $
           --sysroot $ndk/sysroot $
           -I $ndk/sysroot/usr/include/$target
diff --git a/build/android-arm-gcc b/build/android-arm-gcc
index da88696..2dc13d2 100644
--- a/build/android-arm-gcc
+++ b/build/android-arm-gcc
@@ -4,7 +4,7 @@
 ndk_api = 24
 
 cc      = $ndk/toolchains/${target}-4.9/prebuilt/*/bin/${target}-gcc
-cflags  = -fdiagnostics-color -Wall -Wextra -Wno-abi -Wno-type-limits $
+cflags  = -fdiagnostics-color -Wall -Wextra $
           -std=c11 $
           -march=armv7-a -mfpu=neon -mthumb -mfloat-abi=softfp $
           --sysroot $ndk/sysroot $
diff --git a/build/clang b/build/clang
index 5fa829b..c588705 100644
--- a/build/clang
+++ b/build/clang
@@ -1,6 +1,5 @@
 cc     = clang
-cflags = -fcolor-diagnostics -Weverything $
-         -Wno-padded -Wno-double-promotion -Wno-float-equal -Wno-bad-function-cast -Wno-reserved-id-macro
+cflags = -fcolor-diagnostics -Weverything
 out    = out/clang$mode
 
 include build/local
diff --git a/build/common b/build/common
index 2752a4a..8f28220 100644
--- a/build/common
+++ b/build/common
@@ -1,8 +1,17 @@
 builddir = $out
 disabled = false
 
+# Each compiler has enabled all the warnings it can.
+# Here we make them errors, and disable a few we don't want bothering us.
+# TODO: -Wno-reserved-id-macro can go away when we refactor skcms_Transform().
+warnings = -Werror $
+           -Wno-double-promotion $
+           -Wno-float-equal $
+           -Wno-padded $
+           -Wno-reserved-id-macro $
+
 rule compile
-    command = $disabled && touch $out || $cc -g -Werror -Os $cflags $extra_cflags $
+    command = $disabled && touch $out || $cc -g $warnings -Os $cflags $extra_cflags $
              -MD -MF $out.d -c $in -o $out
     depfile = $out.d
     deps    = gcc
diff --git a/build/ios b/build/ios
index 430ab6c..638ea31 100644
--- a/build/ios
+++ b/build/ios
@@ -1,6 +1,5 @@
 cc     = clang -arch arm64 -isysroot `xcrun --sdk iphoneos --show-sdk-path`
-cflags = -fcolor-diagnostics -Weverything $
-         -Wno-padded -Wno-double-promotion -Wno-float-equal -Wno-bad-function-cast
+cflags = -fcolor-diagnostics -Weverything
 out    = out/ios$mode
 
 rule run
diff --git a/skcms.c b/skcms.c
index ff38286..99b05cb 100644
--- a/skcms.c
+++ b/skcms.c
@@ -45,8 +45,8 @@
     }
 
     float ix = fmaxf_(0, fminf_(x, 1)) * (curve->table_entries - 1);
-    int   lo = (int)            ix,
-          hi = (int)minus_1_ulp(ix + 1.0f);
+    int   lo = (int)                   ix        ,
+          hi = (int)(float)minus_1_ulp(ix + 1.0f);
     float t = ix - (float)lo;
 
     float l, h;