Fix ambiguity in negate()s.
authorMike Klein <mtklein@google.com>
Fri, 20 Mar 2015 15:19:01 +0000 (11:19 -0400)
committerMike Klein <mtklein@google.com>
Fri, 20 Mar 2015 15:19:01 +0000 (11:19 -0400)
BUG=skia:

Review URL: https://codereview.chromium.org/1027793002

src/core/Sk2x.h
src/core/Sk4x.h

index e9576de..3fbe76c 100644 (file)
@@ -58,7 +58,7 @@ public:
     Sk2x& operator -=(const Sk2x& o) { return (*this = *this - o); }
     Sk2x& operator *=(const Sk2x& o) { return (*this = *this * o); }
 
-    Sk2x negate() const { return Sk2x(0) - *this; }
+    Sk2x negate() const { return Sk2x((T)0) - *this; }
     Sk2x operator -() const { return this->negate(); }
 
     Sk2x rsqrt() const;   // Approximate 1/this->sqrt().
index 99ed67d..ebbc20b 100644 (file)
@@ -69,7 +69,7 @@ public:
     Sk4x& operator *=(const Sk4x& o) { return (*this = *this * o); }
     Sk4x& operator /=(const Sk4x& o) { return (*this = *this / o); }
 
-    Sk4x negate() const { return Sk4x(0) - *this; }
+    Sk4x negate() const { return Sk4x((T)0) - *this; }
     Sk4x operator -() const { return this->negate(); }
 
     Sk4x rsqrt() const;   // Approximate reciprocal sqrt().