From d48ad8e33307ad651264a3c3068b4468201fccf6 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Tue, 1 Apr 2014 16:11:53 +0000 Subject: 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 --- src/sfnt/SkOTTableTypes.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/sfnt') 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::value is an SK_OT_USHORT with the Nth BE bit set. */ template struct SkOTSetUSHORTBit { - static const uint16_t bit = SkTSetBit::value; + SK_COMPILE_ASSERT(N < 16, NTooBig); + static const uint16_t bit = 1u << N; static const SK_OT_USHORT value = SkTEndian_SwapBE16(bit); }; -/** SkOTSetUSHORTBit::value is an SK_OT_ULONG with the Nth BE bit set. */ +/** SkOTSetULONGBit::value is an SK_OT_ULONG with the Nth BE bit set. */ template struct SkOTSetULONGBit { - static const uint32_t bit = SkTSetBit::value; + SK_COMPILE_ASSERT(N < 32, NTooBig); + static const uint32_t bit = 1u << N; static const SK_OT_ULONG value = SkTEndian_SwapBE32(bit); }; -- cgit v1.2.3