diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-01 16:11:53 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-01 16:11:53 +0000 |
commit | d48ad8e33307ad651264a3c3068b4468201fccf6 (patch) | |
tree | a8bc7406fb512ffb57e0f81096099c8ebb8b903b /src/sfnt | |
parent | 9fbbcca1c958e6df2cff24d3ccdb7ebd89b8486b (diff) |
Fold SkTSetBit into SkOTSet*Bit.
BUG=b/13729420
R=bungeman@google.com, mtklein@google.com, bsalomon@google.com, reed@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/219023011
git-svn-id: http://skia.googlecode.com/svn/trunk@14009 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/sfnt')
-rw-r--r-- | src/sfnt/SkOTTableTypes.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sfnt/SkOTTableTypes.h b/src/sfnt/SkOTTableTypes.h index c978cc0179..1f49518d59 100644 --- a/src/sfnt/SkOTTableTypes.h +++ b/src/sfnt/SkOTTableTypes.h @@ -48,13 +48,15 @@ public: /** SkOTSetUSHORTBit<N>::value is an SK_OT_USHORT with the Nth BE bit set. */ template <unsigned N> struct SkOTSetUSHORTBit { - static const uint16_t bit = SkTSetBit<N, uint16_t>::value; + SK_COMPILE_ASSERT(N < 16, NTooBig); + static const uint16_t bit = 1u << N; static const SK_OT_USHORT value = SkTEndian_SwapBE16(bit); }; -/** SkOTSetUSHORTBit<N>::value is an SK_OT_ULONG with the Nth BE bit set. */ +/** SkOTSetULONGBit<N>::value is an SK_OT_ULONG with the Nth BE bit set. */ template <unsigned N> struct SkOTSetULONGBit { - static const uint32_t bit = SkTSetBit<N, uint32_t>::value; + SK_COMPILE_ASSERT(N < 32, NTooBig); + static const uint32_t bit = 1u << N; static const SK_OT_ULONG value = SkTEndian_SwapBE32(bit); }; |