| OLD | NEW |
| 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 |
| 11 #include "SkTemplates.h" | |
| 12 #include "SkTypes.h" | 11 #include "SkTypes.h" |
| 13 #include "SkEndian.h" | 12 #include "SkEndian.h" |
| 14 | 13 |
| 15 //All SK_OT_ prefixed types should be considered as big endian. | 14 //All SK_OT_ prefixed types should be considered as big endian. |
| 16 typedef uint8_t SK_OT_BYTE; | 15 typedef uint8_t SK_OT_BYTE; |
| 17 #if CHAR_BIT == 8 | 16 #if CHAR_BIT == 8 |
| 18 typedef signed char SK_OT_CHAR; //easier to debug | 17 typedef signed char SK_OT_CHAR; //easier to debug |
| 19 #else | 18 #else |
| 20 typedef int8_t SK_OT_CHAR; | 19 typedef int8_t SK_OT_CHAR; |
| 21 #endif | 20 #endif |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 }; | 53 }; |
| 55 | 54 |
| 56 /** 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. */ |
| 57 template <unsigned N> struct SkOTSetULONGBit { | 56 template <unsigned N> struct SkOTSetULONGBit { |
| 58 SK_COMPILE_ASSERT(N < 32, NTooBig); | 57 SK_COMPILE_ASSERT(N < 32, NTooBig); |
| 59 static const uint32_t bit = 1u << N; | 58 static const uint32_t bit = 1u << N; |
| 60 static const SK_OT_ULONG value = SkTEndian_SwapBE32(bit); | 59 static const SK_OT_ULONG value = SkTEndian_SwapBE32(bit); |
| 61 }; | 60 }; |
| 62 | 61 |
| 63 #endif | 62 #endif |
| OLD | NEW |