diff --git a/src/hb-open-file-private.hh b/src/hb-open-file-private.hh index ab168ab87..393990520 100644 --- a/src/hb-open-file-private.hh +++ b/src/hb-open-file-private.hh @@ -151,8 +151,8 @@ typedef struct OffsetTable if (rec.length % 4) p = c->allocate_size (4 - rec.length % 4); } - tags.advance (table_count); - blobs.advance (table_count); + tags += table_count; + blobs += table_count; /* TODO: update head table checkSumAdjustment. */ diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 3a8f738bc..ef49ea912 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -511,12 +511,13 @@ struct Supplier return * (const Type *) (const void *) ((const char *) head + stride * i); } - inline void advance (unsigned int count) + inline Supplier & operator += (unsigned int count) { if (unlikely (count > len)) count = len; len -= count; head = (const Type *) (const void *) ((const char *) head + stride * count); + return *this; } private: @@ -883,7 +884,7 @@ struct ArrayOf if (unlikely (!serialize (c, items_len))) return_trace (false); for (unsigned int i = 0; i < items_len; i++) array[i] = items[i]; - items.advance (items_len); + items += items_len; return_trace (true); } @@ -1006,7 +1007,7 @@ struct HeadlessArrayOf if (unlikely (!c->extend (*this))) return_trace (false); for (unsigned int i = 0; i < items_len - 1; i++) array[i] = items[i]; - items.advance (items_len - 1); + items += items_len - 1; return_trace (true); } diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index 8bf69a37f..cb66c81ad 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -700,7 +700,7 @@ struct CoverageFormat1 if (unlikely (!c->extend (glyphArray))) return_trace (false); for (unsigned int i = 0; i < num_glyphs; i++) glyphArray[i] = glyphs[i]; - glyphs.advance (num_glyphs); + glyphs += num_glyphs; return_trace (true); } @@ -789,7 +789,7 @@ struct CoverageFormat2 } else { rangeRecord[range].end = glyphs[i]; } - glyphs.advance (num_glyphs); + glyphs += num_glyphs; return_trace (true); } diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 263e0a6e1..97f1d21a5 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -386,7 +386,7 @@ struct MultipleSubstFormat1 if (unlikely (!sequence[i].serialize (c, this).serialize (c, substitute_glyphs_list, substitute_len_list[i]))) return_trace (false); - substitute_len_list.advance (num_glyphs); + substitute_len_list += num_glyphs; if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false); return_trace (true); } @@ -536,7 +536,7 @@ struct AlternateSubstFormat1 if (unlikely (!alternateSet[i].serialize (c, this).serialize (c, alternate_glyphs_list, alternate_len_list[i]))) return_trace (false); - alternate_len_list.advance (num_glyphs); + alternate_len_list += num_glyphs; if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false); return_trace (true); } @@ -757,8 +757,8 @@ struct LigatureSet ligatures[i], component_list, component_count_list[i]))) return_trace (false); - ligatures.advance (num_ligatures); - component_count_list.advance (num_ligatures); + ligatures += num_ligatures; + component_count_list += num_ligatures; return_trace (true); } @@ -850,7 +850,7 @@ struct LigatureSubstFormat1 component_count_list, ligature_per_first_glyph_count_list[i], component_list))) return_trace (false); - ligature_per_first_glyph_count_list.advance (num_first_glyphs); + ligature_per_first_glyph_count_list += num_first_glyphs; if (unlikely (!coverage.serialize (c, this).serialize (c, first_glyphs, num_first_glyphs))) return_trace (false); return_trace (true); }