Index: include/core/SkFixed.h |
diff --git a/include/core/SkFixed.h b/include/core/SkFixed.h |
index fefa718d0fe7c9c45fb82478eedb0482d0b6ba96..3140b7a35d2439e65a32eb7d7548bbb7d8ca5e93 100644 |
--- a/include/core/SkFixed.h |
+++ b/include/core/SkFixed.h |
@@ -88,7 +88,7 @@ typedef int32_t SkFixed; |
#else |
// TODO(reed): this clamp shouldn't be needed. Use SkToS32(). |
#define SkFixedDiv(numer, denom) \ |
- SkTPin<int32_t>(((int64_t)numer << 16) / denom, SK_MinS32, SK_MaxS32) |
+ SkTPin<int32_t>((int32_t)(SkLeftShift((int64_t)numer, 16) / denom), SK_MinS32, SK_MaxS32) |
#endif |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
@@ -145,9 +145,9 @@ inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b) { |
typedef int64_t SkFixed3232; // 32.32 |
-#define SkIntToFixed3232(x) ((SkFixed3232)(x) << 32) |
+#define SkIntToFixed3232(x) (SkLeftShift((SkFixed3232)(x), 32)) |
#define SkFixed3232ToInt(x) ((int)((x) >> 32)) |
-#define SkFixedToFixed3232(x) ((SkFixed3232)(x) << 16) |
+#define SkFixedToFixed3232(x) (SkLeftShift((SkFixed3232)(x), 16)) |
#define SkFixed3232ToFixed(x) ((SkFixed)((x) >> 16)) |
#define SkFloatToFixed3232(x) ((SkFixed3232)((x) * (65536.0f * 65536.0f))) |