/* Text before / after the main buffer contents.
* Always in Unicode, and ordered outward.
* Index 0 is for "pre-context", 1 for "post-context". */
- static const unsigned int CONTEXT_LENGTH = 5;
+ enum { CONTEXT_LENGTH = 5 };
hb_codepoint_t context[2][CONTEXT_LENGTH];
unsigned int context_len[2];
#define DEFINE_SIZE_STATIC(size) \
DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size)); \
- static const unsigned int static_size = (size); \
- static const unsigned int min_size = (size); \
+ enum { static_size = (size) }; \
+ enum { min_size = (size) }; \
inline unsigned int get_size (void) const { return (size); }
#define DEFINE_SIZE_UNION(size, _member) \
#define DEFINE_SIZE_ARRAY(size, array) \
DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size) + VAR * sizeof (array[0])); \
DEFINE_COMPILES_ASSERTION ((void) array[0].static_size) \
- static const unsigned int min_size = (size); \
+ enum { min_size = (size) }; \
#define DEFINE_SIZE_ARRAY_SIZED(size, array) \
DEFINE_SIZE_ARRAY(size, array); \
template <typename Context, typename Return, unsigned int MaxDebugDepth>
struct hb_dispatch_context_t
{
- static const unsigned int max_debug_depth = MaxDebugDepth;
+ enum { max_debug_depth = MaxDebugDepth };
typedef Return return_t;
template <typename T, typename F>
inline bool may_dispatch (const T *obj, const F *format) { return true; }
* table list. */
int i = tables.len < 64 ? tables.lsearch (t) : tables.bsearch (t);
if (table_index)
- *table_index = i == -1 ? Index::NOT_FOUND_INDEX : (unsigned int) i;
+ *table_index = i == -1 ? (unsigned) Index::NOT_FOUND_INDEX : (unsigned) i;
return i != -1;
}
inline const TableRecord& get_table_by_tag (hb_tag_t tag) const
/* Script/language-system/feature index */
struct Index : HBUINT16 {
- static const unsigned int NOT_FOUND_INDEX = 0xFFFFu;
+ enum { NOT_FOUND_INDEX = 0xFFFFu };
};
DECLARE_NULL_NAMESPACE_BYTES (OT, Index);
struct FeatureVariations
{
- static const unsigned int NOT_FOUND_INDEX = 0xFFFFFFFFu;
+ enum { NOT_FOUND_INDEX = 0xFFFFFFFFu };
inline bool find_index (const int *coords, unsigned int coord_len,
unsigned int *index) const
struct GSUBProxy
{
- static const unsigned int table_index = 0;
+ enum { table_index = 0 };
static const bool inplace = false;
typedef OT::SubstLookup Lookup;
struct GPOSProxy
{
- static const unsigned int table_index = 1;
+ enum { table_index = 1 };
static const bool inplace = true;
typedef OT::PosLookup Lookup;
{
ASSERT_POD ();
- static const unsigned int mask_bytes = sizeof (mask_t);
- static const unsigned int mask_bits = sizeof (mask_t) * 8;
+ enum { mask_bytes = sizeof (mask_t) };
+ enum { mask_bits = sizeof (mask_t) * 8 };
static const unsigned int num_bits = 0
+ (mask_bytes >= 1 ? 3 : 0)
+ (mask_bytes >= 2 ? 1 : 0)
}
typedef unsigned long long elt_t;
- static const unsigned int PAGE_BITS = 512;
+ enum { PAGE_BITS = 512 };
static_assert ((PAGE_BITS & ((PAGE_BITS) - 1)) == 0, "");
static inline unsigned int elt_get_min (const elt_t &elt) { return hb_ctz (elt); }
typedef hb_vector_size_t<elt_t, PAGE_BITS / 8> vector_t;
- static const unsigned int ELT_BITS = sizeof (elt_t) * 8;
- static const unsigned int ELT_MASK = ELT_BITS - 1;
- static const unsigned int BITS = sizeof (vector_t) * 8;
- static const unsigned int MASK = BITS - 1;
- static_assert (PAGE_BITS == BITS, "");
+ enum { ELT_BITS = sizeof (elt_t) * 8 };
+ enum { ELT_MASK = ELT_BITS - 1 };
+ enum { BITS = sizeof (vector_t) * 8 };
+ enum { MASK = BITS - 1 };
+ static_assert ((unsigned) PAGE_BITS == (unsigned) BITS, "");
elt_t &elt (hb_codepoint_t g) { return v[(g & MASK) / ELT_BITS]; }
elt_t const &elt (hb_codepoint_t g) const { return v[(g & MASK) / ELT_BITS]; }