Minor: Remove some GenericXXX templates
This commit is contained in:
parent
36073ede5b
commit
9da552dcc5
|
@ -692,8 +692,8 @@ struct FixedVersion
|
||||||
* Use: (base+offset)
|
* Use: (base+offset)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <typename Type, typename OffsetType=Offset>
|
template <typename Type, typename OffsetType=USHORT>
|
||||||
struct OffsetTo : OffsetType
|
struct OffsetTo : GenericOffset<OffsetType>
|
||||||
{
|
{
|
||||||
inline const Type& operator () (const void *base) const
|
inline const Type& operator () (const void *base) const
|
||||||
{
|
{
|
||||||
|
@ -737,16 +737,14 @@ static inline const Type& operator + (const Base &base, const OffsetTo<Type, Off
|
||||||
template <typename Base, typename OffsetType, typename Type>
|
template <typename Base, typename OffsetType, typename Type>
|
||||||
static inline Type& operator + (Base &base, OffsetTo<Type, OffsetType> &offset) { return offset (base); }
|
static inline Type& operator + (Base &base, OffsetTo<Type, OffsetType> &offset) { return offset (base); }
|
||||||
|
|
||||||
template <typename Type>
|
|
||||||
struct LongOffsetTo : OffsetTo<Type, LongOffset> {};
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Array Types
|
* Array Types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <typename Type, typename LenType>
|
/* An array with a number of elements. */
|
||||||
struct GenericArrayOf
|
template <typename Type, typename LenType=USHORT>
|
||||||
|
struct ArrayOf
|
||||||
{
|
{
|
||||||
const Type *sub_array (unsigned int start_offset, unsigned int *pcount /* IN/OUT */) const
|
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);
|
DEFINE_SIZE_ARRAY (sizeof (LenType), array);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* An array with a USHORT number of elements. */
|
|
||||||
template <typename Type>
|
|
||||||
struct ArrayOf : GenericArrayOf<Type, USHORT> {};
|
|
||||||
|
|
||||||
/* An array with a ULONG number of elements. */
|
/* An array with a ULONG number of elements. */
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
struct LongArrayOf : GenericArrayOf<Type, ULONG> {};
|
struct LongArrayOf : ArrayOf<Type, ULONG> {};
|
||||||
|
|
||||||
/* Array of Offset's */
|
/* Array of Offset's */
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
|
@ -866,11 +860,11 @@ struct OffsetArrayOf : ArrayOf<OffsetTo<Type> > {};
|
||||||
|
|
||||||
/* Array of LongOffset's */
|
/* Array of LongOffset's */
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
struct LongOffsetArrayOf : ArrayOf<LongOffsetTo<Type> > {};
|
struct LongOffsetArrayOf : ArrayOf<OffsetTo<Type, ULONG> > {};
|
||||||
|
|
||||||
/* LongArray of LongOffset's */
|
/* LongArray of LongOffset's */
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
struct LongOffsetLongArrayOf : LongArrayOf<LongOffsetTo<Type> > {};
|
struct LongOffsetLongArrayOf : LongArrayOf<OffsetTo<Type, ULONG> > {};
|
||||||
|
|
||||||
/* Array of offsets relative to the beginning of the array itself. */
|
/* Array of offsets relative to the beginning of the array itself. */
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
|
@ -951,8 +945,8 @@ struct HeadlessArrayOf
|
||||||
|
|
||||||
|
|
||||||
/* An array with sorted elements. Supports binary searching. */
|
/* An array with sorted elements. Supports binary searching. */
|
||||||
template <typename Type, typename LenType>
|
template <typename Type, typename LenType=USHORT>
|
||||||
struct GenericSortedArrayOf : GenericArrayOf<Type, LenType>
|
struct SortedArrayOf : ArrayOf<Type, LenType>
|
||||||
{
|
{
|
||||||
template <typename SearchType>
|
template <typename SearchType>
|
||||||
inline int bsearch (const SearchType &x) const
|
inline int bsearch (const SearchType &x) const
|
||||||
|
@ -974,13 +968,9 @@ struct GenericSortedArrayOf : GenericArrayOf<Type, LenType>
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* A sorted array with a USHORT number of elements. */
|
|
||||||
template <typename Type>
|
|
||||||
struct SortedArrayOf : GenericSortedArrayOf<Type, USHORT> {};
|
|
||||||
|
|
||||||
/* A sorted array with a ULONG number of elements. */
|
/* A sorted array with a ULONG number of elements. */
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
struct LongSortedArrayOf : GenericSortedArrayOf<Type, ULONG> {};
|
struct LongSortedArrayOf : SortedArrayOf<Type, ULONG> {};
|
||||||
|
|
||||||
|
|
||||||
} /* namespace OT */
|
} /* namespace OT */
|
||||||
|
|
|
@ -229,7 +229,7 @@ struct CmapSubtableTrimmed
|
||||||
UINT length; /* Byte length of this subtable. */
|
UINT length; /* Byte length of this subtable. */
|
||||||
UINT language; /* Ignore. */
|
UINT language; /* Ignore. */
|
||||||
UINT startCharCode; /* First character code covered. */
|
UINT startCharCode; /* First character code covered. */
|
||||||
GenericArrayOf<GlyphID, UINT>
|
ArrayOf<GlyphID, UINT>
|
||||||
glyphIdArray; /* Array of glyph index values for character
|
glyphIdArray; /* Array of glyph index values for character
|
||||||
* codes in the range. */
|
* codes in the range. */
|
||||||
public:
|
public:
|
||||||
|
@ -350,7 +350,7 @@ struct EncodingRecord
|
||||||
|
|
||||||
USHORT platformID; /* Platform ID. */
|
USHORT platformID; /* Platform ID. */
|
||||||
USHORT encodingID; /* Platform-specific encoding ID. */
|
USHORT encodingID; /* Platform-specific encoding ID. */
|
||||||
LongOffsetTo<CmapSubtable>
|
OffsetTo<CmapSubtable, ULONG>
|
||||||
subtable; /* Byte offset from beginning of table to the subtable for this encoding. */
|
subtable; /* Byte offset from beginning of table to the subtable for this encoding. */
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_STATIC (8);
|
DEFINE_SIZE_STATIC (8);
|
||||||
|
|
|
@ -506,7 +506,7 @@ struct Feature
|
||||||
if (unlikely (!featureParams.sanitize (c, this, closure ? closure->tag : HB_TAG_NONE)))
|
if (unlikely (!featureParams.sanitize (c, this, closure ? closure->tag : HB_TAG_NONE)))
|
||||||
return TRACE_RETURN (false);
|
return TRACE_RETURN (false);
|
||||||
|
|
||||||
if (likely (!orig_offset))
|
if (likely (orig_offset.is_null ()))
|
||||||
return TRACE_RETURN (true);
|
return TRACE_RETURN (true);
|
||||||
|
|
||||||
if (featureParams == 0 && closure &&
|
if (featureParams == 0 && closure &&
|
||||||
|
|
Loading…
Reference in New Issue