Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Side by Side Diff: src/sfnt/SkOTTableTypes.h

Issue 1306443004: Use static_assert instead of SK_COMPILE_ASSERT. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/sfnt/SkIBMFamilyClass.h ('k') | src/sfnt/SkOTTable_OS_2.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkOTTableTypes_DEFINED 8 #ifndef SkOTTableTypes_DEFINED
9 #define SkOTTableTypes_DEFINED 9 #define SkOTTableTypes_DEFINED
10 10
(...skipping 29 matching lines...) Expand all
40 * SkOTTableTAG<T>::value is the big endian value of an OpenType table tag. 40 * SkOTTableTAG<T>::value is the big endian value of an OpenType table tag.
41 * It may be directly compared with raw big endian table data. 41 * It may be directly compared with raw big endian table data.
42 */ 42 */
43 static const SK_OT_ULONG value = SkTEndian_SwapBE32( 43 static const SK_OT_ULONG value = SkTEndian_SwapBE32(
44 SkSetFourByteTag(T::TAG0, T::TAG1, T::TAG2, T::TAG3) 44 SkSetFourByteTag(T::TAG0, T::TAG1, T::TAG2, T::TAG3)
45 ); 45 );
46 }; 46 };
47 47
48 /** SkOTSetUSHORTBit<N>::value is an SK_OT_USHORT with the Nth BE bit set. */ 48 /** SkOTSetUSHORTBit<N>::value is an SK_OT_USHORT with the Nth BE bit set. */
49 template <unsigned N> struct SkOTSetUSHORTBit { 49 template <unsigned N> struct SkOTSetUSHORTBit {
50 SK_COMPILE_ASSERT(N < 16, NTooBig); 50 static_assert(N < 16, "NTooBig");
51 static const uint16_t bit = 1u << N; 51 static const uint16_t bit = 1u << N;
52 static const SK_OT_USHORT value = SkTEndian_SwapBE16(bit); 52 static const SK_OT_USHORT value = SkTEndian_SwapBE16(bit);
53 }; 53 };
54 54
55 /** SkOTSetULONGBit<N>::value is an SK_OT_ULONG with the Nth BE bit set. */ 55 /** SkOTSetULONGBit<N>::value is an SK_OT_ULONG with the Nth BE bit set. */
56 template <unsigned N> struct SkOTSetULONGBit { 56 template <unsigned N> struct SkOTSetULONGBit {
57 SK_COMPILE_ASSERT(N < 32, NTooBig); 57 static_assert(N < 32, "NTooBig");
58 static const uint32_t bit = 1u << N; 58 static const uint32_t bit = 1u << N;
59 static const SK_OT_ULONG value = SkTEndian_SwapBE32(bit); 59 static const SK_OT_ULONG value = SkTEndian_SwapBE32(bit);
60 }; 60 };
61 61
62 #endif 62 #endif
OLDNEW
« no previous file with comments | « src/sfnt/SkIBMFamilyClass.h ('k') | src/sfnt/SkOTTable_OS_2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698