diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index f98bd133f..d27ce4f71 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -422,7 +422,7 @@ struct SinglePosFormat1 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+coverage).add_coverage (&c->input); + (this+coverage).add_coverage (c->input); } inline const Coverage &get_coverage (void) const @@ -467,7 +467,7 @@ struct SinglePosFormat2 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+coverage).add_coverage (&c->input); + (this+coverage).add_coverage (c->input); } inline const Coverage &get_coverage (void) const @@ -572,7 +572,7 @@ struct PairSet unsigned int count = len; for (unsigned int i = 0; i < count; i++) { - c->input.add (record->secondGlyph); + c->input->add (record->secondGlyph); record = &StructAtOffset (record, record_size); } } @@ -638,7 +638,7 @@ struct PairPosFormat1 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+coverage).add_coverage (&c->input); + (this+coverage).add_coverage (c->input); unsigned int count = pairSet.len; for (unsigned int i = 0; i < count; i++) (this+pairSet[i]).collect_glyphs (c, &valueFormat1); @@ -701,19 +701,19 @@ struct PairPosFormat2 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - /* (this+coverage).add_coverage (&c->input); // Don't need this. */ + /* (this+coverage).add_coverage (c->input); // Don't need this. */ /* TODO only add values for pairs that have nonzero adjustments. */ unsigned int count1 = class1Count; const ClassDef &klass1 = this+classDef1; for (unsigned int i = 0; i < count1; i++) - klass1.add_class (&c->input, i); + klass1.add_class (c->input, i); unsigned int count2 = class2Count; const ClassDef &klass2 = this+classDef2; for (unsigned int i = 0; i < count2; i++) - klass2.add_class (&c->input, i); + klass2.add_class (c->input, i); } inline const Coverage &get_coverage (void) const @@ -859,7 +859,7 @@ struct CursivePosFormat1 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+coverage).add_coverage (&c->input); + (this+coverage).add_coverage (c->input); } inline const Coverage &get_coverage (void) const @@ -1005,8 +1005,8 @@ struct MarkBasePosFormat1 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+markCoverage).add_coverage (&c->input); - (this+baseCoverage).add_coverage (&c->input); + (this+markCoverage).add_coverage (c->input); + (this+baseCoverage).add_coverage (c->input); /* TODO only add combinations that have nonzero adjustment. */ } @@ -1109,8 +1109,8 @@ struct MarkLigPosFormat1 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+markCoverage).add_coverage (&c->input); - (this+ligatureCoverage).add_coverage (&c->input); + (this+markCoverage).add_coverage (c->input); + (this+ligatureCoverage).add_coverage (c->input); /* TODO only add combinations that have nonzero adjustment. */ } @@ -1225,8 +1225,8 @@ struct MarkMarkPosFormat1 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+mark1Coverage).add_coverage (&c->input); - (this+mark2Coverage).add_coverage (&c->input); + (this+mark1Coverage).add_coverage (c->input); + (this+mark2Coverage).add_coverage (c->input); /* TODO only add combinations that have nonzero adjustment. */ } diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 69572ef63..2642acbbb 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -54,8 +54,8 @@ struct SingleSubstFormat1 Coverage::Iter iter; for (iter.init (this+coverage); iter.more (); iter.next ()) { hb_codepoint_t glyph_id = iter.get_glyph (); - c->input.add (glyph_id); - c->output.add ((glyph_id + deltaGlyphID) & 0xFFFF); + c->input->add (glyph_id); + c->output->add ((glyph_id + deltaGlyphID) & 0xFFFF); } } @@ -130,8 +130,8 @@ struct SingleSubstFormat2 TRACE_COLLECT_GLYPHS (this); Coverage::Iter iter; for (iter.init (this+coverage); iter.more (); iter.next ()) { - c->input.add (iter.get_glyph ()); - c->output.add (substitute[iter.get_coverage ()]); + c->input->add (iter.get_glyph ()); + c->output->add (substitute[iter.get_coverage ()]); } } @@ -264,7 +264,7 @@ struct Sequence TRACE_COLLECT_GLYPHS (this); unsigned int count = substitute.len; for (unsigned int i = 0; i < count; i++) - c->output.add (substitute[i]); + c->output->add (substitute[i]); } inline bool apply (hb_apply_context_t *c) const @@ -320,7 +320,7 @@ struct MultipleSubstFormat1 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+coverage).add_coverage (&c->input); + (this+coverage).add_coverage (c->input); unsigned int count = sequence.len; for (unsigned int i = 0; i < count; i++) (this+sequence[i]).collect_glyphs (c); @@ -451,11 +451,11 @@ struct AlternateSubstFormat1 TRACE_COLLECT_GLYPHS (this); Coverage::Iter iter; for (iter.init (this+coverage); iter.more (); iter.next ()) { - c->input.add (iter.get_glyph ()); + c->input->add (iter.get_glyph ()); const AlternateSet &alt_set = this+alternateSet[iter.get_coverage ()]; unsigned int count = alt_set.len; for (unsigned int i = 0; i < count; i++) - c->output.add (alt_set[i]); + c->output->add (alt_set[i]); } } @@ -595,8 +595,8 @@ struct Ligature TRACE_COLLECT_GLYPHS (this); unsigned int count = component.len; for (unsigned int i = 1; i < count; i++) - c->input.add (component[i]); - c->output.add (ligGlyph); + c->input->add (component[i]); + c->output->add (ligGlyph); } inline bool would_apply (hb_would_apply_context_t *c) const @@ -767,7 +767,7 @@ struct LigatureSubstFormat1 TRACE_COLLECT_GLYPHS (this); Coverage::Iter iter; for (iter.init (this+coverage); iter.more (); iter.next ()) { - c->input.add (iter.get_glyph ()); + c->input->add (iter.get_glyph ()); (this+ligatureSet[iter.get_coverage ()]).collect_glyphs (c); } } @@ -933,20 +933,20 @@ struct ReverseChainSingleSubstFormat1 unsigned int count; - (this+coverage).add_coverage (&c->input); + (this+coverage).add_coverage (c->input); count = backtrack.len; for (unsigned int i = 0; i < count; i++) - (this+backtrack[i]).add_coverage (&c->before); + (this+backtrack[i]).add_coverage (c->before); count = lookahead.len; for (unsigned int i = 0; i < count; i++) - (this+lookahead[i]).add_coverage (&c->after); + (this+lookahead[i]).add_coverage (c->after); const ArrayOf &substitute = StructAfter > (lookahead); count = substitute.len; for (unsigned int i = 0; i < count; i++) - c->output.add (substitute[i]); + c->output->add (substitute[i]); } inline const Coverage &get_coverage (void) const diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index bdeae845c..69c1739e6 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -162,17 +162,17 @@ struct hb_collect_glyphs_context_t nesting_level_left--; /* Only collect output glyphs in the recursion. */ - hb_collect_glyphs_context_t new_c (this->face, NULL, NULL, NULL, &output, nesting_level_left); + hb_collect_glyphs_context_t new_c (this->face, NULL, NULL, NULL, output, nesting_level_left); recurse_func (&new_c, lookup_index); nesting_level_left++; return VOID; } hb_face_t *face; - hb_set_t &before; - hb_set_t &input; - hb_set_t &after; - hb_set_t &output; + hb_set_t *before; + hb_set_t *input; + hb_set_t *after; + hb_set_t *output; recurse_func_t recurse_func; unsigned int nesting_level_left; unsigned int debug_depth; @@ -184,10 +184,10 @@ struct hb_collect_glyphs_context_t hb_set_t *glyphs_output, /* OUT. May be NULL */ unsigned int nesting_level_left_ = MAX_NESTING_LEVEL) : face (face_), - before (glyphs_before ? *glyphs_before : *hb_set_get_empty ()), - input (glyphs_input ? *glyphs_input : *hb_set_get_empty ()), - after (glyphs_after ? *glyphs_after : *hb_set_get_empty ()), - output (glyphs_output ? *glyphs_output : *hb_set_get_empty ()), + before (glyphs_before ? glyphs_before : hb_set_get_empty ()), + input (glyphs_input ? glyphs_input : hb_set_get_empty ()), + after (glyphs_after ? glyphs_after : hb_set_get_empty ()), + output (glyphs_output ? glyphs_output : hb_set_get_empty ()), recurse_func (NULL), nesting_level_left (nesting_level_left_), debug_depth (0) {} @@ -918,7 +918,7 @@ static inline void context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c const LookupRecord lookupRecord[], ContextCollectGlyphsLookupContext &lookup_context) { - collect_array (c, &c->input, + collect_array (c, c->input, inputCount ? inputCount - 1 : 0, input, lookup_context.funcs.collect, lookup_context.collect_data); recurse_lookups (c, @@ -1090,7 +1090,7 @@ struct ContextFormat1 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+coverage).add_coverage (&c->input); + (this+coverage).add_coverage (c->input); struct ContextCollectGlyphsLookupContext lookup_context = { {collect_glyph}, @@ -1178,7 +1178,7 @@ struct ContextFormat2 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+coverage).add_coverage (&c->input); + (this+coverage).add_coverage (c->input); struct ContextCollectGlyphsLookupContext lookup_context = { {collect_class}, @@ -1268,7 +1268,7 @@ struct ContextFormat3 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+coverage[0]).add_coverage (&c->input); + (this+coverage[0]).add_coverage (c->input); const LookupRecord *lookupRecord = &StructAtOffset (coverage, coverage[0].static_size * glyphCount); struct ContextCollectGlyphsLookupContext lookup_context = { @@ -1428,13 +1428,13 @@ static inline void chain_context_collect_glyphs_lookup (hb_collect_glyphs_contex const LookupRecord lookupRecord[], ChainContextCollectGlyphsLookupContext &lookup_context) { - collect_array (c, &c->before, + collect_array (c, c->before, backtrackCount, backtrack, lookup_context.funcs.collect, lookup_context.collect_data[0]); - collect_array (c, &c->input, + collect_array (c, c->input, inputCount ? inputCount - 1 : 0, input, lookup_context.funcs.collect, lookup_context.collect_data[1]); - collect_array (c, &c->after, + collect_array (c, c->after, lookaheadCount, lookahead, lookup_context.funcs.collect, lookup_context.collect_data[2]); recurse_lookups (c, @@ -1647,7 +1647,7 @@ struct ChainContextFormat1 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+coverage).add_coverage (&c->input); + (this+coverage).add_coverage (c->input); struct ChainContextCollectGlyphsLookupContext lookup_context = { {collect_glyph}, @@ -1737,7 +1737,7 @@ struct ChainContextFormat2 inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - (this+coverage).add_coverage (&c->input); + (this+coverage).add_coverage (c->input); struct ChainContextCollectGlyphsLookupContext lookup_context = { {collect_class}, @@ -1850,7 +1850,7 @@ struct ChainContextFormat3 TRACE_COLLECT_GLYPHS (this); const OffsetArrayOf &input = StructAfter > (backtrack); - (this+input[0]).add_coverage (&c->input); + (this+input[0]).add_coverage (c->input); const OffsetArrayOf &lookahead = StructAfter > (input); const ArrayOf &lookup = StructAfter > (lookahead);