From cf39c242057636feebafce347f8e7ac2b305112a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 17 Dec 2018 22:36:23 -0500 Subject: [PATCH] [arrays] Rename Supplier to hb_supplier_t --- src/hb-array.hh | 6 +- src/hb-face.cc | 2 +- src/hb-open-file.hh | 4 +- src/hb-open-type.hh | 4 +- src/hb-ot-cmap-table.hh | 2 +- src/hb-ot-layout-common.hh | 34 +++---- src/hb-ot-layout-gsub-table.hh | 108 ++++++++++----------- src/hb-ot-shape-complex-arabic-fallback.hh | 14 +-- 8 files changed, 87 insertions(+), 87 deletions(-) diff --git a/src/hb-array.hh b/src/hb-array.hh index 5e3f745af..8c02c13bd 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -269,10 +269,10 @@ inline hb_sorted_array_t hb_sorted_array (T *array, unsigned int len) typedef hb_array_t hb_bytes_t; -template struct Supplier : hb_array_t +template struct hb_supplier_t : hb_array_t { - Supplier (const Type *array, unsigned int len) : hb_array_t (array, len) {} - Supplier (hb_array_t v) : hb_array_t (v) {} + hb_supplier_t (const Type *array, unsigned int len) : hb_array_t (array, len) {} + hb_supplier_t (hb_array_t v) : hb_array_t (v) {} }; diff --git a/src/hb-face.cc b/src/hb-face.cc index 4bf84b9d6..eecdef479 100644 --- a/src/hb-face.cc +++ b/src/hb-face.cc @@ -647,7 +647,7 @@ _hb_face_builder_data_reference_blob (hb_face_builder_data_t *data) bool is_cff = data->tables.lsearch (HB_TAG ('C','F','F',' ')) || data->tables.lsearch (HB_TAG ('C','F','F','2')); hb_tag_t sfnt_tag = is_cff ? OT::OpenTypeFontFile::CFFTag : OT::OpenTypeFontFile::TrueTypeTag; - Supplier supplier (data->tables); + hb_supplier_t supplier (data->tables); bool ret = f->serialize_single (&c, sfnt_tag, supplier, diff --git a/src/hb-open-file.hh b/src/hb-open-file.hh index 2d0ee9efd..8890f5239 100644 --- a/src/hb-open-file.hh +++ b/src/hb-open-file.hh @@ -121,7 +121,7 @@ typedef struct OffsetTable template bool serialize (hb_serialize_context_t *c, hb_tag_t sfnt_tag, - Supplier &items, + hb_supplier_t &items, unsigned int table_count) { TRACE_SERIALIZE (this); @@ -485,7 +485,7 @@ struct OpenTypeFontFile template bool serialize_single (hb_serialize_context_t *c, hb_tag_t sfnt_tag, - Supplier &items, + hb_supplier_t &items, unsigned int table_count) { TRACE_SERIALIZE (this); diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index d46df0134..0dfcd3a13 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -554,7 +554,7 @@ struct ArrayOf return_trace (true); } bool serialize (hb_serialize_context_t *c, - Supplier &items, + hb_supplier_t &items, unsigned int items_len) { TRACE_SERIALIZE (this); @@ -701,7 +701,7 @@ struct HeadlessArrayOf { return lenP1.static_size + (lenP1 ? lenP1 - 1 : 0) * Type::static_size; } bool serialize (hb_serialize_context_t *c, - Supplier &items, + hb_supplier_t &items, unsigned int items_len) { TRACE_SERIALIZE (this); diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 0ea5daa97..2f8c64137 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -495,7 +495,7 @@ struct CmapSubtableLongSegmented { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); - Supplier supplier (group_data); + hb_supplier_t supplier (group_data); if (unlikely (!groups.serialize (c, supplier, group_data.len))) return_trace (false); return true; } diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 97f5e977e..d60991880 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -827,7 +827,7 @@ struct CoverageFormat1 } bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, + hb_supplier_t &glyphs, unsigned int num_glyphs) { TRACE_SERIALIZE (this); @@ -902,7 +902,7 @@ struct CoverageFormat2 } bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, + hb_supplier_t &glyphs, unsigned int num_glyphs) { TRACE_SERIALIZE (this); @@ -1051,7 +1051,7 @@ struct Coverage } bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, + hb_supplier_t &glyphs, unsigned int num_glyphs) { TRACE_SERIALIZE (this); @@ -1189,8 +1189,8 @@ struct Coverage */ static inline void ClassDef_serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &klasses, + hb_supplier_t &glyphs, + hb_supplier_t &klasses, unsigned int num_glyphs); struct ClassDefFormat1 @@ -1204,8 +1204,8 @@ struct ClassDefFormat1 } bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &klasses, + hb_supplier_t &glyphs, + hb_supplier_t &klasses, unsigned int num_glyphs) { TRACE_SERIALIZE (this); @@ -1256,8 +1256,8 @@ struct ClassDefFormat1 } c->serializer->err (glyphs.in_error () || klasses.in_error ()); - Supplier glyphs_supplier (glyphs); - Supplier klasses_supplier (klasses); + hb_supplier_t glyphs_supplier (glyphs); + hb_supplier_t klasses_supplier (klasses); ClassDef_serialize (c->serializer, glyphs_supplier, klasses_supplier, @@ -1352,8 +1352,8 @@ struct ClassDefFormat2 } bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &klasses, + hb_supplier_t &glyphs, + hb_supplier_t &klasses, unsigned int num_glyphs) { TRACE_SERIALIZE (this); @@ -1415,8 +1415,8 @@ struct ClassDefFormat2 } c->serializer->err (glyphs.in_error () || klasses.in_error ()); - Supplier glyphs_supplier (glyphs); - Supplier klasses_supplier (klasses); + hb_supplier_t glyphs_supplier (glyphs); + hb_supplier_t klasses_supplier (klasses); ClassDef_serialize (c->serializer, glyphs_supplier, klasses_supplier, @@ -1509,8 +1509,8 @@ struct ClassDef } bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &klasses, + hb_supplier_t &glyphs, + hb_supplier_t &klasses, unsigned int num_glyphs) { TRACE_SERIALIZE (this); @@ -1610,8 +1610,8 @@ struct ClassDef }; static inline void ClassDef_serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &klasses, + hb_supplier_t &glyphs, + hb_supplier_t &klasses, unsigned int num_glyphs) { c->start_embed ()->serialize (c, diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 1a47fa613..d6e9e9d4d 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -36,8 +36,8 @@ namespace OT { static inline void SingleSubst_serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &substitutes, + hb_supplier_t &glyphs, + hb_supplier_t &substitutes, unsigned int num_glyphs); struct SingleSubstFormat1 @@ -95,7 +95,7 @@ struct SingleSubstFormat1 } bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, + hb_supplier_t &glyphs, unsigned int num_glyphs, int delta) { @@ -122,8 +122,8 @@ struct SingleSubstFormat1 } c->serializer->err (from.in_error () || to.in_error ()); - Supplier from_supplier (from); - Supplier to_supplier (to); + hb_supplier_t from_supplier (from); + hb_supplier_t to_supplier (to); SingleSubst_serialize (c->serializer, from_supplier, to_supplier, @@ -201,8 +201,8 @@ struct SingleSubstFormat2 } bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &substitutes, + hb_supplier_t &glyphs, + hb_supplier_t &substitutes, unsigned int num_glyphs) { TRACE_SERIALIZE (this); @@ -227,8 +227,8 @@ struct SingleSubstFormat2 } c->serializer->err (from.in_error () || to.in_error ()); - Supplier from_supplier (from); - Supplier to_supplier (to); + hb_supplier_t from_supplier (from); + hb_supplier_t to_supplier (to); SingleSubst_serialize (c->serializer, from_supplier, to_supplier, @@ -257,8 +257,8 @@ struct SingleSubstFormat2 struct SingleSubst { bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &substitutes, + hb_supplier_t &glyphs, + hb_supplier_t &substitutes, unsigned int num_glyphs) { TRACE_SERIALIZE (this); @@ -305,8 +305,8 @@ struct SingleSubst static inline void SingleSubst_serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &substitutes, + hb_supplier_t &glyphs, + hb_supplier_t &substitutes, unsigned int num_glyphs) { c->start_embed ()->serialize (c, @@ -364,7 +364,7 @@ struct Sequence } bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, + hb_supplier_t &glyphs, unsigned int num_glyphs) { TRACE_SERIALIZE (this); @@ -432,10 +432,10 @@ struct MultipleSubstFormat1 } bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &substitute_len_list, + hb_supplier_t &glyphs, + hb_supplier_t &substitute_len_list, unsigned int num_glyphs, - Supplier &substitute_glyphs_list) + hb_supplier_t &substitute_glyphs_list) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -477,10 +477,10 @@ struct MultipleSubstFormat1 struct MultipleSubst { bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &substitute_len_list, + hb_supplier_t &glyphs, + hb_supplier_t &substitute_len_list, unsigned int num_glyphs, - Supplier &substitute_glyphs_list) + hb_supplier_t &substitute_glyphs_list) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (u.format))) return_trace (false); @@ -552,7 +552,7 @@ struct AlternateSet } bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, + hb_supplier_t &glyphs, unsigned int num_glyphs) { TRACE_SERIALIZE (this); @@ -625,10 +625,10 @@ struct AlternateSubstFormat1 } bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &alternate_len_list, + hb_supplier_t &glyphs, + hb_supplier_t &alternate_len_list, unsigned int num_glyphs, - Supplier &alternate_glyphs_list) + hb_supplier_t &alternate_glyphs_list) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -670,10 +670,10 @@ struct AlternateSubstFormat1 struct AlternateSubst { bool serialize (hb_serialize_context_t *c, - Supplier &glyphs, - Supplier &alternate_len_list, + hb_supplier_t &glyphs, + hb_supplier_t &alternate_len_list, unsigned int num_glyphs, - Supplier &alternate_glyphs_list) + hb_supplier_t &alternate_glyphs_list) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (u.format))) return_trace (false); @@ -786,7 +786,7 @@ struct Ligature bool serialize (hb_serialize_context_t *c, GlyphID ligature, - Supplier &components, /* Starting from second */ + hb_supplier_t &components, /* Starting from second */ unsigned int num_components /* Including first component */) { TRACE_SERIALIZE (this); @@ -867,10 +867,10 @@ struct LigatureSet } bool serialize (hb_serialize_context_t *c, - Supplier &ligatures, - Supplier &component_count_list, + hb_supplier_t &ligatures, + hb_supplier_t &component_count_list, unsigned int num_ligatures, - Supplier &component_list /* Starting from second for each ligature */) + hb_supplier_t &component_list /* Starting from second for each ligature */) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -965,12 +965,12 @@ struct LigatureSubstFormat1 } bool serialize (hb_serialize_context_t *c, - Supplier &first_glyphs, - Supplier &ligature_per_first_glyph_count_list, + hb_supplier_t &first_glyphs, + hb_supplier_t &ligature_per_first_glyph_count_list, unsigned int num_first_glyphs, - Supplier &ligatures_list, - Supplier &component_count_list, - Supplier &component_list /* Starting from second for each ligature */) + hb_supplier_t &ligatures_list, + hb_supplier_t &component_count_list, + hb_supplier_t &component_list /* Starting from second for each ligature */) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -1014,12 +1014,12 @@ struct LigatureSubstFormat1 struct LigatureSubst { bool serialize (hb_serialize_context_t *c, - Supplier &first_glyphs, - Supplier &ligature_per_first_glyph_count_list, + hb_supplier_t &first_glyphs, + hb_supplier_t &ligature_per_first_glyph_count_list, unsigned int num_first_glyphs, - Supplier &ligatures_list, - Supplier &component_count_list, - Supplier &component_list /* Starting from second for each ligature */) + hb_supplier_t &ligatures_list, + hb_supplier_t &component_count_list, + hb_supplier_t &component_list /* Starting from second for each ligature */) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (u.format))) return_trace (false); @@ -1372,8 +1372,8 @@ struct SubstLookup : Lookup bool serialize_single (hb_serialize_context_t *c, uint32_t lookup_props, - Supplier &glyphs, - Supplier &substitutes, + hb_supplier_t &glyphs, + hb_supplier_t &substitutes, unsigned int num_glyphs) { TRACE_SERIALIZE (this); @@ -1383,10 +1383,10 @@ struct SubstLookup : Lookup bool serialize_multiple (hb_serialize_context_t *c, uint32_t lookup_props, - Supplier &glyphs, - Supplier &substitute_len_list, + hb_supplier_t &glyphs, + hb_supplier_t &substitute_len_list, unsigned int num_glyphs, - Supplier &substitute_glyphs_list) + hb_supplier_t &substitute_glyphs_list) { TRACE_SERIALIZE (this); if (unlikely (!Lookup::serialize (c, SubTable::Multiple, lookup_props, 1))) return_trace (false); @@ -1399,10 +1399,10 @@ struct SubstLookup : Lookup bool serialize_alternate (hb_serialize_context_t *c, uint32_t lookup_props, - Supplier &glyphs, - Supplier &alternate_len_list, + hb_supplier_t &glyphs, + hb_supplier_t &alternate_len_list, unsigned int num_glyphs, - Supplier &alternate_glyphs_list) + hb_supplier_t &alternate_glyphs_list) { TRACE_SERIALIZE (this); if (unlikely (!Lookup::serialize (c, SubTable::Alternate, lookup_props, 1))) return_trace (false); @@ -1415,12 +1415,12 @@ struct SubstLookup : Lookup bool serialize_ligature (hb_serialize_context_t *c, uint32_t lookup_props, - Supplier &first_glyphs, - Supplier &ligature_per_first_glyph_count_list, + hb_supplier_t &first_glyphs, + hb_supplier_t &ligature_per_first_glyph_count_list, unsigned int num_first_glyphs, - Supplier &ligatures_list, - Supplier &component_count_list, - Supplier &component_list /* Starting from second for each ligature */) + hb_supplier_t &ligatures_list, + hb_supplier_t &component_count_list, + hb_supplier_t &component_list /* Starting from second for each ligature */) { TRACE_SERIALIZE (this); if (unlikely (!Lookup::serialize (c, SubTable::Ligature, lookup_props, 1))) return_trace (false); diff --git a/src/hb-ot-shape-complex-arabic-fallback.hh b/src/hb-ot-shape-complex-arabic-fallback.hh index 35836658b..ec472d059 100644 --- a/src/hb-ot-shape-complex-arabic-fallback.hh +++ b/src/hb-ot-shape-complex-arabic-fallback.hh @@ -79,8 +79,8 @@ arabic_fallback_synthesize_lookup_single (const hb_ot_shape_plan_t *plan HB_UNUS * May not be good-enough for presidential candidate interviews, but good-enough for us... */ hb_stable_sort (&glyphs[0], num_glyphs, (int(*)(const OT::GlyphID*, const OT::GlyphID *)) OT::GlyphID::cmp, &substitutes[0]); - Supplier glyphs_supplier (glyphs, num_glyphs); - Supplier substitutes_supplier (substitutes, num_glyphs); + hb_supplier_t glyphs_supplier (glyphs, num_glyphs); + hb_supplier_t substitutes_supplier (substitutes, num_glyphs); /* Each glyph takes four bytes max, and there's some overhead. */ char buf[(SHAPING_TABLE_LAST - SHAPING_TABLE_FIRST + 1) * 4 + 128]; @@ -155,11 +155,11 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UN if (!num_ligatures) return nullptr; - Supplier first_glyphs_supplier (first_glyphs, num_first_glyphs); - Supplier ligature_per_first_glyph_count_supplier (ligature_per_first_glyph_count_list, num_first_glyphs); - Supplier ligatures_supplier (ligature_list, num_ligatures); - Supplier component_count_supplier (component_count_list, num_ligatures); - Supplier component_supplier (component_list, num_ligatures); + hb_supplier_t first_glyphs_supplier (first_glyphs, num_first_glyphs); + hb_supplier_t ligature_per_first_glyph_count_supplier (ligature_per_first_glyph_count_list, num_first_glyphs); + hb_supplier_t ligatures_supplier (ligature_list, num_ligatures); + hb_supplier_t component_count_supplier (component_count_list, num_ligatures); + hb_supplier_t component_supplier (component_list, num_ligatures); /* 16 bytes per ligature ought to be enough... */ char buf[ARRAY_LENGTH_CONST (ligature_list) * 16 + 128];