From 562b2e67a29f24db4c258aa2fa59cd7b4ee15174 Mon Sep 17 00:00:00 2001 From: "bungeman@google.com" Date: Wed, 12 Mar 2014 21:41:06 +0000 Subject: Fix (1 << 31) to (1u << 31) in SkOTTable_OS_2. When ints are 32 bits, (1 << 31) is undefined. R=reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=13757 Review URL: https://codereview.chromium.org/189093020 git-svn-id: http://skia.googlecode.com/svn/trunk@13779 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/sfnt/SkOTTable_OS_2_VA.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/sfnt/SkOTTable_OS_2_VA.h') diff --git a/src/sfnt/SkOTTable_OS_2_VA.h b/src/sfnt/SkOTTable_OS_2_VA.h index 146e83b67e..bc45da2021 100644 --- a/src/sfnt/SkOTTable_OS_2_VA.h +++ b/src/sfnt/SkOTTable_OS_2_VA.h @@ -76,10 +76,10 @@ struct SkOTTableOS2_VA { Reserved07) } field; struct Raw { - static const SK_OT_USHORT Installable = SkTEndian_SwapBE16(0); - static const SK_OT_USHORT RestrictedMask = SkTEndian_SwapBE16(1 << 1); - static const SK_OT_USHORT PreviewPrintMask = SkTEndian_SwapBE16(1 << 2); - static const SK_OT_USHORT EditableMask = SkTEndian_SwapBE16(1 << 3); + static const SK_OT_USHORT Installable = 0; + static const SK_OT_USHORT RestrictedMask = SkOTSetUSHORTBit<1>::value; + static const SK_OT_USHORT PreviewPrintMask = SkOTSetUSHORTBit<2>::value; + static const SK_OT_USHORT EditableMask = SkOTSetUSHORTBit<3>::value; SK_OT_USHORT value; } raw; } fsType; @@ -121,12 +121,12 @@ struct SkOTTableOS2_VA { Reserved07) } field; struct Raw { - static const SK_OT_USHORT ItalicMask = SkTEndian_SwapBE16(1 << 0); - static const SK_OT_USHORT UnderscoreMask = SkTEndian_SwapBE16(1 << 1); - static const SK_OT_USHORT NegativeMask = SkTEndian_SwapBE16(1 << 2); - static const SK_OT_USHORT OutlinedMask = SkTEndian_SwapBE16(1 << 3); - static const SK_OT_USHORT StrikeoutMask = SkTEndian_SwapBE16(1 << 4); - static const SK_OT_USHORT BoldMask = SkTEndian_SwapBE16(1 << 5); + static const SK_OT_USHORT ItalicMask = SkOTSetUSHORTBit<0>::value; + static const SK_OT_USHORT UnderscoreMask = SkOTSetUSHORTBit<1>::value; + static const SK_OT_USHORT NegativeMask = SkOTSetUSHORTBit<2>::value; + static const SK_OT_USHORT OutlinedMask = SkOTSetUSHORTBit<3>::value; + static const SK_OT_USHORT StrikeoutMask = SkOTSetUSHORTBit<4>::value; + static const SK_OT_USHORT BoldMask = SkOTSetUSHORTBit<5>::value; SK_OT_USHORT value; } raw; } fsSelection; -- cgit v1.2.3