diff --git a/src/hb-aat-layout-lcar-table.hh b/src/hb-aat-layout-lcar-table.hh index 43ac74f9c..40d34f59b 100644 --- a/src/hb-aat-layout-lcar-table.hh +++ b/src/hb-aat-layout-lcar-table.hh @@ -52,10 +52,10 @@ struct lcar const OffsetTo* entry_offset = lookup.get_value (glyph, font->face->get_num_glyphs ()); const LigCaretClassEntry& array = entry_offset ? this+*entry_offset : Null (LigCaretClassEntry); - if (caret_count && *caret_count) + if (caret_count) { - const HBINT16 *arr = array.sub_array (start_offset, caret_count); - unsigned int count = *caret_count; + hb_array_t arr = array.sub_array (start_offset, caret_count); + unsigned int count = arr.len; for (unsigned int i = 0; i < count; ++i) switch (format) { diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh index 22e07f7a4..2c4cbea85 100644 --- a/src/hb-ot-layout-gdef-table.hh +++ b/src/hb-ot-layout-gdef-table.hh @@ -61,9 +61,10 @@ struct AttachList const AttachPoint &points = this+attachPoint[index]; - if (point_count) { - const HBUINT16 *array = points.sub_array (start_offset, point_count); - unsigned int count = *point_count; + if (point_count) + { + hb_array_t array = points.sub_array (start_offset, point_count); + unsigned int count = array.len; for (unsigned int i = 0; i < count; i++) point_array[i] = array[i]; } @@ -216,9 +217,10 @@ struct LigGlyph unsigned int *caret_count /* IN/OUT */, hb_position_t *caret_array /* OUT */) const { - if (caret_count) { - const OffsetTo *array = carets.sub_array (start_offset, caret_count); - unsigned int count = *caret_count; + if (caret_count) + { + hb_array_t > array = carets.sub_array (start_offset, caret_count); + unsigned int count = array.len; for (unsigned int i = 0; i < count; i++) caret_array[i] = (this+array[i]).get_caret_value (font, direction, glyph_id, var_store); } diff --git a/src/hb-ot-math-table.hh b/src/hb-ot-math-table.hh index b87304979..153a41795 100644 --- a/src/hb-ot-math-table.hh +++ b/src/hb-ot-math-table.hh @@ -509,9 +509,8 @@ struct MathGlyphAssembly if (parts_count) { int scale = font->dir_scale (direction); - const MathGlyphPartRecord *arr = - partRecords.sub_array (start_offset, parts_count); - unsigned int count = *parts_count; + hb_array_t arr = partRecords.sub_array (start_offset, parts_count); + unsigned int count = arr.len; for (unsigned int i = 0; i < count; i++) arr[i].extract (parts[i], scale, font); } @@ -556,9 +555,8 @@ struct MathGlyphConstruction if (variants_count) { int scale = font->dir_scale (direction); - const MathGlyphVariantRecord *arr = - mathGlyphVariantRecord.sub_array (start_offset, variants_count); - unsigned int count = *variants_count; + hb_array_t arr = mathGlyphVariantRecord.sub_array (start_offset, variants_count); + unsigned int count = arr.len; for (unsigned int i = 0; i < count; i++) { variants[i].glyph = arr[i].variantGlyph;