mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 14:31:10 +01:00
[HB] Move code around
This commit is contained in:
1 parent
3564ee5216
commit
80e2aa2e1b
2 files changed
+21
-19
No files matched your search
@@ -578,6 +578,27 @@ struct LongOffsetArrayOf : ArrayOf<LongOffsetTo<Type> > {};
|
||||
template <typename Type>
|
||||
struct LongOffsetLongArrayOf : LongArrayOf<LongOffsetTo<Type> > {};
|
||||
|
||||
/* Array of offsets relative to the beginning of the array itself. */
|
||||
template <typename Type>
|
||||
struct OffsetListOf : OffsetArrayOf<Type>
|
||||
{
|
||||
inline const Type& operator [] (unsigned int i) const
|
||||
{
|
||||
if (HB_UNLIKELY (i >= this->len)) return Null(Type);
|
||||
return this+this->array[i];
|
||||
}
|
||||
|
||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||
SANITIZE_DEBUG ();
|
||||
return OffsetArrayOf<Type>::sanitize (SANITIZE_ARG, CONST_CHARP(this));
|
||||
}
|
||||
inline bool sanitize (SANITIZE_ARG_DEF, unsigned int user_data) {
|
||||
SANITIZE_DEBUG ();
|
||||
return OffsetArrayOf<Type>::sanitize (SANITIZE_ARG, CONST_CHARP(this), user_data);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* An array with a USHORT number of elements,
|
||||
* starting at second element. */
|
||||
template <typename Type>
|
||||
|
||||
@@ -296,25 +296,6 @@ struct Lookup
|
||||
};
|
||||
ASSERT_SIZE (Lookup, 6);
|
||||
|
||||
template <typename Type>
|
||||
struct OffsetListOf : OffsetArrayOf<Type>
|
||||
{
|
||||
inline const Type& operator [] (unsigned int i) const
|
||||
{
|
||||
if (HB_UNLIKELY (i >= this->len)) return Null(Type);
|
||||
return this+this->array[i];
|
||||
}
|
||||
|
||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||
SANITIZE_DEBUG ();
|
||||
return OffsetArrayOf<Type>::sanitize (SANITIZE_ARG, CONST_CHARP(this));
|
||||
}
|
||||
inline bool sanitize (SANITIZE_ARG_DEF, unsigned int user_data) {
|
||||
SANITIZE_DEBUG ();
|
||||
return OffsetArrayOf<Type>::sanitize (SANITIZE_ARG, CONST_CHARP(this), user_data);
|
||||
}
|
||||
};
|
||||
|
||||
typedef OffsetListOf<Lookup> LookupList;
|
||||
ASSERT_SIZE (LookupList, 2);
|
||||
|
||||
|
||||
Reference in new issue
Block a user