From cb08f986938eeeeb57f950c94fee120aca965787 Mon Sep 17 00:00:00 2001 From: "mtklein@google.com" Date: Tue, 3 Dec 2013 19:27:41 +0000 Subject: [PATCH] Fix 32/64 bit warnings on g++-4.2. BUG= Review URL: https://codereview.chromium.org/98343006 git-svn-id: http://skia.googlecode.com/svn/trunk@12470 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkColorPriv.h | 5 +++-- tests/ColorPrivTest.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/core/SkColorPriv.h b/include/core/SkColorPriv.h index 98f4e5b..cd6fc2c 100644 --- a/include/core/SkColorPriv.h +++ b/include/core/SkColorPriv.h @@ -303,8 +303,9 @@ static inline SkPMColor SkUnsplay(uint32_t ag, uint32_t rb) { */ static inline SkPMColor SkUnsplay(uint64_t agrb) { const uint32_t mask = 0xFF00FF00; - return ((agrb & mask) >> 8) | // 0x00RR00BB - ((agrb >> 32) & mask); // 0xAARRGGBB + return SkPMColor( + ((agrb & mask) >> 8) | // 0x00RR00BB + ((agrb >> 32) & mask)); // 0xAARRGGBB } static inline SkPMColor SkFastFourByteInterp256_32(SkPMColor src, SkPMColor dst, unsigned scale) { diff --git a/tests/ColorPrivTest.cpp b/tests/ColorPrivTest.cpp index ddcde5d..19a63c7 100644 --- a/tests/ColorPrivTest.cpp +++ b/tests/ColorPrivTest.cpp @@ -15,7 +15,7 @@ DEF_TEST(Splay, r) { ASSERT(SkUnsplay(ag << 8, rb << 8) == color); const uint64_t agrb = SkSplay(color); - ASSERT(agrb == 0x00A100C300B200D4); + ASSERT(agrb == 0x00A100C300B200D4ULL); ASSERT(SkUnsplay(agrb<<8) == color); } -- 2.7.4