diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index f6081f07af0ad9b36158152788aea45c59a1373e..0b17effa02d82c6cbb0b7b325e19708cb6d1e813 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -692,8 +692,8 @@ struct FixedVersion * Use: (base+offset) */ -template -struct OffsetTo : OffsetType +template +struct OffsetTo : GenericOffset { inline const Type& operator () (const void *base) const { @@ -737,16 +737,14 @@ static inline const Type& operator + (const Base &base, const OffsetTo static inline Type& operator + (Base &base, OffsetTo &offset) { return offset (base); } -template -struct LongOffsetTo : OffsetTo {}; - /* * Array Types */ -template -struct GenericArrayOf +/* An array with a number of elements. */ +template +struct ArrayOf { const Type *sub_array (unsigned int start_offset, unsigned int *pcount /* IN/OUT */) const { @@ -852,13 +850,9 @@ struct GenericArrayOf DEFINE_SIZE_ARRAY (sizeof (LenType), array); }; -/* An array with a USHORT number of elements. */ -template -struct ArrayOf : GenericArrayOf {}; - /* An array with a ULONG number of elements. */ template -struct LongArrayOf : GenericArrayOf {}; +struct LongArrayOf : ArrayOf {}; /* Array of Offset's */ template @@ -866,11 +860,11 @@ struct OffsetArrayOf : ArrayOf > {}; /* Array of LongOffset's */ template -struct LongOffsetArrayOf : ArrayOf > {}; +struct LongOffsetArrayOf : ArrayOf > {}; /* LongArray of LongOffset's */ template -struct LongOffsetLongArrayOf : LongArrayOf > {}; +struct LongOffsetLongArrayOf : LongArrayOf > {}; /* Array of offsets relative to the beginning of the array itself. */ template @@ -951,8 +945,8 @@ struct HeadlessArrayOf /* An array with sorted elements. Supports binary searching. */ -template -struct GenericSortedArrayOf : GenericArrayOf +template +struct SortedArrayOf : ArrayOf { template inline int bsearch (const SearchType &x) const @@ -974,13 +968,9 @@ struct GenericSortedArrayOf : GenericArrayOf } }; -/* A sorted array with a USHORT number of elements. */ -template -struct SortedArrayOf : GenericSortedArrayOf {}; - /* A sorted array with a ULONG number of elements. */ template -struct LongSortedArrayOf : GenericSortedArrayOf {}; +struct LongSortedArrayOf : SortedArrayOf {}; } /* namespace OT */ diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index a50dca68ef379ecd8b7286ad8cdc1a798e7323ed..abdd8db41f866db74e6b6ccb5d677ee74dc4e5f3 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -229,7 +229,7 @@ struct CmapSubtableTrimmed UINT length; /* Byte length of this subtable. */ UINT language; /* Ignore. */ UINT startCharCode; /* First character code covered. */ - GenericArrayOf + ArrayOf glyphIdArray; /* Array of glyph index values for character * codes in the range. */ public: @@ -350,7 +350,7 @@ struct EncodingRecord USHORT platformID; /* Platform ID. */ USHORT encodingID; /* Platform-specific encoding ID. */ - LongOffsetTo + OffsetTo subtable; /* Byte offset from beginning of table to the subtable for this encoding. */ public: DEFINE_SIZE_STATIC (8); diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index 3904c2dd67899d9c5b5aa5d0ee78de0e1bd9a709..479fb26509145b91b23baf75fd8fed5b58e13529 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -506,7 +506,7 @@ struct Feature if (unlikely (!featureParams.sanitize (c, this, closure ? closure->tag : HB_TAG_NONE))) return TRACE_RETURN (false); - if (likely (!orig_offset)) + if (likely (orig_offset.is_null ())) return TRACE_RETURN (true); if (featureParams == 0 && closure &&