summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-08-14 18:40:56 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-08-14 18:40:56 -0400
commit1b91a23d57d1aef4349f28e0154aff68ad855357 (patch)
treeaa3a1c0a45c912daa2d5725a01432d0d86424c43
parent165203e4f57c39d292f4a010561948b58c6196ab (diff)
downloadpango-1b91a23d57d1aef4349f28e0154aff68ad855357.tar.gz
[HB] Move code around
-rw-r--r--pango/opentype/hb-open-type-private.hh21
-rw-r--r--pango/opentype/hb-ot-layout-common-private.hh19
2 files changed, 21 insertions, 19 deletions
diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh
index caf68575..bc3e90e2 100644
--- a/pango/opentype/hb-open-type-private.hh
+++ b/pango/opentype/hb-open-type-private.hh
@@ -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>
diff --git a/pango/opentype/hb-ot-layout-common-private.hh b/pango/opentype/hb-ot-layout-common-private.hh
index 764f14e7..e6194bbb 100644
--- a/pango/opentype/hb-ot-layout-common-private.hh
+++ b/pango/opentype/hb-ot-layout-common-private.hh
@@ -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);