Index: include/core/SkTypes.h |
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h |
index 6c2e6361530ac9674da7f69f7b2dd978bb80ce32..77acbfded734821f3d599be8291d698c072e603f 100644 |
--- a/include/core/SkTypes.h |
+++ b/include/core/SkTypes.h |
@@ -303,6 +303,22 @@ static inline bool SkIsU16(long x) { |
return (uint16_t)x == x; |
} |
+static inline int32_t SkLeftShift(int32_t value, int32_t shift) { |
+#ifdef SK_BUILT_WITH_SANITIZER |
+ return (int32_t) ((uint32_t) value << shift); |
reed1
2015/12/09 15:54:26
do we think we can't always use the version here (
mtklein
2015/12/09 16:48:11
agree... both'll generate the same code.
caryclark
2015/12/09 19:13:12
Done.
|
+#else |
+ return value << shift; |
+#endif |
+} |
+ |
+static inline int64_t SkLeftShift(int64_t value, int32_t shift) { |
+#ifdef SK_BUILT_WITH_SANITIZER |
+ return (int64_t) ((uint64_t) value << shift); |
+#else |
+ return value << shift; |
+#endif |
+} |
+ |
////////////////////////////////////////////////////////////////////////////// |
/** Returns the number of entries in an array (not a pointer) */ |