remove need for -Wno-narrowing
This is a default warning in GCC,
so it's kind of annoying if you just `g++ -c skcms.cc`.
PS1 works in GCC 7 and GCC 8, but is miscompiled by GCC 6.
PS2 seems fine in each.
(GCC 9 will also have __builtin_convertvector() like Clang.)
Change-Id: Ifcad3dd73fa30fca9663e7ebcc17701b4accd7e5
Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/207915
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/build/common b/build/common
index 03cf6a8..7ed5f5c 100644
--- a/build/common
+++ b/build/common
@@ -11,7 +11,6 @@
warnings_cc = $warnings $
-Wno-c++98-compat-pedantic $
-Wno-gnu-anonymous-struct $
- -Wno-narrowing $
-Wno-old-style-cast $
diff --git a/src/Transform_inl.h b/src/Transform_inl.h
index 86854fc..7f76b99 100644
--- a/src/Transform_inl.h
+++ b/src/Transform_inl.h
@@ -107,13 +107,12 @@
return (D)v;
#elif defined(__clang__)
return __builtin_convertvector(v, D);
-#elif N == 4
- return D{v[0],v[1],v[2],v[3]};
-#elif N == 8
- return D{v[0],v[1],v[2],v[3], v[4],v[5],v[6],v[7]};
-#elif N == 16
- return D{v[0],v[1],v[ 2],v[ 3], v[ 4],v[ 5],v[ 6],v[ 7],
- v[8],v[9],v[10],v[11], v[12],v[13],v[14],v[15]};
+#else
+ D d;
+ for (int i = 0; i < N; i++) {
+ d[i] = v[i];
+ }
+ return d;
#endif
}