diff options
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); }; |