diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh | 392 |
1 files changed, 193 insertions, 199 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh index a9bfee155d8..ac6e646384f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh @@ -44,10 +44,10 @@ namespace OT { struct hb_intersects_context_t : hb_dispatch_context_t<hb_intersects_context_t, bool, 0> { - inline const char *get_name (void) { return "INTERSECTS"; } + const char *get_name () { return "INTERSECTS"; } template <typename T> - inline return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); } - static return_t default_return_value (void) { return false; } + return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); } + static return_t default_return_value () { return false; } bool stop_sublookup_iteration (return_t r) const { return r; } const hb_set_t *glyphs; @@ -61,12 +61,11 @@ struct hb_intersects_context_t : struct hb_closure_context_t : hb_dispatch_context_t<hb_closure_context_t, hb_void_t, HB_DEBUG_CLOSURE> { - inline const char *get_name (void) { return "CLOSURE"; } + const char *get_name () { return "CLOSURE"; } typedef return_t (*recurse_func_t) (hb_closure_context_t *c, unsigned int lookup_index); template <typename T> - inline return_t dispatch (const T &obj) { obj.closure (this); return HB_VOID; } - static return_t default_return_value (void) { return HB_VOID; } - bool stop_sublookup_iteration (return_t r HB_UNUSED) const { return false; } + return_t dispatch (const T &obj) { obj.closure (this); return HB_VOID; } + static return_t default_return_value () { return HB_VOID; } void recurse (unsigned int lookup_index) { if (unlikely (nesting_level_left == 0 || !recurse_func)) @@ -109,14 +108,11 @@ struct hb_closure_context_t : debug_depth (0), done_lookups (done_lookups_) {} - ~hb_closure_context_t (void) - { - flush (); - } + ~hb_closure_context_t () { flush (); } void set_recurse_func (recurse_func_t func) { recurse_func = func; } - void flush (void) + void flush () { hb_set_union (glyphs, out); hb_set_clear (out); @@ -130,10 +126,10 @@ struct hb_closure_context_t : struct hb_would_apply_context_t : hb_dispatch_context_t<hb_would_apply_context_t, bool, HB_DEBUG_WOULD_APPLY> { - inline const char *get_name (void) { return "WOULD_APPLY"; } + const char *get_name () { return "WOULD_APPLY"; } template <typename T> - inline return_t dispatch (const T &obj) { return obj.would_apply (this); } - static return_t default_return_value (void) { return false; } + return_t dispatch (const T &obj) { return obj.would_apply (this); } + static return_t default_return_value () { return false; } bool stop_sublookup_iteration (return_t r) const { return r; } hb_face_t *face; @@ -157,12 +153,11 @@ struct hb_would_apply_context_t : struct hb_collect_glyphs_context_t : hb_dispatch_context_t<hb_collect_glyphs_context_t, hb_void_t, HB_DEBUG_COLLECT_GLYPHS> { - inline const char *get_name (void) { return "COLLECT_GLYPHS"; } + const char *get_name () { return "COLLECT_GLYPHS"; } typedef return_t (*recurse_func_t) (hb_collect_glyphs_context_t *c, unsigned int lookup_index); template <typename T> - inline return_t dispatch (const T &obj) { obj.collect_glyphs (this); return HB_VOID; } - static return_t default_return_value (void) { return HB_VOID; } - bool stop_sublookup_iteration (return_t r HB_UNUSED) const { return false; } + return_t dispatch (const T &obj) { obj.collect_glyphs (this); return HB_VOID; } + static return_t default_return_value () { return HB_VOID; } void recurse (unsigned int lookup_index) { if (unlikely (nesting_level_left == 0 || !recurse_func)) @@ -226,7 +221,7 @@ struct hb_collect_glyphs_context_t : recursed_lookups (hb_set_create ()), nesting_level_left (nesting_level_left_), debug_depth (0) {} - ~hb_collect_glyphs_context_t (void) { hb_set_destroy (recursed_lookups); } + ~hb_collect_glyphs_context_t () { hb_set_destroy (recursed_lookups); } void set_recurse_func (recurse_func_t func) { recurse_func = func; } }; @@ -237,11 +232,11 @@ template <typename set_t> struct hb_add_coverage_context_t : hb_dispatch_context_t<hb_add_coverage_context_t<set_t>, const Coverage &, HB_DEBUG_GET_COVERAGE> { - inline const char *get_name (void) { return "GET_COVERAGE"; } + const char *get_name () { return "GET_COVERAGE"; } typedef const Coverage &return_t; template <typename T> - inline return_t dispatch (const T &obj) { return obj.get_coverage (); } - static return_t default_return_value (void) { return Null(Coverage); } + return_t dispatch (const T &obj) { return obj.get_coverage (); } + static return_t default_return_value () { return Null(Coverage); } bool stop_sublookup_iteration (return_t r) const { r.add_coverage (set); @@ -262,7 +257,7 @@ struct hb_ot_apply_context_t : { struct matcher_t { - inline matcher_t (void) : + matcher_t () : lookup_props (0), ignore_zwnj (false), ignore_zwj (false), @@ -275,12 +270,12 @@ struct hb_ot_apply_context_t : typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const HBUINT16 &value, const void *data); - inline void set_ignore_zwnj (bool ignore_zwnj_) { ignore_zwnj = ignore_zwnj_; } - inline void set_ignore_zwj (bool ignore_zwj_) { ignore_zwj = ignore_zwj_; } - inline void set_lookup_props (unsigned int lookup_props_) { lookup_props = lookup_props_; } - inline void set_mask (hb_mask_t mask_) { mask = mask_; } - inline void set_syllable (uint8_t syllable_) { syllable = syllable_; } - inline void set_match_func (match_func_t match_func_, + void set_ignore_zwnj (bool ignore_zwnj_) { ignore_zwnj = ignore_zwnj_; } + void set_ignore_zwj (bool ignore_zwj_) { ignore_zwj = ignore_zwj_; } + void set_lookup_props (unsigned int lookup_props_) { lookup_props = lookup_props_; } + void set_mask (hb_mask_t mask_) { mask = mask_; } + void set_syllable (uint8_t syllable_) { syllable = syllable_; } + void set_match_func (match_func_t match_func_, const void *match_data_) { match_func = match_func_; match_data = match_data_; } @@ -290,7 +285,7 @@ struct hb_ot_apply_context_t : MATCH_MAYBE }; - inline may_match_t may_match (const hb_glyph_info_t &info, + may_match_t may_match (const hb_glyph_info_t &info, const HBUINT16 *glyph_data) const { if (!(info.mask & mask) || @@ -309,9 +304,8 @@ struct hb_ot_apply_context_t : SKIP_MAYBE }; - inline may_skip_t - may_skip (const hb_ot_apply_context_t *c, - const hb_glyph_info_t &info) const + may_skip_t may_skip (const hb_ot_apply_context_t *c, + const hb_glyph_info_t &info) const { if (!c->check_glyph_property (&info, lookup_props)) return SKIP_YES; @@ -336,7 +330,7 @@ struct hb_ot_apply_context_t : struct skipping_iterator_t { - inline void init (hb_ot_apply_context_t *c_, bool context_match = false) + void init (hb_ot_apply_context_t *c_, bool context_match = false) { c = c_; match_glyph_data = nullptr; @@ -348,19 +342,19 @@ struct hb_ot_apply_context_t : matcher.set_ignore_zwj (context_match || c->auto_zwj); matcher.set_mask (context_match ? -1 : c->lookup_mask); } - inline void set_lookup_props (unsigned int lookup_props) + void set_lookup_props (unsigned int lookup_props) { matcher.set_lookup_props (lookup_props); } - inline void set_match_func (matcher_t::match_func_t match_func_, - const void *match_data_, - const HBUINT16 glyph_data[]) + void set_match_func (matcher_t::match_func_t match_func_, + const void *match_data_, + const HBUINT16 glyph_data[]) { matcher.set_match_func (match_func_, match_data_); match_glyph_data = glyph_data; } - inline void reset (unsigned int start_index_, + void reset (unsigned int start_index_, unsigned int num_items_) { idx = start_index_; @@ -369,15 +363,13 @@ struct hb_ot_apply_context_t : matcher.set_syllable (start_index_ == c->buffer->idx ? c->buffer->cur().syllable () : 0); } - inline void reject (void) { num_items++; match_glyph_data--; } + void reject () { num_items++; match_glyph_data--; } - inline matcher_t::may_skip_t - may_skip (const hb_glyph_info_t &info) const - { - return matcher.may_skip (c, info); - } + matcher_t::may_skip_t + may_skip (const hb_glyph_info_t &info) const + { return matcher.may_skip (c, info); } - inline bool next (void) + bool next () { assert (num_items > 0); while (idx + num_items < end) @@ -404,7 +396,7 @@ struct hb_ot_apply_context_t : } return false; } - inline bool prev (void) + bool prev () { assert (num_items > 0); while (idx > num_items - 1) @@ -443,11 +435,11 @@ struct hb_ot_apply_context_t : }; - inline const char *get_name (void) { return "APPLY"; } + const char *get_name () { return "APPLY"; } typedef return_t (*recurse_func_t) (hb_ot_apply_context_t *c, unsigned int lookup_index); template <typename T> - inline return_t dispatch (const T &obj) { return obj.apply (this); } - static return_t default_return_value (void) { return false; } + return_t dispatch (const T &obj) { return obj.apply (this); } + static return_t default_return_value () { return false; } bool stop_sublookup_iteration (return_t r) const { return r; } return_t recurse (unsigned int sub_lookup_index) { @@ -506,31 +498,30 @@ struct hb_ot_apply_context_t : random (false), random_state (1) { init_iters (); } - inline void init_iters (void) + void init_iters () { iter_input.init (this, false); iter_context.init (this, true); } - inline void set_lookup_mask (hb_mask_t mask) { lookup_mask = mask; init_iters (); } - inline void set_auto_zwj (bool auto_zwj_) { auto_zwj = auto_zwj_; init_iters (); } - inline void set_auto_zwnj (bool auto_zwnj_) { auto_zwnj = auto_zwnj_; init_iters (); } - inline void set_random (bool random_) { random = random_; } - inline void set_recurse_func (recurse_func_t func) { recurse_func = func; } - inline void set_lookup_index (unsigned int lookup_index_) { lookup_index = lookup_index_; } - inline void set_lookup_props (unsigned int lookup_props_) { lookup_props = lookup_props_; init_iters (); } + void set_lookup_mask (hb_mask_t mask) { lookup_mask = mask; init_iters (); } + void set_auto_zwj (bool auto_zwj_) { auto_zwj = auto_zwj_; init_iters (); } + void set_auto_zwnj (bool auto_zwnj_) { auto_zwnj = auto_zwnj_; init_iters (); } + void set_random (bool random_) { random = random_; } + void set_recurse_func (recurse_func_t func) { recurse_func = func; } + void set_lookup_index (unsigned int lookup_index_) { lookup_index = lookup_index_; } + void set_lookup_props (unsigned int lookup_props_) { lookup_props = lookup_props_; init_iters (); } - inline uint32_t random_number (void) + uint32_t random_number () { /* http://www.cplusplus.com/reference/random/minstd_rand/ */ random_state = random_state * 48271 % 2147483647; return random_state; } - inline bool - match_properties_mark (hb_codepoint_t glyph, - unsigned int glyph_props, - unsigned int match_props) const + bool match_properties_mark (hb_codepoint_t glyph, + unsigned int glyph_props, + unsigned int match_props) const { /* If using mark filtering sets, the high short of * match_props has the set index. @@ -548,9 +539,8 @@ struct hb_ot_apply_context_t : return true; } - inline bool - check_glyph_property (const hb_glyph_info_t *info, - unsigned int match_props) const + bool check_glyph_property (const hb_glyph_info_t *info, + unsigned int match_props) const { hb_codepoint_t glyph = info->codepoint; unsigned int glyph_props = _hb_glyph_info_get_glyph_props (info); @@ -567,7 +557,7 @@ struct hb_ot_apply_context_t : return true; } - inline void _set_glyph_props (hb_codepoint_t glyph_index, + void _set_glyph_props (hb_codepoint_t glyph_index, unsigned int class_guess = 0, bool ligature = false, bool component = false) const @@ -594,23 +584,23 @@ struct hb_ot_apply_context_t : _hb_glyph_info_set_glyph_props (&buffer->cur(), add_in | class_guess); } - inline void replace_glyph (hb_codepoint_t glyph_index) const + void replace_glyph (hb_codepoint_t glyph_index) const { _set_glyph_props (glyph_index); buffer->replace_glyph (glyph_index); } - inline void replace_glyph_inplace (hb_codepoint_t glyph_index) const + void replace_glyph_inplace (hb_codepoint_t glyph_index) const { _set_glyph_props (glyph_index); buffer->cur().codepoint = glyph_index; } - inline void replace_glyph_with_ligature (hb_codepoint_t glyph_index, + void replace_glyph_with_ligature (hb_codepoint_t glyph_index, unsigned int class_guess) const { _set_glyph_props (glyph_index, class_guess, true); buffer->replace_glyph (glyph_index); } - inline void output_glyph_for_component (hb_codepoint_t glyph_index, + void output_glyph_for_component (hb_codepoint_t glyph_index, unsigned int class_guess) const { _set_glyph_props (glyph_index, class_guess, false, true); @@ -623,7 +613,7 @@ struct hb_get_subtables_context_t : hb_dispatch_context_t<hb_get_subtables_context_t, hb_void_t, HB_DEBUG_APPLY> { template <typename Type> - static inline bool apply_to (const void *obj, OT::hb_ot_apply_context_t *c) + static bool apply_to (const void *obj, OT::hb_ot_apply_context_t *c) { const Type *typed_obj = (const Type *) obj; return typed_obj->apply (c); @@ -634,7 +624,7 @@ struct hb_get_subtables_context_t : struct hb_applicable_t { template <typename T> - inline void init (const T &obj_, hb_apply_func_t apply_func_) + void init (const T &obj_, hb_apply_func_t apply_func_) { obj = &obj_; apply_func = apply_func_; @@ -642,7 +632,7 @@ struct hb_get_subtables_context_t : obj_.get_coverage ().add_coverage (&digest); } - inline bool apply (OT::hb_ot_apply_context_t *c) const + bool apply (OT::hb_ot_apply_context_t *c) const { return digest.may_have (c->buffer->cur().codepoint) && apply_func (obj, c); } @@ -656,16 +646,15 @@ struct hb_get_subtables_context_t : typedef hb_vector_t<hb_applicable_t, 2> array_t; /* Dispatch interface. */ - inline const char *get_name (void) { return "GET_SUBTABLES"; } + const char *get_name () { return "GET_SUBTABLES"; } template <typename T> - inline return_t dispatch (const T &obj) + return_t dispatch (const T &obj) { hb_applicable_t *entry = array.push(); entry->init (obj, apply_to<T>); return HB_VOID; } - static return_t default_return_value (void) { return HB_VOID; } - bool stop_sublookup_iteration (return_t r HB_UNUSED) const { return false; } + static return_t default_return_value () { return HB_VOID; } hb_get_subtables_context_t (array_t &array_) : array (array_), @@ -1061,7 +1050,7 @@ static inline bool match_lookahead (hb_ot_apply_context_t *c, struct LookupRecord { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -1298,14 +1287,14 @@ static inline bool context_apply_lookup (hb_ot_apply_context_t *c, struct Rule { - inline bool intersects (const hb_set_t *glyphs, ContextClosureLookupContext &lookup_context) const + bool intersects (const hb_set_t *glyphs, ContextClosureLookupContext &lookup_context) const { return context_intersects (glyphs, inputCount, inputZ.arrayZ, lookup_context); } - inline void closure (hb_closure_context_t *c, ContextClosureLookupContext &lookup_context) const + void closure (hb_closure_context_t *c, ContextClosureLookupContext &lookup_context) const { TRACE_CLOSURE (this); const UnsizedArrayOf<LookupRecord> &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord> > @@ -1316,7 +1305,8 @@ struct Rule lookup_context); } - inline void collect_glyphs (hb_collect_glyphs_context_t *c, ContextCollectGlyphsLookupContext &lookup_context) const + void collect_glyphs (hb_collect_glyphs_context_t *c, + ContextCollectGlyphsLookupContext &lookup_context) const { TRACE_COLLECT_GLYPHS (this); const UnsizedArrayOf<LookupRecord> &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord> > @@ -1327,7 +1317,8 @@ struct Rule lookup_context); } - inline bool would_apply (hb_would_apply_context_t *c, ContextApplyLookupContext &lookup_context) const + bool would_apply (hb_would_apply_context_t *c, + ContextApplyLookupContext &lookup_context) const { TRACE_WOULD_APPLY (this); const UnsizedArrayOf<LookupRecord> &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord> > @@ -1335,7 +1326,8 @@ struct Rule return_trace (context_would_apply_lookup (c, inputCount, inputZ.arrayZ, lookupCount, lookupRecord.arrayZ, lookup_context)); } - inline bool apply (hb_ot_apply_context_t *c, ContextApplyLookupContext &lookup_context) const + bool apply (hb_ot_apply_context_t *c, + ContextApplyLookupContext &lookup_context) const { TRACE_APPLY (this); const UnsizedArrayOf<LookupRecord> &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord> > @@ -1344,13 +1336,13 @@ struct Rule } public: - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (inputCount.sanitize (c) && lookupCount.sanitize (c) && c->check_range (inputZ.arrayZ, - inputZ[0].static_size * (inputCount ? inputCount - 1 : 0) + + inputZ.item_size * (inputCount ? inputCount - 1 : 0) + LookupRecord::static_size * lookupCount)); } @@ -1371,7 +1363,8 @@ struct Rule struct RuleSet { - inline bool intersects (const hb_set_t *glyphs, ContextClosureLookupContext &lookup_context) const + bool intersects (const hb_set_t *glyphs, + ContextClosureLookupContext &lookup_context) const { unsigned int num_rules = rule.len; for (unsigned int i = 0; i < num_rules; i++) @@ -1380,7 +1373,8 @@ struct RuleSet return false; } - inline void closure (hb_closure_context_t *c, ContextClosureLookupContext &lookup_context) const + void closure (hb_closure_context_t *c, + ContextClosureLookupContext &lookup_context) const { TRACE_CLOSURE (this); unsigned int num_rules = rule.len; @@ -1388,7 +1382,8 @@ struct RuleSet (this+rule[i]).closure (c, lookup_context); } - inline void collect_glyphs (hb_collect_glyphs_context_t *c, ContextCollectGlyphsLookupContext &lookup_context) const + void collect_glyphs (hb_collect_glyphs_context_t *c, + ContextCollectGlyphsLookupContext &lookup_context) const { TRACE_COLLECT_GLYPHS (this); unsigned int num_rules = rule.len; @@ -1396,7 +1391,8 @@ struct RuleSet (this+rule[i]).collect_glyphs (c, lookup_context); } - inline bool would_apply (hb_would_apply_context_t *c, ContextApplyLookupContext &lookup_context) const + bool would_apply (hb_would_apply_context_t *c, + ContextApplyLookupContext &lookup_context) const { TRACE_WOULD_APPLY (this); unsigned int num_rules = rule.len; @@ -1408,7 +1404,8 @@ struct RuleSet return_trace (false); } - inline bool apply (hb_ot_apply_context_t *c, ContextApplyLookupContext &lookup_context) const + bool apply (hb_ot_apply_context_t *c, + ContextApplyLookupContext &lookup_context) const { TRACE_APPLY (this); unsigned int num_rules = rule.len; @@ -1420,7 +1417,7 @@ struct RuleSet return_trace (false); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (rule.sanitize (c, this)); @@ -1437,7 +1434,7 @@ struct RuleSet struct ContextFormat1 { - inline bool intersects (const hb_set_t *glyphs) const + bool intersects (const hb_set_t *glyphs) const { struct ContextClosureLookupContext lookup_context = { {intersects_glyph}, @@ -1456,7 +1453,7 @@ struct ContextFormat1 return false; } - inline void closure (hb_closure_context_t *c) const + void closure (hb_closure_context_t *c) const { TRACE_CLOSURE (this); @@ -1475,7 +1472,7 @@ struct ContextFormat1 } } - inline void collect_glyphs (hb_collect_glyphs_context_t *c) const + void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); (this+coverage).add_coverage (c->input); @@ -1490,7 +1487,7 @@ struct ContextFormat1 (this+ruleSet[i]).collect_glyphs (c, lookup_context); } - inline bool would_apply (hb_would_apply_context_t *c) const + bool would_apply (hb_would_apply_context_t *c) const { TRACE_WOULD_APPLY (this); @@ -1502,10 +1499,9 @@ struct ContextFormat1 return_trace (rule_set.would_apply (c, lookup_context)); } - inline const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } - inline bool apply (hb_ot_apply_context_t *c) const + bool apply (hb_ot_apply_context_t *c) const { TRACE_APPLY (this); unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint); @@ -1520,14 +1516,14 @@ struct ContextFormat1 return_trace (rule_set.apply (c, lookup_context)); } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); // TODO(subset) return_trace (false); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this)); @@ -1548,7 +1544,7 @@ struct ContextFormat1 struct ContextFormat2 { - inline bool intersects (const hb_set_t *glyphs) const + bool intersects (const hb_set_t *glyphs) const { if (!(this+coverage).intersects (glyphs)) return false; @@ -1569,7 +1565,7 @@ struct ContextFormat2 return false; } - inline void closure (hb_closure_context_t *c) const + void closure (hb_closure_context_t *c) const { TRACE_CLOSURE (this); if (!(this+coverage).intersects (c->glyphs)) @@ -1590,7 +1586,7 @@ struct ContextFormat2 } } - inline void collect_glyphs (hb_collect_glyphs_context_t *c) const + void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); (this+coverage).add_coverage (c->input); @@ -1606,7 +1602,7 @@ struct ContextFormat2 (this+ruleSet[i]).collect_glyphs (c, lookup_context); } - inline bool would_apply (hb_would_apply_context_t *c) const + bool would_apply (hb_would_apply_context_t *c) const { TRACE_WOULD_APPLY (this); @@ -1620,10 +1616,9 @@ struct ContextFormat2 return_trace (rule_set.would_apply (c, lookup_context)); } - inline const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } - inline bool apply (hb_ot_apply_context_t *c) const + bool apply (hb_ot_apply_context_t *c) const { TRACE_APPLY (this); unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint); @@ -1639,14 +1634,14 @@ struct ContextFormat2 return_trace (rule_set.apply (c, lookup_context)); } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); // TODO(subset) return_trace (false); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this)); @@ -1670,7 +1665,7 @@ struct ContextFormat2 struct ContextFormat3 { - inline bool intersects (const hb_set_t *glyphs) const + bool intersects (const hb_set_t *glyphs) const { if (!(this+coverageZ[0]).intersects (glyphs)) return false; @@ -1684,7 +1679,7 @@ struct ContextFormat3 lookup_context); } - inline void closure (hb_closure_context_t *c) const + void closure (hb_closure_context_t *c) const { TRACE_CLOSURE (this); if (!(this+coverageZ[0]).intersects (c->glyphs)) @@ -1701,7 +1696,7 @@ struct ContextFormat3 lookup_context); } - inline void collect_glyphs (hb_collect_glyphs_context_t *c) const + void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); (this+coverageZ[0]).add_coverage (c->input); @@ -1718,7 +1713,7 @@ struct ContextFormat3 lookup_context); } - inline bool would_apply (hb_would_apply_context_t *c) const + bool would_apply (hb_would_apply_context_t *c) const { TRACE_WOULD_APPLY (this); @@ -1730,10 +1725,9 @@ struct ContextFormat3 return_trace (context_would_apply_lookup (c, glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1), lookupCount, lookupRecord, lookup_context)); } - inline const Coverage &get_coverage (void) const - { return this+coverageZ[0]; } + const Coverage &get_coverage () const { return this+coverageZ[0]; } - inline bool apply (hb_ot_apply_context_t *c) const + bool apply (hb_ot_apply_context_t *c) const { TRACE_APPLY (this); unsigned int index = (this+coverageZ[0]).get_coverage (c->buffer->cur().codepoint); @@ -1747,14 +1741,14 @@ struct ContextFormat3 return_trace (context_apply_lookup (c, glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1), lookupCount, lookupRecord, lookup_context)); } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); // TODO(subset) return_trace (false); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!c->check_struct (this)) return_trace (false); @@ -1785,7 +1779,7 @@ struct ContextFormat3 struct Context { template <typename context_t> - inline typename context_t::return_t dispatch (context_t *c) const + typename context_t::return_t dispatch (context_t *c) const { TRACE_DISPATCH (this, u.format); if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); @@ -1942,7 +1936,7 @@ static inline bool chain_context_apply_lookup (hb_ot_apply_context_t *c, struct ChainRule { - inline bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const + bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const { const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16> > (backtrack); const ArrayOf<HBUINT16> &lookahead = StructAfter<ArrayOf<HBUINT16> > (input); @@ -1953,7 +1947,8 @@ struct ChainRule lookup_context); } - inline void closure (hb_closure_context_t *c, ChainContextClosureLookupContext &lookup_context) const + void closure (hb_closure_context_t *c, + ChainContextClosureLookupContext &lookup_context) const { TRACE_CLOSURE (this); const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16> > (backtrack); @@ -1967,7 +1962,8 @@ struct ChainRule lookup_context); } - inline void collect_glyphs (hb_collect_glyphs_context_t *c, ChainContextCollectGlyphsLookupContext &lookup_context) const + void collect_glyphs (hb_collect_glyphs_context_t *c, + ChainContextCollectGlyphsLookupContext &lookup_context) const { TRACE_COLLECT_GLYPHS (this); const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16> > (backtrack); @@ -1981,7 +1977,8 @@ struct ChainRule lookup_context); } - inline bool would_apply (hb_would_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const + bool would_apply (hb_would_apply_context_t *c, + ChainContextApplyLookupContext &lookup_context) const { TRACE_WOULD_APPLY (this); const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16> > (backtrack); @@ -1994,7 +1991,7 @@ struct ChainRule lookup.arrayZ, lookup_context)); } - inline bool apply (hb_ot_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const + bool apply (hb_ot_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const { TRACE_APPLY (this); const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16> > (backtrack); @@ -2007,7 +2004,7 @@ struct ChainRule lookup.arrayZ, lookup_context)); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!backtrack.sanitize (c)) return_trace (false); @@ -2039,7 +2036,7 @@ struct ChainRule struct ChainRuleSet { - inline bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const + bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const { unsigned int num_rules = rule.len; for (unsigned int i = 0; i < num_rules; i++) @@ -2047,7 +2044,7 @@ struct ChainRuleSet return true; return false; } - inline void closure (hb_closure_context_t *c, ChainContextClosureLookupContext &lookup_context) const + void closure (hb_closure_context_t *c, ChainContextClosureLookupContext &lookup_context) const { TRACE_CLOSURE (this); unsigned int num_rules = rule.len; @@ -2055,7 +2052,7 @@ struct ChainRuleSet (this+rule[i]).closure (c, lookup_context); } - inline void collect_glyphs (hb_collect_glyphs_context_t *c, ChainContextCollectGlyphsLookupContext &lookup_context) const + void collect_glyphs (hb_collect_glyphs_context_t *c, ChainContextCollectGlyphsLookupContext &lookup_context) const { TRACE_COLLECT_GLYPHS (this); unsigned int num_rules = rule.len; @@ -2063,7 +2060,7 @@ struct ChainRuleSet (this+rule[i]).collect_glyphs (c, lookup_context); } - inline bool would_apply (hb_would_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const + bool would_apply (hb_would_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const { TRACE_WOULD_APPLY (this); unsigned int num_rules = rule.len; @@ -2074,7 +2071,7 @@ struct ChainRuleSet return_trace (false); } - inline bool apply (hb_ot_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const + bool apply (hb_ot_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const { TRACE_APPLY (this); unsigned int num_rules = rule.len; @@ -2085,7 +2082,7 @@ struct ChainRuleSet return_trace (false); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (rule.sanitize (c, this)); @@ -2101,7 +2098,7 @@ struct ChainRuleSet struct ChainContextFormat1 { - inline bool intersects (const hb_set_t *glyphs) const + bool intersects (const hb_set_t *glyphs) const { struct ChainContextClosureLookupContext lookup_context = { {intersects_glyph}, @@ -2120,7 +2117,7 @@ struct ChainContextFormat1 return false; } - inline void closure (hb_closure_context_t *c) const + void closure (hb_closure_context_t *c) const { TRACE_CLOSURE (this); @@ -2139,7 +2136,7 @@ struct ChainContextFormat1 } } - inline void collect_glyphs (hb_collect_glyphs_context_t *c) const + void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); (this+coverage).add_coverage (c->input); @@ -2154,7 +2151,7 @@ struct ChainContextFormat1 (this+ruleSet[i]).collect_glyphs (c, lookup_context); } - inline bool would_apply (hb_would_apply_context_t *c) const + bool would_apply (hb_would_apply_context_t *c) const { TRACE_WOULD_APPLY (this); @@ -2166,10 +2163,9 @@ struct ChainContextFormat1 return_trace (rule_set.would_apply (c, lookup_context)); } - inline const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } - inline bool apply (hb_ot_apply_context_t *c) const + bool apply (hb_ot_apply_context_t *c) const { TRACE_APPLY (this); unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint); @@ -2183,14 +2179,14 @@ struct ChainContextFormat1 return_trace (rule_set.apply (c, lookup_context)); } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); // TODO(subset) return_trace (false); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this)); @@ -2210,7 +2206,7 @@ struct ChainContextFormat1 struct ChainContextFormat2 { - inline bool intersects (const hb_set_t *glyphs) const + bool intersects (const hb_set_t *glyphs) const { if (!(this+coverage).intersects (glyphs)) return false; @@ -2234,7 +2230,7 @@ struct ChainContextFormat2 return false; } - inline void closure (hb_closure_context_t *c) const + void closure (hb_closure_context_t *c) const { TRACE_CLOSURE (this); if (!(this+coverage).intersects (c->glyphs)) @@ -2259,7 +2255,7 @@ struct ChainContextFormat2 } } - inline void collect_glyphs (hb_collect_glyphs_context_t *c) const + void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); (this+coverage).add_coverage (c->input); @@ -2280,7 +2276,7 @@ struct ChainContextFormat2 (this+ruleSet[i]).collect_glyphs (c, lookup_context); } - inline bool would_apply (hb_would_apply_context_t *c) const + bool would_apply (hb_would_apply_context_t *c) const { TRACE_WOULD_APPLY (this); @@ -2299,10 +2295,9 @@ struct ChainContextFormat2 return_trace (rule_set.would_apply (c, lookup_context)); } - inline const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } - inline bool apply (hb_ot_apply_context_t *c) const + bool apply (hb_ot_apply_context_t *c) const { TRACE_APPLY (this); unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint); @@ -2323,14 +2318,14 @@ struct ChainContextFormat2 return_trace (rule_set.apply (c, lookup_context)); } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); // TODO(subset) return_trace (false); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (coverage.sanitize (c, this) && @@ -2366,7 +2361,7 @@ struct ChainContextFormat2 struct ChainContextFormat3 { - inline bool intersects (const hb_set_t *glyphs) const + bool intersects (const hb_set_t *glyphs) const { const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack); @@ -2385,7 +2380,7 @@ struct ChainContextFormat3 lookup_context); } - inline void closure (hb_closure_context_t *c) const + void closure (hb_closure_context_t *c) const { TRACE_CLOSURE (this); const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack); @@ -2407,7 +2402,7 @@ struct ChainContextFormat3 lookup_context); } - inline void collect_glyphs (hb_collect_glyphs_context_t *c) const + void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack); @@ -2428,7 +2423,7 @@ struct ChainContextFormat3 lookup_context); } - inline bool would_apply (hb_would_apply_context_t *c) const + bool would_apply (hb_would_apply_context_t *c) const { TRACE_WOULD_APPLY (this); @@ -2446,13 +2441,13 @@ struct ChainContextFormat3 lookup.len, lookup.arrayZ, lookup_context)); } - inline const Coverage &get_coverage (void) const + const Coverage &get_coverage () const { const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack); return this+input[0]; } - inline bool apply (hb_ot_apply_context_t *c) const + bool apply (hb_ot_apply_context_t *c) const { TRACE_APPLY (this); const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack); @@ -2473,14 +2468,14 @@ struct ChainContextFormat3 lookup.len, lookup.arrayZ, lookup_context)); } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); // TODO(subset) return_trace (false); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!backtrack.sanitize (c, this)) return_trace (false); @@ -2517,7 +2512,7 @@ struct ChainContextFormat3 struct ChainContext { template <typename context_t> - inline typename context_t::return_t dispatch (context_t *c) const + typename context_t::return_t dispatch (context_t *c) const { TRACE_DISPATCH (this, u.format); if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); @@ -2542,10 +2537,10 @@ struct ChainContext template <typename T> struct ExtensionFormat1 { - inline unsigned int get_type (void) const { return extensionLookupType; } + unsigned int get_type () const { return extensionLookupType; } template <typename X> - inline const X& get_subtable (void) const + const X& get_subtable () const { unsigned int offset = extensionOffset; if (unlikely (!offset)) return Null(typename T::SubTable); @@ -2553,7 +2548,7 @@ struct ExtensionFormat1 } template <typename context_t> - inline typename context_t::return_t dispatch (context_t *c) const + typename context_t::return_t dispatch (context_t *c) const { TRACE_DISPATCH (this, format); if (unlikely (!c->may_dispatch (this, this))) return_trace (c->no_dispatch_return_value ()); @@ -2561,7 +2556,7 @@ struct ExtensionFormat1 } /* This is called from may_dispatch() above with hb_sanitize_context_t. */ - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -2583,7 +2578,7 @@ struct ExtensionFormat1 template <typename T> struct Extension { - inline unsigned int get_type (void) const + unsigned int get_type () const { switch (u.format) { case 1: return u.format1.get_type (); @@ -2591,7 +2586,7 @@ struct Extension } } template <typename X> - inline const X& get_subtable (void) const + const X& get_subtable () const { switch (u.format) { case 1: return u.format1.template get_subtable<typename T::SubTable> (); @@ -2600,7 +2595,7 @@ struct Extension } template <typename context_t> - inline typename context_t::return_t dispatch (context_t *c) const + typename context_t::return_t dispatch (context_t *c) const { TRACE_DISPATCH (this, u.format); if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); @@ -2625,7 +2620,7 @@ struct Extension struct hb_ot_layout_lookup_accelerator_t { template <typename TLookup> - inline void init (const TLookup &lookup) + void init (const TLookup &lookup) { digest.init (); lookup.add_coverage (&digest); @@ -2634,15 +2629,12 @@ struct hb_ot_layout_lookup_accelerator_t OT::hb_get_subtables_context_t c_get_subtables (subtables); lookup.dispatch (&c_get_subtables); } - inline void fini (void) - { - subtables.fini (); - } + void fini () { subtables.fini (); } - inline bool may_have (hb_codepoint_t g) const + bool may_have (hb_codepoint_t g) const { return digest.may_have (g); } - inline bool apply (hb_ot_apply_context_t *c) const + bool apply (hb_ot_apply_context_t *c) const { for (unsigned int i = 0; i < subtables.len; i++) if (subtables[i].apply (c)) @@ -2657,43 +2649,43 @@ struct hb_ot_layout_lookup_accelerator_t struct GSUBGPOS { - inline bool has_data (void) const { return version.to_int (); } - inline unsigned int get_script_count (void) const + bool has_data () const { return version.to_int (); } + unsigned int get_script_count () const { return (this+scriptList).len; } - inline const Tag& get_script_tag (unsigned int i) const + const Tag& get_script_tag (unsigned int i) const { return (this+scriptList).get_tag (i); } - inline unsigned int get_script_tags (unsigned int start_offset, - unsigned int *script_count /* IN/OUT */, - hb_tag_t *script_tags /* OUT */) const + unsigned int get_script_tags (unsigned int start_offset, + unsigned int *script_count /* IN/OUT */, + hb_tag_t *script_tags /* OUT */) const { return (this+scriptList).get_tags (start_offset, script_count, script_tags); } - inline const Script& get_script (unsigned int i) const + const Script& get_script (unsigned int i) const { return (this+scriptList)[i]; } - inline bool find_script_index (hb_tag_t tag, unsigned int *index) const + bool find_script_index (hb_tag_t tag, unsigned int *index) const { return (this+scriptList).find_index (tag, index); } - inline unsigned int get_feature_count (void) const + unsigned int get_feature_count () const { return (this+featureList).len; } - inline hb_tag_t get_feature_tag (unsigned int i) const + hb_tag_t get_feature_tag (unsigned int i) const { return i == Index::NOT_FOUND_INDEX ? HB_TAG_NONE : (this+featureList).get_tag (i); } - inline unsigned int get_feature_tags (unsigned int start_offset, - unsigned int *feature_count /* IN/OUT */, - hb_tag_t *feature_tags /* OUT */) const + unsigned int get_feature_tags (unsigned int start_offset, + unsigned int *feature_count /* IN/OUT */, + hb_tag_t *feature_tags /* OUT */) const { return (this+featureList).get_tags (start_offset, feature_count, feature_tags); } - inline const Feature& get_feature (unsigned int i) const + const Feature& get_feature (unsigned int i) const { return (this+featureList)[i]; } - inline bool find_feature_index (hb_tag_t tag, unsigned int *index) const + bool find_feature_index (hb_tag_t tag, unsigned int *index) const { return (this+featureList).find_index (tag, index); } - inline unsigned int get_lookup_count (void) const + unsigned int get_lookup_count () const { return (this+lookupList).len; } - inline const Lookup& get_lookup (unsigned int i) const + const Lookup& get_lookup (unsigned int i) const { return (this+lookupList)[i]; } - inline bool find_variations_index (const int *coords, unsigned int num_coords, - unsigned int *index) const + bool find_variations_index (const int *coords, unsigned int num_coords, + unsigned int *index) const { return (version.to_int () >= 0x00010001u ? this+featureVars : Null(FeatureVariations)) .find_index (coords, num_coords, index); } - inline const Feature& get_feature_variation (unsigned int feature_index, + const Feature& get_feature_variation (unsigned int feature_index, unsigned int variations_index) const { if (FeatureVariations::NOT_FOUND_INDEX != variations_index && @@ -2708,11 +2700,12 @@ struct GSUBGPOS } template <typename TLookup> - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); struct GSUBGPOS *out = c->serializer->embed (*this); if (unlikely (!out)) return_trace (false); + out->scriptList.serialize_subset (c, this+scriptList, out); out->featureList.serialize_subset (c, this+featureList, out); @@ -2725,17 +2718,18 @@ struct GSUBGPOS if (version.to_int () >= 0x00010001u) out->featureVars.serialize_subset (c, this+featureVars, out); + return_trace (true); } - inline unsigned int get_size (void) const + unsigned int get_size () const { return min_size + (version.to_int () >= 0x00010001u ? featureVars.static_size : 0); } template <typename TLookup> - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); typedef OffsetListOf<TLookup> TLookupList; @@ -2750,7 +2744,7 @@ struct GSUBGPOS template <typename T> struct accelerator_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { this->table = hb_sanitize_context_t().reference_table<T> (face); if (unlikely (this->table->is_blacklisted (this->table.get_blob (), face))) @@ -2769,7 +2763,7 @@ struct GSUBGPOS this->accels[i].init (table->get_lookup (i)); } - inline void fini (void) + void fini () { for (unsigned int i = 0; i < this->lookup_count; i++) this->accels[i].fini (); |