diff --git a/src/hb-aat-fdsc-table.hh b/src/hb-aat-fdsc-table.hh index a7458b9b0..02392a651 100644 --- a/src/hb-aat-fdsc-table.hh +++ b/src/hb-aat-fdsc-table.hh @@ -40,11 +40,11 @@ namespace AAT { struct FontDescriptor { - inline bool has_data (void) const { return tag; } + bool has_data (void) const { return tag; } - inline int cmp (hb_tag_t a) const { return tag.cmp (a); } + int cmp (hb_tag_t a) const { return tag.cmp (a); } - inline float get_value (void) const { return u.value.to_float (); } + float get_value (void) const { return u.value.to_float (); } enum non_alphabetic_value_t { Alphabetic = 0, @@ -56,7 +56,7 @@ struct FontDescriptor MathSymbols = 6 }; - 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)); @@ -97,10 +97,10 @@ struct fdsc * (default value: 0) */ }; - inline const FontDescriptor &get_descriptor (hb_tag_t style) const + const FontDescriptor &get_descriptor (hb_tag_t style) const { return descriptors.lsearch (style); } - 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) && diff --git a/src/hb-aat-layout-ankr-table.hh b/src/hb-aat-layout-ankr-table.hh index 763bbedde..4235b363a 100644 --- a/src/hb-aat-layout-ankr-table.hh +++ b/src/hb-aat-layout-ankr-table.hh @@ -41,7 +41,7 @@ using namespace OT; struct Anchor { - 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)); @@ -60,10 +60,10 @@ struct ankr { enum { tableTag = HB_AAT_TAG_ankr }; - inline const Anchor &get_anchor (hb_codepoint_t glyph_id, - unsigned int i, - unsigned int num_glyphs, - const char *end) const + const Anchor &get_anchor (hb_codepoint_t glyph_id, + unsigned int i, + unsigned int num_glyphs, + const char *end) const { const Offset *offset = (this+lookupTable).get_value (glyph_id, num_glyphs); if (!offset) @@ -75,7 +75,7 @@ struct ankr return anchors[i]; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && diff --git a/src/hb-aat-layout-bsln-table.hh b/src/hb-aat-layout-bsln-table.hh index d2ea71d1a..5bc59cbb1 100644 --- a/src/hb-aat-layout-bsln-table.hh +++ b/src/hb-aat-layout-bsln-table.hh @@ -39,7 +39,7 @@ namespace AAT { struct BaselineTableFormat0Part { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -57,7 +57,7 @@ struct BaselineTableFormat0Part struct BaselineTableFormat1Part { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -75,7 +75,7 @@ struct BaselineTableFormat1Part struct BaselineTableFormat2Part { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -98,7 +98,7 @@ struct BaselineTableFormat2Part struct BaselineTableFormat3Part { - 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) && lookupTable.sanitize (c)); @@ -118,13 +118,14 @@ struct bsln { enum { tableTag = HB_AAT_TAG_bsln }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!(c->check_struct (this) && defaultBaseline < 32))) return_trace (false); - switch (format) { + switch (format) + { case 0: return_trace (parts.format0.sanitize (c)); case 1: return_trace (parts.format1.sanitize (c)); case 2: return_trace (parts.format2.sanitize (c)); diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh index 5be0f6ff9..16e2c1b6c 100644 --- a/src/hb-aat-layout-common.hh +++ b/src/hb-aat-layout-common.hh @@ -48,18 +48,18 @@ struct LookupFormat0 friend struct Lookup; private: - inline const T* get_value (hb_codepoint_t glyph_id, unsigned int num_glyphs) const + const T* get_value (hb_codepoint_t glyph_id, unsigned int num_glyphs) const { if (unlikely (glyph_id >= num_glyphs)) return nullptr; return &arrayZ[glyph_id]; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (arrayZ.sanitize (c, c->get_num_glyphs ())); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (arrayZ.sanitize (c, c->get_num_glyphs (), base)); @@ -79,16 +79,15 @@ struct LookupSegmentSingle { enum { TerminationWordCount = 2 }; - inline int cmp (hb_codepoint_t g) const { - return g < first ? -1 : g <= last ? 0 : +1 ; - } + int cmp (hb_codepoint_t g) const + { return g < first ? -1 : g <= last ? 0 : +1 ; } - 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) && value.sanitize (c)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && value.sanitize (c, base)); @@ -107,18 +106,18 @@ struct LookupFormat2 friend struct Lookup; private: - inline const T* get_value (hb_codepoint_t glyph_id) const + const T* get_value (hb_codepoint_t glyph_id) const { const LookupSegmentSingle *v = segments.bsearch (glyph_id); return v ? &v->value : nullptr; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (segments.sanitize (c)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (segments.sanitize (c, base)); @@ -139,16 +138,15 @@ struct LookupSegmentArray { enum { TerminationWordCount = 2 }; - inline const T* get_value (hb_codepoint_t glyph_id, const void *base) const + const T* get_value (hb_codepoint_t glyph_id, const void *base) const { return first <= glyph_id && glyph_id <= last ? &(base+valuesZ)[glyph_id - first] : nullptr; } - inline int cmp (hb_codepoint_t g) const { - return g < first ? -1 : g <= last ? 0 : +1 ; - } + int cmp (hb_codepoint_t g) const + { return g < first ? -1 : g <= last ? 0 : +1; } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -156,7 +154,7 @@ struct LookupSegmentArray valuesZ.sanitize (c, base, last - first + 1)); } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T2 user_data) const + bool sanitize (hb_sanitize_context_t *c, const void *base, T2 user_data) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -179,18 +177,18 @@ struct LookupFormat4 friend struct Lookup; private: - inline const T* get_value (hb_codepoint_t glyph_id) const + const T* get_value (hb_codepoint_t glyph_id) const { const LookupSegmentArray *v = segments.bsearch (glyph_id); return v ? v->get_value (glyph_id, this) : nullptr; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (segments.sanitize (c, this)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (segments.sanitize (c, this, base)); @@ -211,14 +209,14 @@ struct LookupSingle { enum { TerminationWordCount = 1 }; - inline int cmp (hb_codepoint_t g) const { return glyph.cmp (g); } + int cmp (hb_codepoint_t g) const { return glyph.cmp (g); } - 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) && value.sanitize (c)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && value.sanitize (c, base)); @@ -236,18 +234,18 @@ struct LookupFormat6 friend struct Lookup; private: - inline const T* get_value (hb_codepoint_t glyph_id) const + const T* get_value (hb_codepoint_t glyph_id) const { const LookupSingle *v = entries.bsearch (glyph_id); return v ? &v->value : nullptr; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (entries.sanitize (c)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (entries.sanitize (c, base)); @@ -267,18 +265,18 @@ struct LookupFormat8 friend struct Lookup; private: - inline const T* get_value (hb_codepoint_t glyph_id) const + const T* get_value (hb_codepoint_t glyph_id) const { return firstGlyph <= glyph_id && glyph_id - firstGlyph < glyphCount ? &valueArrayZ[glyph_id - firstGlyph] : nullptr; } - 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) && valueArrayZ.sanitize (c, glyphCount)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && valueArrayZ.sanitize (c, glyphCount, base)); @@ -302,7 +300,7 @@ struct LookupFormat10 friend struct Lookup; private: - inline const typename T::type get_value_or_null (hb_codepoint_t glyph_id) const + const typename T::type get_value_or_null (hb_codepoint_t glyph_id) const { if (!(firstGlyph <= glyph_id && glyph_id - firstGlyph < glyphCount)) return Null(T); @@ -317,7 +315,7 @@ struct LookupFormat10 return v; } - 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) && @@ -341,7 +339,7 @@ struct LookupFormat10 template struct Lookup { - inline const T* get_value (hb_codepoint_t glyph_id, unsigned int num_glyphs) const + const T* get_value (hb_codepoint_t glyph_id, unsigned int num_glyphs) const { switch (u.format) { case 0: return u.format0.get_value (glyph_id, num_glyphs); @@ -353,7 +351,7 @@ struct Lookup } } - inline const typename T::type get_value_or_null (hb_codepoint_t glyph_id, unsigned int num_glyphs) const + const typename T::type get_value_or_null (hb_codepoint_t glyph_id, unsigned int num_glyphs) const { switch (u.format) { /* Format 10 cannot return a pointer. */ @@ -364,15 +362,15 @@ struct Lookup } } - inline typename T::type get_class (hb_codepoint_t glyph_id, - unsigned int num_glyphs, - unsigned int outOfRange) const + typename T::type get_class (hb_codepoint_t glyph_id, + unsigned int num_glyphs, + unsigned int outOfRange) const { const T *v = get_value (glyph_id, num_glyphs); return v ? *v : outOfRange; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!u.format.sanitize (c)) return_trace (false); @@ -386,7 +384,7 @@ struct Lookup default:return_trace (true); } } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); if (!u.format.sanitize (c)) return_trace (false); @@ -443,7 +441,7 @@ enum { DELETED_GLYPH = 0xFFFF }; template struct Entry { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); /* Note, we don't recurse-sanitize data because we don't access it. @@ -471,7 +469,7 @@ struct Entry template <> struct Entry { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count /*XXX Unused?*/) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count /*XXX Unused?*/) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this)); @@ -504,19 +502,19 @@ struct StateTable CLASS_END_OF_LINE = 3, }; - inline int new_state (unsigned int newState) const + int new_state (unsigned int newState) const { return Types::extended ? newState : ((int) newState - (int) stateArrayTable) / (int) nClasses; } - inline unsigned int get_class (hb_codepoint_t glyph_id, unsigned int num_glyphs) const + unsigned int get_class (hb_codepoint_t glyph_id, unsigned int num_glyphs) const { if (unlikely (glyph_id == DELETED_GLYPH)) return CLASS_DELETED_GLYPH; return (this+classTable).get_class (glyph_id, num_glyphs, 1); } - inline const Entry *get_entries (void) const + const Entry *get_entries (void) const { return (this+entryTable).arrayZ; } - inline const Entry *get_entryZ (int state, unsigned int klass) const + const Entry *get_entryZ (int state, unsigned int klass) const { if (unlikely (klass >= nClasses)) return nullptr; @@ -529,8 +527,8 @@ struct StateTable return &entries[entry]; } - inline bool sanitize (hb_sanitize_context_t *c, - unsigned int *num_entries_out = nullptr) const + bool sanitize (hb_sanitize_context_t *c, + unsigned int *num_entries_out = nullptr) const { TRACE_SANITIZE (this); if (unlikely (!(c->check_struct (this) && @@ -648,18 +646,18 @@ struct StateTable template struct ClassTable { - inline unsigned int get_class (hb_codepoint_t glyph_id, unsigned int outOfRange) const + unsigned int get_class (hb_codepoint_t glyph_id, unsigned int outOfRange) const { unsigned int i = glyph_id - firstGlyph; return i >= classArray.len ? outOfRange : classArray.arrayZ[i]; } - inline unsigned int get_class (hb_codepoint_t glyph_id, - unsigned int num_glyphs HB_UNUSED, - unsigned int outOfRange) const + unsigned int get_class (hb_codepoint_t glyph_id, + unsigned int num_glyphs HB_UNUSED, + unsigned int outOfRange) const { return get_class (glyph_id, outOfRange); } - 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) && classArray.sanitize (c)); @@ -681,23 +679,23 @@ struct ObsoleteTypes typedef ClassTable ClassTypeWide; template - static inline unsigned int offsetToIndex (unsigned int offset, - const void *base, - const T *array) + static unsigned int offsetToIndex (unsigned int offset, + const void *base, + const T *array) { return (offset - ((const char *) array - (const char *) base)) / sizeof (T); } template - static inline unsigned int byteOffsetToIndex (unsigned int offset, - const void *base, - const T *array) + static unsigned int byteOffsetToIndex (unsigned int offset, + const void *base, + const T *array) { return offsetToIndex (offset, base, array); } template - static inline unsigned int wordOffsetToIndex (unsigned int offset, - const void *base, - const T *array) + static unsigned int wordOffsetToIndex (unsigned int offset, + const void *base, + const T *array) { return offsetToIndex (2 * offset, base, array); } @@ -711,23 +709,23 @@ struct ExtendedTypes typedef Lookup ClassTypeWide; template - static inline unsigned int offsetToIndex (unsigned int offset, - const void *base, - const T *array) + static unsigned int offsetToIndex (unsigned int offset, + const void *base, + const T *array) { return offset; } template - static inline unsigned int byteOffsetToIndex (unsigned int offset, - const void *base, - const T *array) + static unsigned int byteOffsetToIndex (unsigned int offset, + const void *base, + const T *array) { return offset / 2; } template - static inline unsigned int wordOffsetToIndex (unsigned int offset, - const void *base, - const T *array) + static unsigned int wordOffsetToIndex (unsigned int offset, + const void *base, + const T *array) { return offset; } @@ -736,15 +734,15 @@ struct ExtendedTypes template struct StateTableDriver { - inline StateTableDriver (const StateTable &machine_, - hb_buffer_t *buffer_, - hb_face_t *face_) : + StateTableDriver (const StateTable &machine_, + hb_buffer_t *buffer_, + hb_face_t *face_) : machine (machine_), buffer (buffer_), num_glyphs (face_->get_num_glyphs ()) {} template - inline void drive (context_t *c) + void drive (context_t *c) { if (!c->in_place) buffer->clear_output (); @@ -818,9 +816,9 @@ struct ankr; struct hb_aat_apply_context_t : hb_dispatch_context_t { - inline const char *get_name (void) { return "APPLY"; } + const char *get_name (void) { return "APPLY"; } template - inline return_t dispatch (const T &obj) { return obj.apply (this); } + return_t dispatch (const T &obj) { return obj.apply (this); } static return_t default_return_value (void) { return false; } bool stop_sublookup_iteration (return_t r) const { return r; } @@ -845,7 +843,7 @@ struct hb_aat_apply_context_t : HB_INTERNAL void set_ankr_table (const AAT::ankr *ankr_table_, const char *ankr_end_); - inline void set_lookup_index (unsigned int i) { lookup_index = i; } + void set_lookup_index (unsigned int i) { lookup_index = i; } }; diff --git a/src/hb-aat-layout-feat-table.hh b/src/hb-aat-layout-feat-table.hh index 30d568673..16560cb62 100644 --- a/src/hb-aat-layout-feat-table.hh +++ b/src/hb-aat-layout-feat-table.hh @@ -44,10 +44,10 @@ struct SettingName int cmp (hb_aat_layout_feature_selector_t key) const { return (int) key - (int) setting; } - inline hb_aat_layout_feature_selector_t get_selector (void) const + hb_aat_layout_feature_selector_t get_selector (void) const { return (hb_aat_layout_feature_selector_t) (unsigned) setting; } - inline void get_info (hb_aat_layout_feature_selector_info_t *s, + void get_info (hb_aat_layout_feature_selector_info_t *s, hb_aat_layout_feature_selector_t default_selector) const { s->name_id = nameIndex; @@ -60,7 +60,7 @@ struct SettingName s->reserved = 0; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -95,11 +95,11 @@ struct FeatureName * as the default. */ }; - inline unsigned int get_selector_infos (unsigned int start_offset, - unsigned int *selectors_count, /* IN/OUT. May be NULL. */ - hb_aat_layout_feature_selector_info_t *selectors, /* OUT. May be NULL. */ - unsigned int *pdefault_index, /* OUT. May be NULL. */ - const void *base) const + unsigned int get_selector_infos (unsigned int start_offset, + unsigned int *selectors_count, /* IN/OUT. May be NULL. */ + hb_aat_layout_feature_selector_info_t *selectors, /* OUT. May be NULL. */ + unsigned int *pdefault_index, /* OUT. May be NULL. */ + const void *base) const { hb_array_t< const SettingName> settings_table = (base+settingTableZ).as_array (nSettings); @@ -125,12 +125,12 @@ struct FeatureName return settings_table.len; } - inline hb_aat_layout_feature_type_t get_feature_type (void) const + hb_aat_layout_feature_type_t get_feature_type (void) const { return (hb_aat_layout_feature_type_t) (unsigned int) feature; } - inline hb_ot_name_id_t get_feature_name_id (void) const { return nameIndex; } + hb_ot_name_id_t get_feature_name_id (void) const { return nameIndex; } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -157,11 +157,11 @@ struct feat { enum { tableTag = HB_AAT_TAG_feat }; - inline bool has_data (void) const { return version.to_int (); } + bool has_data (void) const { return version.to_int (); } - inline unsigned int get_feature_types (unsigned int start_offset, - unsigned int *count, - hb_aat_layout_feature_type_t *features) const + unsigned int get_feature_types (unsigned int start_offset, + unsigned int *count, + hb_aat_layout_feature_type_t *features) const { unsigned int feature_count = featureNameCount; if (count && *count) @@ -174,25 +174,25 @@ struct feat return featureNameCount; } - inline const FeatureName& get_feature (hb_aat_layout_feature_type_t feature_type) const + const FeatureName& get_feature (hb_aat_layout_feature_type_t feature_type) const { return namesZ.bsearch (featureNameCount, feature_type); } - inline hb_ot_name_id_t get_feature_name_id (hb_aat_layout_feature_type_t feature) const + hb_ot_name_id_t get_feature_name_id (hb_aat_layout_feature_type_t feature) const { return get_feature (feature).get_feature_name_id (); } - inline unsigned int get_selector_infos (hb_aat_layout_feature_type_t feature_type, - unsigned int start_offset, - unsigned int *selectors_count, /* IN/OUT. May be NULL. */ - hb_aat_layout_feature_selector_info_t *selectors, /* OUT. May be NULL. */ - unsigned int *default_index /* OUT. May be NULL. */) const + unsigned int get_selector_infos (hb_aat_layout_feature_type_t feature_type, + unsigned int start_offset, + unsigned int *selectors_count, /* IN/OUT. May be NULL. */ + hb_aat_layout_feature_selector_info_t *selectors, /* OUT. May be NULL. */ + unsigned int *default_index /* OUT. May be NULL. */) const { return get_feature (feature_type).get_selector_infos (start_offset, selectors_count, selectors, default_index, this); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && diff --git a/src/hb-aat-layout-just-table.hh b/src/hb-aat-layout-just-table.hh index 295205fde..b91b0461f 100644 --- a/src/hb-aat-layout-just-table.hh +++ b/src/hb-aat-layout-just-table.hh @@ -45,7 +45,7 @@ using namespace OT; struct ActionSubrecordHeader { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -62,7 +62,7 @@ struct ActionSubrecordHeader struct DecompositionAction { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -91,7 +91,7 @@ struct DecompositionAction struct UnconditionalAddGlyphAction { - 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)); @@ -109,7 +109,7 @@ struct UnconditionalAddGlyphAction struct ConditionalAddGlyphAction { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -134,7 +134,7 @@ struct ConditionalAddGlyphAction struct DuctileGlyphAction { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -160,7 +160,7 @@ struct DuctileGlyphAction struct RepeatedAddGlyphAction { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -178,9 +178,9 @@ struct RepeatedAddGlyphAction struct ActionSubrecord { - inline unsigned int get_length (void) const { return u.header.actionLength; } + unsigned int get_length (void) const { return u.header.actionLength; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) @@ -215,7 +215,7 @@ struct ActionSubrecord struct PostcompensationActionChain { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) @@ -291,7 +291,7 @@ struct JustWidthDeltaEntry struct WidthDeltaPair { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -328,7 +328,7 @@ struct JustificationCategory * glyph if nonzero. */ }; - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -347,7 +347,7 @@ struct JustificationCategory struct JustificationHeader { - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -384,7 +384,7 @@ struct just { enum { tableTag = HB_AAT_TAG_just }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index b25feea2d..db16d9cf1 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -66,17 +66,17 @@ struct hb_glyph_pair_t struct KernPair { - inline int get_kerning (void) const + int get_kerning (void) const { return value; } - inline int cmp (const hb_glyph_pair_t &o) const + int cmp (const hb_glyph_pair_t &o) const { int ret = left.cmp (o.left); if (ret) return ret; return right.cmp (o.right); } - 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)); @@ -93,15 +93,15 @@ struct KernPair template struct KerxSubTableFormat0 { - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, - hb_aat_apply_context_t *c = nullptr) const + int get_kerning (hb_codepoint_t left, hb_codepoint_t right, + hb_aat_apply_context_t *c = nullptr) const { hb_glyph_pair_t pair = {left, right}; int v = pairs.bsearch (pair).get_kerning (); return kerxTupleKern (v, header.tuple_count (), this, c); } - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -123,16 +123,16 @@ struct KerxSubTableFormat0 const KerxSubTableFormat0 &table; hb_aat_apply_context_t *c; - inline accelerator_t (const KerxSubTableFormat0 &table_, - hb_aat_apply_context_t *c_) : - table (table_), c (c_) {} + accelerator_t (const KerxSubTableFormat0 &table_, + hb_aat_apply_context_t *c_) : + table (table_), c (c_) {} - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const + int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { return table.get_kerning (left, right, c); } }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (pairs.sanitize (c))); @@ -171,10 +171,10 @@ struct Format1Entry DEFINE_SIZE_STATIC (2); }; - static inline bool performAction (const Entry *entry) + static bool performAction (const Entry *entry) { return entry->data.kernActionIndex != 0xFFFF; } - static inline unsigned int kernActionIndex (const Entry *entry) + static unsigned int kernActionIndex (const Entry *entry) { return entry->data.kernActionIndex; } }; template <> @@ -193,10 +193,10 @@ struct Format1Entry typedef void EntryData; - static inline bool performAction (const Entry *entry) + static bool performAction (const Entry *entry) { return entry->flags & Offset; } - static inline unsigned int kernActionIndex (const Entry *entry) + static unsigned int kernActionIndex (const Entry *entry) { return entry->flags & Offset; } }; @@ -217,8 +217,8 @@ struct KerxSubTableFormat1 DontAdvance = Format1EntryT::DontAdvance, }; - inline driver_context_t (const KerxSubTableFormat1 *table_, - hb_aat_apply_context_t *c_) : + driver_context_t (const KerxSubTableFormat1 *table_, + hb_aat_apply_context_t *c_) : c (c_), table (table_), /* Apparently the offset kernAction is from the beginning of the state-machine, @@ -228,13 +228,13 @@ struct KerxSubTableFormat1 depth (0), crossStream (table->header.coverage & table->header.CrossStream) {} - inline bool is_actionable (StateTableDriver *driver HB_UNUSED, - const Entry *entry) + bool is_actionable (StateTableDriver *driver HB_UNUSED, + const Entry *entry) { return Format1EntryT::performAction (entry); } - inline bool transition (StateTableDriver *driver, - const Entry *entry) + bool transition (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; unsigned int flags = entry->flags; @@ -348,7 +348,7 @@ struct KerxSubTableFormat1 bool crossStream; }; - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -364,7 +364,7 @@ struct KerxSubTableFormat1 return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); /* The rest of array sanitizations are done at run-time. */ @@ -386,8 +386,8 @@ struct KerxSubTableFormat2 typedef typename KernSubTableHeader::Types Types; typedef typename Types::HBUINT HBUINT; - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, - hb_aat_apply_context_t *c) const + int get_kerning (hb_codepoint_t left, hb_codepoint_t right, + hb_aat_apply_context_t *c) const { unsigned int num_glyphs = c->sanitizer.get_num_glyphs (); unsigned int l = (this+leftClassTable).get_class (left, num_glyphs, 0); @@ -402,7 +402,7 @@ struct KerxSubTableFormat2 return kerxTupleKern (*v, header.tuple_count (), this, c); } - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -424,15 +424,15 @@ struct KerxSubTableFormat2 const KerxSubTableFormat2 &table; hb_aat_apply_context_t *c; - inline accelerator_t (const KerxSubTableFormat2 &table_, - hb_aat_apply_context_t *c_) : - table (table_), c (c_) {} + accelerator_t (const KerxSubTableFormat2 &table_, + hb_aat_apply_context_t *c_) : + table (table_), c (c_) {} - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const + int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { return table.get_kerning (left, right, c); } }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -490,7 +490,7 @@ struct KerxSubTableFormat4 * point table. */ }; - inline driver_context_t (const KerxSubTableFormat4 *table, + driver_context_t (const KerxSubTableFormat4 *table, hb_aat_apply_context_t *c_) : c (c_), action_type ((table->flags & ActionType) >> 30), @@ -498,13 +498,13 @@ struct KerxSubTableFormat4 mark_set (false), mark (0) {} - inline bool is_actionable (StateTableDriver *driver HB_UNUSED, - const Entry *entry) + bool is_actionable (StateTableDriver *driver HB_UNUSED, + const Entry *entry) { return entry->data.ankrActionIndex != 0xFFFF; } - inline bool transition (StateTableDriver *driver, - const Entry *entry) + bool transition (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; @@ -599,7 +599,7 @@ struct KerxSubTableFormat4 unsigned int mark; }; - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -611,7 +611,7 @@ struct KerxSubTableFormat4 return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); /* The rest of array sanitizations are done at run-time. */ @@ -635,9 +635,9 @@ struct KerxSubTableFormat6 ValuesAreLong = 0x00000001, }; - inline bool is_long (void) const { return flags & ValuesAreLong; } + bool is_long (void) const { return flags & ValuesAreLong; } - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right, + int get_kerning (hb_codepoint_t left, hb_codepoint_t right, hb_aat_apply_context_t *c) const { unsigned int num_glyphs = c->sanitizer.get_num_glyphs (); @@ -665,7 +665,7 @@ struct KerxSubTableFormat6 } } - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -682,7 +682,7 @@ struct KerxSubTableFormat6 return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -705,11 +705,11 @@ struct KerxSubTableFormat6 const KerxSubTableFormat6 &table; hb_aat_apply_context_t *c; - inline accelerator_t (const KerxSubTableFormat6 &table_, - hb_aat_apply_context_t *c_) : - table (table_), c (c_) {} + accelerator_t (const KerxSubTableFormat6 &table_, + hb_aat_apply_context_t *c_) : + table (table_), c (c_) {} - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const + int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { return table.get_kerning (left, right, c); } }; @@ -743,8 +743,8 @@ struct KerxSubTableHeader { typedef ExtendedTypes Types; - inline unsigned int tuple_count (void) const { return tupleCount; } - inline bool is_horizontal (void) const { return !(coverage & Vertical); } + unsigned int tuple_count (void) const { return tupleCount; } + bool is_horizontal (void) const { return !(coverage & Vertical); } enum Coverage { @@ -760,7 +760,7 @@ struct KerxSubTableHeader SubtableType= 0x000000FFu, /* Subtable type. */ }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -778,11 +778,11 @@ struct KerxSubTable { friend struct kerx; - inline unsigned int get_size (void) const { return u.header.length; } - inline unsigned int get_type (void) const { return u.header.coverage & u.header.SubtableType; } + unsigned int get_size (void) const { return u.header.length; } + unsigned int get_type (void) const { return u.header.coverage & u.header.SubtableType; } template - inline typename context_t::return_t dispatch (context_t *c) const + typename context_t::return_t dispatch (context_t *c) const { unsigned int subtable_type = get_type (); TRACE_DISPATCH (this, subtable_type); @@ -796,7 +796,7 @@ struct KerxSubTable } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!u.header.sanitize (c) || @@ -829,9 +829,9 @@ template struct KerxTable { /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */ - inline const T* thiz (void) const { return static_cast (this); } + const T* thiz (void) const { return static_cast (this); } - inline bool has_state_machine (void) const + bool has_state_machine (void) const { typedef typename T::SubTable SubTable; @@ -846,7 +846,7 @@ struct KerxTable return false; } - inline bool has_cross_stream (void) const + bool has_cross_stream (void) const { typedef typename T::SubTable SubTable; @@ -861,7 +861,7 @@ struct KerxTable return false; } - inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const + int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const { typedef typename T::SubTable SubTable; @@ -879,7 +879,7 @@ struct KerxTable return v; } - inline bool apply (AAT::hb_aat_apply_context_t *c) const + bool apply (AAT::hb_aat_apply_context_t *c) const { typedef typename T::SubTable SubTable; @@ -943,7 +943,7 @@ struct KerxTable return ret; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!thiz()->version.sanitize (c) || @@ -989,7 +989,7 @@ struct kerx : KerxTable typedef SubTableHeader::Types Types; typedef KerxSubTable SubTable; - inline bool has_data (void) const { return version; } + bool has_data (void) const { return version; } protected: HBUINT16 version; /* The version number of the extended kerning table diff --git a/src/hb-aat-layout-lcar-table.hh b/src/hb-aat-layout-lcar-table.hh index 9bfb68492..cac969717 100644 --- a/src/hb-aat-layout-lcar-table.hh +++ b/src/hb-aat-layout-lcar-table.hh @@ -42,12 +42,12 @@ struct lcar { enum { tableTag = HB_AAT_TAG_lcar }; - inline unsigned int get_lig_carets (hb_font_t *font, - hb_direction_t direction, - hb_codepoint_t glyph, - unsigned int start_offset, - unsigned int *caret_count /* IN/OUT */, - hb_position_t *caret_array /* OUT */) const + unsigned int get_lig_carets (hb_font_t *font, + hb_direction_t direction, + hb_codepoint_t glyph, + unsigned int start_offset, + unsigned int *caret_count /* IN/OUT */, + hb_position_t *caret_array /* OUT */) const { const OffsetTo* entry_offset = lookup.get_value (glyph, font->face->get_num_glyphs ()); @@ -70,7 +70,7 @@ struct lcar return array.len; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index 9b37a713f..ea3a7d103 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -69,17 +69,17 @@ struct RearrangementSubtable Verb = 0x000F, /* The type of rearrangement specified. */ }; - inline driver_context_t (const RearrangementSubtable *table HB_UNUSED) : + driver_context_t (const RearrangementSubtable *table HB_UNUSED) : ret (false), start (0), end (0) {} - inline bool is_actionable (StateTableDriver *driver HB_UNUSED, - const Entry *entry) + bool is_actionable (StateTableDriver *driver HB_UNUSED, + const Entry *entry) { return (entry->flags & Verb) && start < end; } - inline bool transition (StateTableDriver *driver, - const Entry *entry) + bool transition (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; unsigned int flags = entry->flags; @@ -163,7 +163,7 @@ struct RearrangementSubtable unsigned int end; }; - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -175,7 +175,7 @@ struct RearrangementSubtable return_trace (dc.ret); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (machine.sanitize (c)); @@ -213,7 +213,7 @@ struct ContextualSubtable Reserved = 0x3FFF, /* These bits are reserved and should be set to 0. */ }; - inline driver_context_t (const ContextualSubtable *table_, + driver_context_t (const ContextualSubtable *table_, hb_aat_apply_context_t *c_) : ret (false), c (c_), @@ -222,8 +222,8 @@ struct ContextualSubtable table (table_), subs (table+table->substitutionTables) {} - inline bool is_actionable (StateTableDriver *driver, - const Entry *entry) + bool is_actionable (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; @@ -232,8 +232,8 @@ struct ContextualSubtable return entry->data.markIndex != 0xFFFF || entry->data.currentIndex != 0xFFFF; } - inline bool transition (StateTableDriver *driver, - const Entry *entry) + bool transition (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; @@ -311,7 +311,7 @@ struct ContextualSubtable const UnsizedOffsetListOf, HBUINT, false> &subs; }; - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -323,7 +323,7 @@ struct ContextualSubtable return_trace (dc.ret); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -384,10 +384,10 @@ struct LigatureEntry DEFINE_SIZE_STATIC (2); }; - static inline bool performAction (const Entry *entry) + static bool performAction (const Entry *entry) { return entry->flags & PerformAction; } - static inline unsigned int ligActionIndex (const Entry *entry) + static unsigned int ligActionIndex (const Entry *entry) { return entry->data.ligActionIndex; } }; template <> @@ -406,10 +406,10 @@ struct LigatureEntry typedef void EntryData; - static inline bool performAction (const Entry *entry) + static bool performAction (const Entry *entry) { return entry->flags & Offset; } - static inline unsigned int ligActionIndex (const Entry *entry) + static unsigned int ligActionIndex (const Entry *entry) { return entry->flags & Offset; } }; @@ -441,8 +441,8 @@ struct LigatureSubtable * into the component table. */ }; - inline driver_context_t (const LigatureSubtable *table_, - hb_aat_apply_context_t *c_) : + driver_context_t (const LigatureSubtable *table_, + hb_aat_apply_context_t *c_) : ret (false), c (c_), table (table_), @@ -451,13 +451,13 @@ struct LigatureSubtable ligature (table+table->ligature), match_length (0) {} - inline bool is_actionable (StateTableDriver *driver HB_UNUSED, - const Entry *entry) + bool is_actionable (StateTableDriver *driver HB_UNUSED, + const Entry *entry) { return LigatureEntryT::performAction (entry); } - inline bool transition (StateTableDriver *driver, - const Entry *entry) + bool transition (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; @@ -567,7 +567,7 @@ struct LigatureSubtable unsigned int match_positions[HB_MAX_CONTEXT_LENGTH]; }; - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -579,7 +579,7 @@ struct LigatureSubtable return_trace (dc.ret); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); /* The rest of array sanitizations are done at run-time. */ @@ -603,7 +603,7 @@ struct LigatureSubtable template struct NoncontextualSubtable { - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -625,7 +625,7 @@ struct NoncontextualSubtable return_trace (ret); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (substitute.sanitize (c)); @@ -709,22 +709,22 @@ struct InsertionSubtable * marked location is 31 glyphs. */ }; - inline driver_context_t (const InsertionSubtable *table, - hb_aat_apply_context_t *c_) : + driver_context_t (const InsertionSubtable *table, + hb_aat_apply_context_t *c_) : ret (false), c (c_), mark_set (false), mark (0), insertionAction (table+table->insertionAction) {} - inline bool is_actionable (StateTableDriver *driver HB_UNUSED, - const Entry *entry) + bool is_actionable (StateTableDriver *driver HB_UNUSED, + const Entry *entry) { return (entry->flags & (CurrentInsertCount | MarkedInsertCount)) && (entry->data.currentInsertIndex != 0xFFFF ||entry->data.markedInsertIndex != 0xFFFF); } - inline bool transition (StateTableDriver *driver, - const Entry *entry) + bool transition (StateTableDriver *driver, + const Entry *entry) { hb_buffer_t *buffer = driver->buffer; unsigned int flags = entry->flags; @@ -809,7 +809,7 @@ struct InsertionSubtable const UnsizedArrayOf &insertionAction; }; - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -821,7 +821,7 @@ struct InsertionSubtable return_trace (dc.ret); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); /* The rest of array sanitizations are done at run-time. */ @@ -842,7 +842,7 @@ struct InsertionSubtable struct Feature { - 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)); @@ -868,9 +868,9 @@ struct ChainSubtable template friend struct Chain; - inline unsigned int get_size (void) const { return length; } - inline unsigned int get_type (void) const { return coverage & 0xFF; } - inline unsigned int get_coverage (void) const { return coverage >> (sizeof (HBUINT) * 8 - 8); } + unsigned int get_size (void) const { return length; } + unsigned int get_type (void) const { return coverage & 0xFF; } + unsigned int get_coverage (void) const { return coverage >> (sizeof (HBUINT) * 8 - 8); } enum Coverage { @@ -897,7 +897,7 @@ struct ChainSubtable }; template - inline typename context_t::return_t dispatch (context_t *c) const + typename context_t::return_t dispatch (context_t *c) const { unsigned int subtable_type = get_type (); TRACE_DISPATCH (this, subtable_type); @@ -911,14 +911,14 @@ struct ChainSubtable } } - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); hb_sanitize_with_object_t with (&c->sanitizer, this); return_trace (dispatch (c)); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!length.sanitize (c) || @@ -950,7 +950,7 @@ struct Chain { typedef typename Types::HBUINT HBUINT; - inline hb_mask_t compile_flags (const hb_aat_map_builder_t *map) const + hb_mask_t compile_flags (const hb_aat_map_builder_t *map) const { hb_mask_t flags = defaultFlags; { @@ -979,7 +979,7 @@ struct Chain return flags; } - inline void apply (hb_aat_apply_context_t *c, + void apply (hb_aat_apply_context_t *c, hb_mask_t flags) const { const ChainSubtable *subtable = &StructAfter > (featureZ.as_array (featureCount)); @@ -1049,9 +1049,9 @@ struct Chain } } - inline unsigned int get_size (void) const { return length; } + unsigned int get_size (void) const { return length; } - inline bool sanitize (hb_sanitize_context_t *c, unsigned int version HB_UNUSED) const + bool sanitize (hb_sanitize_context_t *c, unsigned int version HB_UNUSED) const { TRACE_SANITIZE (this); if (!length.sanitize (c) || @@ -1098,10 +1098,10 @@ struct mortmorx { enum { tableTag = HB_AAT_TAG_morx }; - inline bool has_data (void) const { return version != 0; } + bool has_data (void) const { return version != 0; } - inline void compile_flags (const hb_aat_map_builder_t *mapper, - hb_aat_map_t *map) const + void compile_flags (const hb_aat_map_builder_t *mapper, + hb_aat_map_t *map) const { const Chain *chain = &firstChain; unsigned int count = chainCount; @@ -1112,7 +1112,7 @@ struct mortmorx } } - inline void apply (hb_aat_apply_context_t *c) const + void apply (hb_aat_apply_context_t *c) const { if (unlikely (!c->buffer->successful)) return; c->set_lookup_index (0); @@ -1126,7 +1126,7 @@ struct mortmorx } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!version.sanitize (c) || !version || !chainCount.sanitize (c)) diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh index 62215a478..9dc94211d 100644 --- a/src/hb-aat-layout-trak-table.hh +++ b/src/hb-aat-layout-trak-table.hh @@ -46,15 +46,15 @@ struct TrackTableEntry { friend struct TrackData; - inline float get_track_value (void) const { return track.to_float (); } + float get_track_value (void) const { return track.to_float (); } - inline int get_value (const void *base, unsigned int index, - unsigned int table_size) const + int get_value (const void *base, unsigned int index, + unsigned int table_size) const { return (base+valuesZ).as_array (table_size)[index]; } public: - inline bool sanitize (hb_sanitize_context_t *c, const void *base, - unsigned int table_size) const + bool sanitize (hb_sanitize_context_t *c, const void *base, + unsigned int table_size) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -76,10 +76,10 @@ struct TrackTableEntry struct TrackData { - inline float interpolate_at (unsigned int idx, - float target_size, - const TrackTableEntry &trackTableEntry, - const void *base) const + float interpolate_at (unsigned int idx, + float target_size, + const TrackTableEntry &trackTableEntry, + const void *base) const { unsigned int sizes = nSizes; hb_array_t size_table ((base+sizeTable).arrayZ, sizes); @@ -91,7 +91,7 @@ struct TrackData (1.f - t) * trackTableEntry.get_value (base, idx, sizes); } - inline int get_tracking (const void *base, float ptem) const + int get_tracking (const void *base, float ptem) const { /* CoreText points are CSS pixels (96 per inch), * NOT typographic points (72 per inch). @@ -137,7 +137,7 @@ struct TrackData *trackTableEntry, base)); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -162,9 +162,9 @@ struct trak { enum { tableTag = HB_AAT_TAG_trak }; - inline bool has_data (void) const { return version.to_int (); } + bool has_data (void) const { return version.to_int (); } - inline bool apply (hb_aat_apply_context_t *c) const + bool apply (hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -205,7 +205,7 @@ struct trak return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); diff --git a/src/hb-aat-layout.hh b/src/hb-aat-layout.hh index 56a4818be..8346d9f00 100644 --- a/src/hb-aat-layout.hh +++ b/src/hb-aat-layout.hh @@ -39,7 +39,7 @@ struct hb_aat_feature_mapping_t hb_aat_layout_feature_selector_t selectorToEnable; hb_aat_layout_feature_selector_t selectorToDisable; - static inline int cmp (const void *key_, const void *entry_) + static int cmp (const void *key_, const void *entry_) { hb_tag_t key = * (unsigned int *) key_; const hb_aat_feature_mapping_t * entry = (const hb_aat_feature_mapping_t *) entry_; diff --git a/src/hb-aat-ltag-table.hh b/src/hb-aat-ltag-table.hh index c7c4b4614..3b00b5591 100644 --- a/src/hb-aat-ltag-table.hh +++ b/src/hb-aat-ltag-table.hh @@ -43,7 +43,7 @@ struct FTStringRange { friend struct ltag; - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && (base+tag).sanitize (c, length)); @@ -62,14 +62,14 @@ struct ltag { enum { tableTag = HB_AAT_TAG_ltag }; - inline hb_language_t get_language (unsigned int i) const + hb_language_t get_language (unsigned int i) const { const FTStringRange &range = tagRanges[i]; return hb_language_from_string ((const char *) (this+range.tag).arrayZ, range.length); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && diff --git a/src/hb-aat-map.hh b/src/hb-aat-map.hh index b033e3368..6797d09a4 100644 --- a/src/hb-aat-map.hh +++ b/src/hb-aat-map.hh @@ -36,15 +36,12 @@ struct hb_aat_map_t public: - inline void init (void) + void init (void) { memset (this, 0, sizeof (*this)); chain_flags.init (); } - inline void fini (void) - { - chain_flags.fini (); - } + void fini (void) { chain_flags.fini (); } public: hb_vector_t chain_flags; diff --git a/src/hb-atomic.hh b/src/hb-atomic.hh index 265de1267..575d5364b 100644 --- a/src/hb-atomic.hh +++ b/src/hb-atomic.hh @@ -267,12 +267,12 @@ inline void *hb_atomic_ptr_impl_get (void ** const P) { void *v = *P; _hb_memory #define HB_ATOMIC_INT_INIT(V) {V} struct hb_atomic_int_t { - inline void set_relaxed (int v_) { hb_atomic_int_impl_set_relaxed (&v, v_); } - inline void set (int v_) { hb_atomic_int_impl_set (&v, v_); } - inline int get_relaxed (void) const { return hb_atomic_int_impl_get_relaxed (&v); } - inline int get (void) const { return hb_atomic_int_impl_get (&v); } - inline int inc (void) { return hb_atomic_int_impl_add (&v, 1); } - inline int dec (void) { return hb_atomic_int_impl_add (&v, -1); } + void set_relaxed (int v_) { hb_atomic_int_impl_set_relaxed (&v, v_); } + void set (int v_) { hb_atomic_int_impl_set (&v, v_); } + int get_relaxed (void) const { return hb_atomic_int_impl_get_relaxed (&v); } + int get (void) const { return hb_atomic_int_impl_get (&v); } + int inc (void) { return hb_atomic_int_impl_add (&v, 1); } + int dec (void) { return hb_atomic_int_impl_add (&v, -1); } int v; }; @@ -284,14 +284,14 @@ struct hb_atomic_ptr_t { typedef typename hb_remove_pointer (P) T; - inline void init (T* v_ = nullptr) { set_relaxed (v_); } - inline void set_relaxed (T* v_) { hb_atomic_ptr_impl_set_relaxed (&v, v_); } - inline T *get_relaxed (void) const { return (T *) hb_atomic_ptr_impl_get_relaxed (&v); } - inline T *get (void) const { return (T *) hb_atomic_ptr_impl_get ((void **) &v); } - inline bool cmpexch (const T *old, T *new_) const { return hb_atomic_ptr_impl_cmpexch ((void **) &v, (void *) old, (void *) new_); } + void init (T* v_ = nullptr) { set_relaxed (v_); } + void set_relaxed (T* v_) { hb_atomic_ptr_impl_set_relaxed (&v, v_); } + T *get_relaxed (void) const { return (T *) hb_atomic_ptr_impl_get_relaxed (&v); } + T *get (void) const { return (T *) hb_atomic_ptr_impl_get ((void **) &v); } + bool cmpexch (const T *old, T *new_) const { return hb_atomic_ptr_impl_cmpexch ((void **) &v, (void *) old, (void *) new_); } - inline T * operator -> (void) const { return get (); } - template inline operator C * (void) const { return get (); } + T * operator -> (void) const { return get (); } + template operator C * (void) const { return get (); } T *v; }; diff --git a/src/hb-blob.hh b/src/hb-blob.hh index bf2132bda..2ed51553e 100644 --- a/src/hb-blob.hh +++ b/src/hb-blob.hh @@ -38,12 +38,12 @@ struct hb_blob_t { - inline void fini_shallow (void) + void fini_shallow (void) { destroy_user_data (); } - inline void destroy_user_data (void) + void destroy_user_data (void) { if (destroy) { @@ -58,14 +58,12 @@ struct hb_blob_t HB_INTERNAL bool try_make_writable_inplace_unix (void); template - inline const Type* as (void) const + const Type* as (void) const { return length < hb_null_size (Type) ? &Null(Type) : reinterpret_cast (data); } - inline hb_bytes_t as_bytes (void) const - { - return hb_bytes_t (data, length); - } + hb_bytes_t as_bytes (void) const + { return hb_bytes_t (data, length); } public: hb_object_header_t header; @@ -88,16 +86,16 @@ struct hb_blob_ptr_t { typedef typename hb_remove_pointer (P) T; - inline hb_blob_ptr_t (hb_blob_t *b_ = nullptr) : b (b_) {} - inline hb_blob_t * operator = (hb_blob_t *b_) { return b = b_; } - inline const T * operator -> (void) const { return get (); } - inline const T & operator * (void) const { return *get (); } - template inline operator const C * (void) const { return get (); } - inline operator const char * (void) const { return (const char *) get (); } - inline const T * get (void) const { return b->as (); } - inline hb_blob_t * get_blob (void) const { return b.get_raw (); } - inline unsigned int get_length (void) const { return b.get ()->length; } - inline void destroy (void) { hb_blob_destroy (b.get ()); b = nullptr; } + hb_blob_ptr_t (hb_blob_t *b_ = nullptr) : b (b_) {} + hb_blob_t * operator = (hb_blob_t *b_) { return b = b_; } + const T * operator -> (void) const { return get (); } + const T & operator * (void) const { return *get (); } + template operator const C * (void) const { return get (); } + operator const char * (void) const { return (const char *) get (); } + const T * get (void) const { return b->as (); } + hb_blob_t * get_blob (void) const { return b.get_raw (); } + unsigned int get_length (void) const { return b.get ()->length; } + void destroy (void) { hb_blob_destroy (b.get ()); b = nullptr; } hb_nonnull_ptr_t b; }; diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh index 37adeb083..c7a99a7ba 100644 --- a/src/hb-buffer.hh +++ b/src/hb-buffer.hh @@ -137,7 +137,7 @@ struct hb_buffer_t /* Methods */ - inline void allocate_var (unsigned int start, unsigned int count) + void allocate_var (unsigned int start, unsigned int count) { #ifndef HB_NDEBUG unsigned int end = start + count; @@ -147,7 +147,7 @@ struct hb_buffer_t allocated_var_bits |= bits; #endif } - inline void deallocate_var (unsigned int start, unsigned int count) + void deallocate_var (unsigned int start, unsigned int count) { #ifndef HB_NDEBUG unsigned int end = start + count; @@ -157,7 +157,7 @@ struct hb_buffer_t allocated_var_bits &= ~bits; #endif } - inline void assert_var (unsigned int start, unsigned int count) + void assert_var (unsigned int start, unsigned int count) { #ifndef HB_NDEBUG unsigned int end = start + count; @@ -166,33 +166,33 @@ struct hb_buffer_t assert (bits == (allocated_var_bits & bits)); #endif } - inline void deallocate_var_all (void) + void deallocate_var_all (void) { #ifndef HB_NDEBUG allocated_var_bits = 0; #endif } - inline hb_glyph_info_t &cur (unsigned int i = 0) { return info[idx + i]; } - inline hb_glyph_info_t cur (unsigned int i = 0) const { return info[idx + i]; } + hb_glyph_info_t &cur (unsigned int i = 0) { return info[idx + i]; } + hb_glyph_info_t cur (unsigned int i = 0) const { return info[idx + i]; } - inline hb_glyph_position_t &cur_pos (unsigned int i = 0) { return pos[idx + i]; } - inline hb_glyph_position_t cur_pos (unsigned int i = 0) const { return pos[idx + i]; } + hb_glyph_position_t &cur_pos (unsigned int i = 0) { return pos[idx + i]; } + hb_glyph_position_t cur_pos (unsigned int i = 0) const { return pos[idx + i]; } - inline hb_glyph_info_t &prev (void) { return out_info[out_len ? out_len - 1 : 0]; } - inline hb_glyph_info_t prev (void) const { return out_info[out_len ? out_len - 1 : 0]; } + hb_glyph_info_t &prev (void) { return out_info[out_len ? out_len - 1 : 0]; } + hb_glyph_info_t prev (void) const { return out_info[out_len ? out_len - 1 : 0]; } - inline bool has_separate_output (void) const { return info != out_info; } + bool has_separate_output (void) const { return info != out_info; } HB_INTERNAL void reset (void); HB_INTERNAL void clear (void); - inline unsigned int backtrack_len (void) const + unsigned int backtrack_len (void) const { return have_output? out_len : idx; } - inline unsigned int lookahead_len (void) const + unsigned int lookahead_len (void) const { return len - idx; } - inline unsigned int next_serial (void) { return serial++; } + unsigned int next_serial (void) { return serial++; } HB_INTERNAL void add (hb_codepoint_t codepoint, unsigned int cluster); @@ -212,7 +212,7 @@ struct hb_buffer_t unsigned int num_out, const hb_codepoint_t *glyph_data); - inline void replace_glyph (hb_codepoint_t glyph_index) + void replace_glyph (hb_codepoint_t glyph_index) { if (unlikely (out_info != info || out_len != idx)) { if (unlikely (!make_room_for (1, 1))) return; @@ -224,7 +224,7 @@ struct hb_buffer_t out_len++; } /* Makes a copy of the glyph at idx to output and replace glyph_index */ - inline hb_glyph_info_t & output_glyph (hb_codepoint_t glyph_index) + hb_glyph_info_t & output_glyph (hb_codepoint_t glyph_index) { if (unlikely (!make_room_for (0, 1))) return Crap(hb_glyph_info_t); @@ -238,7 +238,7 @@ struct hb_buffer_t return out_info[out_len - 1]; } - inline void output_info (const hb_glyph_info_t &glyph_info) + void output_info (const hb_glyph_info_t &glyph_info) { if (unlikely (!make_room_for (0, 1))) return; @@ -247,7 +247,7 @@ struct hb_buffer_t out_len++; } /* Copies glyph at idx to output but doesn't advance idx */ - inline void copy_glyph (void) + void copy_glyph (void) { if (unlikely (!make_room_for (0, 1))) return; @@ -257,7 +257,7 @@ struct hb_buffer_t } /* Copies glyph at idx to output and advance idx. * If there's no output, just advance idx. */ - inline void + void next_glyph (void) { if (have_output) @@ -274,7 +274,7 @@ struct hb_buffer_t } /* Copies n glyphs at idx to output and advance idx. * If there's no output, just advance idx. */ - inline void + void next_glyphs (unsigned int n) { if (have_output) @@ -290,16 +290,16 @@ struct hb_buffer_t idx += n; } /* Advance idx without copying to output. */ - inline void skip_glyph (void) + void skip_glyph (void) { idx++; } - inline void reset_masks (hb_mask_t mask) + void reset_masks (hb_mask_t mask) { for (unsigned int j = 0; j < len; j++) info[j].mask = mask; } - inline void add_masks (hb_mask_t mask) + void add_masks (hb_mask_t mask) { for (unsigned int j = 0; j < len; j++) info[j].mask |= mask; @@ -307,7 +307,7 @@ struct hb_buffer_t HB_INTERNAL void set_masks (hb_mask_t value, hb_mask_t mask, unsigned int cluster_start, unsigned int cluster_end); - inline void merge_clusters (unsigned int start, unsigned int end) + void merge_clusters (unsigned int start, unsigned int end) { if (end - start < 2) return; @@ -318,7 +318,7 @@ struct hb_buffer_t /* Merge clusters for deleting current glyph, and skip it. */ HB_INTERNAL void delete_glyph (void); - inline void unsafe_to_break (unsigned int start, + void unsafe_to_break (unsigned int start, unsigned int end) { if (end - start < 2) @@ -334,10 +334,10 @@ struct hb_buffer_t HB_INTERNAL bool enlarge (unsigned int size); - inline bool ensure (unsigned int size) + bool ensure (unsigned int size) { return likely (!size || size < allocated) ? true : enlarge (size); } - inline bool ensure_inplace (unsigned int size) + bool ensure_inplace (unsigned int size) { return likely (!size || size < allocated); } HB_INTERNAL bool make_room_for (unsigned int num_in, unsigned int num_out); @@ -346,12 +346,12 @@ struct hb_buffer_t typedef long scratch_buffer_t; HB_INTERNAL scratch_buffer_t *get_scratch_buffer (unsigned int *size); - inline void clear_context (unsigned int side) { context_len[side] = 0; } + void clear_context (unsigned int side) { context_len[side] = 0; } HB_INTERNAL void sort (unsigned int start, unsigned int end, int(*compar)(const hb_glyph_info_t *, const hb_glyph_info_t *)); - inline bool messaging (void) { return unlikely (message_func); } - inline bool message (hb_font_t *font, const char *fmt, ...) HB_PRINTF_FUNC(3, 4) + bool messaging (void) { return unlikely (message_func); } + bool message (hb_font_t *font, const char *fmt, ...) HB_PRINTF_FUNC(3, 4) { if (!messaging ()) return true; @@ -363,7 +363,7 @@ struct hb_buffer_t } HB_INTERNAL bool message_impl (hb_font_t *font, const char *fmt, va_list ap) HB_PRINTF_FUNC(3, 0); - static inline void + static void set_cluster (hb_glyph_info_t &inf, unsigned int cluster, unsigned int mask = 0) { if (inf.cluster != cluster) @@ -376,7 +376,7 @@ struct hb_buffer_t inf.cluster = cluster; } - inline int + int _unsafe_to_break_find_min_cluster (const hb_glyph_info_t *infos, unsigned int start, unsigned int end, unsigned int cluster) const @@ -385,7 +385,7 @@ struct hb_buffer_t cluster = MIN (cluster, infos[i].cluster); return cluster; } - inline void + void _unsafe_to_break_set_mask (hb_glyph_info_t *infos, unsigned int start, unsigned int end, unsigned int cluster) @@ -398,13 +398,9 @@ struct hb_buffer_t } } - inline void - unsafe_to_break_all (void) - { - unsafe_to_break_impl (0, len); - } - inline void - safe_to_break_all (void) + void unsafe_to_break_all (void) + { unsafe_to_break_impl (0, len); } + void safe_to_break_all (void) { for (unsigned int i = 0; i < len; i++) info[i].mask &= ~HB_GLYPH_FLAG_UNSAFE_TO_BREAK; diff --git a/src/hb-cache.hh b/src/hb-cache.hh index eb48f18cf..436993f3f 100644 --- a/src/hb-cache.hh +++ b/src/hb-cache.hh @@ -39,16 +39,16 @@ struct hb_cache_t static_assert ((key_bits + value_bits - cache_bits <= 8 * sizeof (hb_atomic_int_t)), ""); static_assert (sizeof (hb_atomic_int_t) == sizeof (unsigned int), ""); - inline void init (void) { clear (); } - inline void fini (void) {} + void init (void) { clear (); } + void fini (void) {} - inline void clear (void) + void clear (void) { for (unsigned i = 0; i < ARRAY_LENGTH (values); i++) values[i].set_relaxed (-1); } - inline bool get (unsigned int key, unsigned int *value) const + bool get (unsigned int key, unsigned int *value) const { unsigned int k = key & ((1u<> key_bits) || (value >> value_bits))) return false; /* Overflows */ diff --git a/src/hb-cff-interp-common.hh b/src/hb-cff-interp-common.hh index 6b814014b..90ba8b469 100644 --- a/src/hb-cff-interp-common.hh +++ b/src/hb-cff-interp-common.hh @@ -217,61 +217,45 @@ inline unsigned int OpCode_Size (OpCode op) { return Is_OpCode_ESC (op) ? 2: 1; struct Number { - inline void init (void) - { set_real (0.0); } - inline void fini (void) - {} + void init (void) { set_real (0.0); } + void fini (void) {} - inline void set_int (int v) { value = (double)v; } - inline int to_int (void) const { return (int)value; } - inline void set_fixed (int32_t v) { value = v / 65536.0; } - inline int32_t to_fixed (void) const + void set_int (int v) { value = (double) v; } + int to_int (void) const { return (int) value; } + void set_fixed (int32_t v) { value = v / 65536.0; } + int32_t to_fixed (void) const { return (int32_t)(value * 65536.0); } - inline void set_real (double v) { value = v; } - inline double to_real (void) const - { - return value; - } + void set_real (double v) { value = v; } + double to_real (void) const { return value; } - inline int ceil (void) const - { - return (int)::ceil (value); - } + int ceil (void) const { return (int) ::ceil (value); } + int floor (void) const { return (int) ::floor (value); } - inline int floor (void) const - { - return (int)::floor (value); - } + bool in_int_range (void) const + { return ((double) (int16_t) to_int () == value); } - inline bool in_int_range (void) const - { - return ((double)(int16_t)to_int () == value); - } + bool operator > (const Number &n) const + { return value > n.to_real (); } - inline bool operator > (const Number &n) const - { - return value > n.to_real (); - } - - inline bool operator < (const Number &n) const + bool operator < (const Number &n) const { return n > *this; } - inline bool operator >= (const Number &n) const - { return ! (*this < n); } + bool operator >= (const Number &n) const + { return !(*this < n); } - inline bool operator <= (const Number &n) const - { return ! (*this > n); } + bool operator <= (const Number &n) const + { return !(*this > n); } - inline const Number &operator += (const Number &n) + const Number &operator += (const Number &n) { set_real (to_real () + n.to_real ()); return *this; } -protected: + protected: double value; }; @@ -280,7 +264,7 @@ struct UnsizedByteStr : UnsizedArrayOf { // encode 2-byte int (Dict/CharString) or 4-byte int (Dict) template - inline static bool serialize_int (hb_serialize_context_t *c, OpCode intOp, int value) + static bool serialize_int (hb_serialize_context_t *c, OpCode intOp, int value) { TRACE_SERIALIZE (this); @@ -298,10 +282,10 @@ struct UnsizedByteStr : UnsizedArrayOf return_trace (true); } - inline static bool serialize_int4 (hb_serialize_context_t *c, int value) + static bool serialize_int4 (hb_serialize_context_t *c, int value) { return serialize_int (c, OpCode_longintdict, value); } - inline static bool serialize_int2 (hb_serialize_context_t *c, int value) + static bool serialize_int2 (hb_serialize_context_t *c, int value) { return serialize_int (c, OpCode_shortint, value); } /* Defining null_size allows a Null object may be created. Should be safe because: @@ -316,29 +300,30 @@ struct UnsizedByteStr : UnsizedArrayOf struct ByteStr { - inline ByteStr (void) + ByteStr (void) : str (&Null(UnsizedByteStr)), len (0) {} - inline ByteStr (const UnsizedByteStr& s, unsigned int l) + ByteStr (const UnsizedByteStr& s, unsigned int l) : str (&s), len (l) {} - inline ByteStr (const char *s, unsigned int l=0) + ByteStr (const char *s, unsigned int l=0) : str ((const UnsizedByteStr *)s), len (l) {} /* sub-string */ - inline ByteStr (const ByteStr &bs, unsigned int offset, unsigned int len_) + ByteStr (const ByteStr &bs, unsigned int offset, unsigned int len_) { str = (const UnsizedByteStr *)&bs.str[offset]; len = len_; } - inline bool sanitize (hb_sanitize_context_t *c) const { return str->sanitize (c, len); } + bool sanitize (hb_sanitize_context_t *c) const { return str->sanitize (c, len); } - inline const HBUINT8& operator [] (unsigned int i) const { + const HBUINT8& operator [] (unsigned int i) const + { if (likely (str && (i < len))) return (*str)[i]; else return Null(HBUINT8); } - inline bool serialize (hb_serialize_context_t *c, const ByteStr &src) + bool serialize (hb_serialize_context_t *c, const ByteStr &src) { TRACE_SERIALIZE (this); HBUINT8 *dest = c->allocate_size (src.len); @@ -348,9 +333,9 @@ struct ByteStr return_trace (true); } - inline unsigned int get_size (void) const { return len; } + unsigned int get_size (void) const { return len; } - inline bool check_limit (unsigned int offset, unsigned int count) const + bool check_limit (unsigned int offset, unsigned int count) const { return (offset + count <= len); } const UnsizedByteStr *str; @@ -359,29 +344,29 @@ struct ByteStr struct SubByteStr { - inline SubByteStr (void) + SubByteStr (void) { init (); } - inline void init (void) + void init (void) { str = ByteStr (0); offset = 0; error = false; } - inline void fini (void) {} + void fini (void) {} - inline SubByteStr (const ByteStr &str_, unsigned int offset_ = 0) + SubByteStr (const ByteStr &str_, unsigned int offset_ = 0) : str (str_), offset (offset_), error (false) {} - inline void reset (const ByteStr &str_, unsigned int offset_ = 0) + void reset (const ByteStr &str_, unsigned int offset_ = 0) { str = str_; offset = offset_; error = false; } - inline const HBUINT8& operator [] (int i) { + const HBUINT8& operator [] (int i) { if (unlikely ((unsigned int)(offset + i) >= str.len)) { set_error (); @@ -391,13 +376,13 @@ struct SubByteStr return str[offset + i]; } - inline operator ByteStr (void) const { return ByteStr (str, offset, str.len - offset); } + operator ByteStr (void) const { return ByteStr (str, offset, str.len - offset); } - inline bool avail (unsigned int count=1) const + bool avail (unsigned int count=1) const { return (!in_error () && str.check_limit (offset, count)); } - inline void inc (unsigned int count=1) + void inc (unsigned int count=1) { if (likely (!in_error () && (offset <= str.len) && (offset + count <= str.len))) { @@ -410,8 +395,8 @@ struct SubByteStr } } - inline void set_error (void) { error = true; } - inline bool in_error (void) const { return error; } + void set_error (void) { error = true; } + bool in_error (void) const { return error; } ByteStr str; unsigned int offset; /* beginning of the sub-string within str */ @@ -426,7 +411,7 @@ typedef hb_vector_t ByteStrArray; template struct Stack { - inline void init (void) + void init (void) { error = false; count = 0; @@ -436,18 +421,18 @@ struct Stack elements[i].init (); } - inline void fini (void) + void fini (void) { elements.fini_deep (); } - inline ELEM& operator [] (unsigned int i) + ELEM& operator [] (unsigned int i) { if (unlikely (i >= count)) set_error (); return elements[i]; } - inline void push (const ELEM &v) + void push (const ELEM &v) { if (likely (count < elements.len)) elements[count++] = v; @@ -455,7 +440,7 @@ struct Stack set_error (); } - inline ELEM &push (void) + ELEM &push (void) { if (likely (count < elements.len)) return elements[count++]; @@ -466,7 +451,7 @@ struct Stack } } - inline ELEM& pop (void) + ELEM& pop (void) { if (likely (count > 0)) return elements[--count]; @@ -477,7 +462,7 @@ struct Stack } } - inline void pop (unsigned int n) + void pop (unsigned int n) { if (likely (count >= n)) count -= n; @@ -485,7 +470,7 @@ struct Stack set_error (); } - inline const ELEM& peek (void) + const ELEM& peek (void) { if (likely (count > 0)) return elements[count-1]; @@ -496,7 +481,7 @@ struct Stack } } - inline void unpop (void) + void unpop (void) { if (likely (count < elements.len)) count++; @@ -504,13 +489,13 @@ struct Stack set_error (); } - inline void clear (void) { count = 0; } + void clear (void) { count = 0; } - inline bool in_error (void) const { return (error || elements.in_error ()); } - inline void set_error (void) { error = true; } + bool in_error (void) const { return (error || elements.in_error ()); } + void set_error (void) { error = true; } - inline unsigned int get_count (void) const { return count; } - inline bool is_empty (void) const { return count == 0; } + unsigned int get_count (void) const { return count; } + bool is_empty (void) const { return count == 0; } static const unsigned int kSizeLimit = LIMIT; @@ -524,35 +509,35 @@ struct Stack template struct ArgStack : Stack { - inline void push_int (int v) + void push_int (int v) { ARG &n = S::push (); n.set_int (v); } - inline void push_fixed (int32_t v) + void push_fixed (int32_t v) { ARG &n = S::push (); n.set_fixed (v); } - inline void push_real (double v) + void push_real (double v) { ARG &n = S::push (); n.set_real (v); } - inline ARG& pop_num (void) + ARG& pop_num (void) { return this->pop (); } - inline int pop_int (void) + int pop_int (void) { return this->pop ().to_int (); } - inline unsigned int pop_uint (void) + unsigned int pop_uint (void) { int i = pop_int (); if (unlikely (i < 0)) @@ -563,13 +548,13 @@ struct ArgStack : Stack return (unsigned)i; } - inline void push_longint_from_substr (SubByteStr& substr) + void push_longint_from_substr (SubByteStr& substr) { push_int ((substr[0] << 24) | (substr[1] << 16) | (substr[2] << 8) | (substr[3])); substr.inc (4); } - inline bool push_fixed_from_substr (SubByteStr& substr) + bool push_fixed_from_substr (SubByteStr& substr) { if (unlikely (!substr.avail (4))) return false; @@ -578,7 +563,7 @@ struct ArgStack : Stack return true; } - inline hb_array_t get_subarray (unsigned int start) const + hb_array_t get_subarray (unsigned int start) const { return S::elements.sub_array (start); } @@ -590,8 +575,8 @@ struct ArgStack : Stack /* an operator prefixed by its operands in a byte string */ struct OpStr { - inline void init (void) {} - inline void fini (void) {} + void init (void) {} + void fini (void) {} OpCode op; ByteStr str; @@ -601,7 +586,7 @@ struct OpStr struct OpSerializer { protected: - inline bool copy_opstr (hb_serialize_context_t *c, const OpStr& opstr) const + bool copy_opstr (hb_serialize_context_t *c, const OpStr& opstr) const { TRACE_SERIALIZE (this); @@ -615,18 +600,18 @@ struct OpSerializer template struct ParsedValues { - inline void init (void) + void init (void) { opStart = 0; values.init (); } - inline void fini (void) + void fini (void) { values.fini_deep (); } - inline void add_op (OpCode op, const SubByteStr& substr = SubByteStr ()) + void add_op (OpCode op, const SubByteStr& substr = SubByteStr ()) { VAL *val = values.push (); val->op = op; @@ -634,7 +619,7 @@ struct ParsedValues opStart = substr.offset; } - inline void add_op (OpCode op, const SubByteStr& substr, const VAL &v) + void add_op (OpCode op, const SubByteStr& substr, const VAL &v) { VAL *val = values.push (v); val->op = op; @@ -642,16 +627,16 @@ struct ParsedValues opStart = substr.offset; } - inline bool has_op (OpCode op) const + bool has_op (OpCode op) const { for (unsigned int i = 0; i < get_count (); i++) if (get_value (i).op == op) return true; return false; } - inline unsigned get_count (void) const { return values.len; } - inline const VAL &get_value (unsigned int i) const { return values[i]; } - inline const VAL &operator [] (unsigned int i) const { return get_value (i); } + unsigned get_count (void) const { return values.len; } + const VAL &get_value (unsigned int i) const { return values[i]; } + const VAL &operator [] (unsigned int i) const { return get_value (i); } unsigned int opStart; hb_vector_t values; @@ -660,26 +645,26 @@ struct ParsedValues template struct InterpEnv { - inline void init (const ByteStr &str_) + void init (const ByteStr &str_) { substr.reset (str_); argStack.init (); error = false; } - inline void fini (void) + void fini (void) { argStack.fini (); } - inline bool in_error (void) const + bool in_error (void) const { return error || substr.in_error () || argStack.in_error (); } - inline void set_error (void) { error = true; } + void set_error (void) { error = true; } - inline OpCode fetch_op (void) + OpCode fetch_op (void) { OpCode op = OpCode_Invalid; if (unlikely (!substr.avail ())) @@ -695,22 +680,22 @@ struct InterpEnv return op; } - inline const ARG& eval_arg (unsigned int i) + const ARG& eval_arg (unsigned int i) { return argStack[i]; } - inline ARG& pop_arg (void) + ARG& pop_arg (void) { return argStack.pop (); } - inline void pop_n_args (unsigned int n) + void pop_n_args (unsigned int n) { argStack.pop (n); } - inline void clear_args (void) + void clear_args (void) { pop_n_args (argStack.get_count ()); } @@ -726,7 +711,7 @@ typedef InterpEnv<> NumInterpEnv; template struct OpSet { - static inline void process_op (OpCode op, InterpEnv& env) + static void process_op (OpCode op, InterpEnv& env) { switch (op) { case OpCode_shortint: @@ -764,9 +749,9 @@ struct OpSet template struct Interpreter { - inline ~Interpreter(void) { fini (); } + ~Interpreter(void) { fini (); } - inline void fini (void) { env.fini (); } + void fini (void) { env.fini (); } ENV env; }; diff --git a/src/hb-cff-interp-cs-common.hh b/src/hb-cff-interp-cs-common.hh index 067dc1ccf..8838bf66a 100644 --- a/src/hb-cff-interp-cs-common.hh +++ b/src/hb-cff-interp-cs-common.hh @@ -41,14 +41,14 @@ enum CSType { struct CallContext { - inline void init (const SubByteStr substr_=SubByteStr (), CSType type_=CSType_CharString, unsigned int subr_num_=0) + void init (const SubByteStr substr_=SubByteStr (), CSType type_=CSType_CharString, unsigned int subr_num_=0) { substr = substr_; type = type_; subr_num = subr_num_; } - inline void fini (void) {} + void fini (void) {} SubByteStr substr; CSType type; @@ -62,7 +62,7 @@ struct CallStack : Stack {}; template struct BiasedSubrs { - inline void init (const SUBRS &subrs_) + void init (const SUBRS &subrs_) { subrs = &subrs_; unsigned int nSubrs = get_count (); @@ -74,12 +74,12 @@ struct BiasedSubrs bias = 32768; } - inline void fini (void) {} + void fini (void) {} - inline unsigned int get_count (void) const { return (subrs == nullptr)? 0: subrs->count; } - inline unsigned int get_bias (void) const { return bias; } + unsigned int get_count (void) const { return (subrs == nullptr)? 0: subrs->count; } + unsigned int get_bias (void) const { return bias; } - inline ByteStr operator [] (unsigned int index) const + ByteStr operator [] (unsigned int index) const { if (unlikely ((subrs == nullptr) || index >= subrs->count)) return Null(ByteStr); @@ -94,22 +94,22 @@ struct BiasedSubrs struct Point { - inline void init (void) + void init (void) { x.init (); y.init (); } - inline void set_int (int _x, int _y) + void set_int (int _x, int _y) { x.set_int (_x); y.set_int (_y); } - inline void move_x (const Number &dx) { x += dx; } - inline void move_y (const Number &dy) { y += dy; } - inline void move (const Number &dx, const Number &dy) { move_x (dx); move_y (dy); } - inline void move (const Point &d) { move_x (d.x); move_y (d.y); } + void move_x (const Number &dx) { x += dx; } + void move_y (const Number &dy) { y += dy; } + void move (const Number &dx, const Number &dy) { move_x (dx); move_y (dy); } + void move (const Point &d) { move_x (d.x); move_y (d.y); } Number x; Number y; @@ -118,7 +118,7 @@ struct Point template struct CSInterpEnv : InterpEnv { - inline void init (const ByteStr &str, const SUBRS &globalSubrs_, const SUBRS &localSubrs_) + void init (const ByteStr &str, const SUBRS &globalSubrs_, const SUBRS &localSubrs_) { InterpEnv::init (str); @@ -132,7 +132,7 @@ struct CSInterpEnv : InterpEnv globalSubrs.init (globalSubrs_); localSubrs.init (localSubrs_); } - inline void fini (void) + void fini (void) { InterpEnv::fini (); @@ -141,12 +141,12 @@ struct CSInterpEnv : InterpEnv localSubrs.fini (); } - inline bool in_error (void) const + bool in_error (void) const { return callStack.in_error () || SUPER::in_error (); } - inline bool popSubrNum (const BiasedSubrs& biasedSubrs, unsigned int &subr_num) + bool popSubrNum (const BiasedSubrs& biasedSubrs, unsigned int &subr_num) { int n = SUPER::argStack.pop_int (); n += biasedSubrs.get_bias (); @@ -157,7 +157,7 @@ struct CSInterpEnv : InterpEnv return true; } - inline void callSubr (const BiasedSubrs& biasedSubrs, CSType type) + void callSubr (const BiasedSubrs& biasedSubrs, CSType type) { unsigned int subr_num; @@ -174,7 +174,7 @@ struct CSInterpEnv : InterpEnv SUPER::substr = context.substr; } - inline void returnFromSubr (void) + void returnFromSubr (void) { if (unlikely (SUPER::substr.in_error ())) SUPER::set_error (); @@ -182,7 +182,7 @@ struct CSInterpEnv : InterpEnv SUPER::substr = context.substr; } - inline void determine_hintmask_size (void) + void determine_hintmask_size (void) { if (!seen_hintmask) { @@ -192,14 +192,14 @@ struct CSInterpEnv : InterpEnv } } - inline void set_endchar (bool endchar_flag_) { endchar_flag = endchar_flag_; } - inline bool is_endchar (void) const { return endchar_flag; } + void set_endchar (bool endchar_flag_) { endchar_flag = endchar_flag_; } + bool is_endchar (void) const { return endchar_flag; } - inline const Number &get_x (void) const { return pt.x; } - inline const Number &get_y (void) const { return pt.y; } - inline const Point &get_pt (void) const { return pt; } + const Number &get_x (void) const { return pt.x; } + const Number &get_y (void) const { return pt.y; } + const Point &get_pt (void) const { return pt; } - inline void moveto (const Point &pt_ ) { pt = pt_; } + void moveto (const Point &pt_ ) { pt = pt_; } public: CallContext context; @@ -223,32 +223,32 @@ struct CSInterpEnv : InterpEnv template struct PathProcsNull { - static inline void rmoveto (ENV &env, PARAM& param) {} - static inline void hmoveto (ENV &env, PARAM& param) {} - static inline void vmoveto (ENV &env, PARAM& param) {} - static inline void rlineto (ENV &env, PARAM& param) {} - static inline void hlineto (ENV &env, PARAM& param) {} - static inline void vlineto (ENV &env, PARAM& param) {} - static inline void rrcurveto (ENV &env, PARAM& param) {} - static inline void rcurveline (ENV &env, PARAM& param) {} - static inline void rlinecurve (ENV &env, PARAM& param) {} - static inline void vvcurveto (ENV &env, PARAM& param) {} - static inline void hhcurveto (ENV &env, PARAM& param) {} - static inline void vhcurveto (ENV &env, PARAM& param) {} - static inline void hvcurveto (ENV &env, PARAM& param) {} - static inline void moveto (ENV &env, PARAM& param, const Point &pt) {} - static inline void line (ENV &env, PARAM& param, const Point &pt1) {} - static inline void curve (ENV &env, PARAM& param, const Point &pt1, const Point &pt2, const Point &pt3) {} - static inline void hflex (ENV &env, PARAM& param) {} - static inline void flex (ENV &env, PARAM& param) {} - static inline void hflex1 (ENV &env, PARAM& param) {} - static inline void flex1 (ENV &env, PARAM& param) {} + static void rmoveto (ENV &env, PARAM& param) {} + static void hmoveto (ENV &env, PARAM& param) {} + static void vmoveto (ENV &env, PARAM& param) {} + static void rlineto (ENV &env, PARAM& param) {} + static void hlineto (ENV &env, PARAM& param) {} + static void vlineto (ENV &env, PARAM& param) {} + static void rrcurveto (ENV &env, PARAM& param) {} + static void rcurveline (ENV &env, PARAM& param) {} + static void rlinecurve (ENV &env, PARAM& param) {} + static void vvcurveto (ENV &env, PARAM& param) {} + static void hhcurveto (ENV &env, PARAM& param) {} + static void vhcurveto (ENV &env, PARAM& param) {} + static void hvcurveto (ENV &env, PARAM& param) {} + static void moveto (ENV &env, PARAM& param, const Point &pt) {} + static void line (ENV &env, PARAM& param, const Point &pt1) {} + static void curve (ENV &env, PARAM& param, const Point &pt1, const Point &pt2, const Point &pt3) {} + static void hflex (ENV &env, PARAM& param) {} + static void flex (ENV &env, PARAM& param) {} + static void hflex1 (ENV &env, PARAM& param) {} + static void flex1 (ENV &env, PARAM& param) {} }; template > struct CSOpSet : OpSet { - static inline void process_op (OpCode op, ENV &env, PARAM& param) + static void process_op (OpCode op, ENV &env, PARAM& param) { switch (op) { @@ -370,19 +370,19 @@ struct CSOpSet : OpSet } } - static inline void process_hstem (OpCode op, ENV &env, PARAM& param) + static void process_hstem (OpCode op, ENV &env, PARAM& param) { env.hstem_count += env.argStack.get_count () / 2; OPSET::flush_args_and_op (op, env, param); } - static inline void process_vstem (OpCode op, ENV &env, PARAM& param) + static void process_vstem (OpCode op, ENV &env, PARAM& param) { env.vstem_count += env.argStack.get_count () / 2; OPSET::flush_args_and_op (op, env, param); } - static inline void process_hintmask (OpCode op, ENV &env, PARAM& param) + static void process_hintmask (OpCode op, ENV &env, PARAM& param) { env.determine_hintmask_size (); if (likely (env.substr.avail (env.hintmask_size))) @@ -392,15 +392,15 @@ struct CSOpSet : OpSet } } - static inline void process_post_flex (OpCode op, ENV &env, PARAM& param) + static void process_post_flex (OpCode op, ENV &env, PARAM& param) { OPSET::flush_args_and_op (op, env, param); } - static inline void check_width (OpCode op, ENV &env, PARAM& param) + static void check_width (OpCode op, ENV &env, PARAM& param) {} - static inline void process_post_move (OpCode op, ENV &env, PARAM& param) + static void process_post_move (OpCode op, ENV &env, PARAM& param) { if (!env.seen_moveto) { @@ -410,32 +410,32 @@ struct CSOpSet : OpSet OPSET::flush_args_and_op (op, env, param); } - static inline void process_post_path (OpCode op, ENV &env, PARAM& param) + static void process_post_path (OpCode op, ENV &env, PARAM& param) { OPSET::flush_args_and_op (op, env, param); } - static inline void flush_args_and_op (OpCode op, ENV &env, PARAM& param) + static void flush_args_and_op (OpCode op, ENV &env, PARAM& param) { OPSET::flush_args (env, param); OPSET::flush_op (op, env, param); } - static inline void flush_args (ENV &env, PARAM& param) + static void flush_args (ENV &env, PARAM& param) { env.pop_n_args (env.argStack.get_count ()); } - static inline void flush_op (OpCode op, ENV &env, PARAM& param) + static void flush_op (OpCode op, ENV &env, PARAM& param) { } - static inline void flush_hintmask (OpCode op, ENV &env, PARAM& param) + static void flush_hintmask (OpCode op, ENV &env, PARAM& param) { OPSET::flush_args_and_op (op, env, param); } - static inline bool is_number_op (OpCode op) + static bool is_number_op (OpCode op) { switch (op) { @@ -460,7 +460,7 @@ struct CSOpSet : OpSet template struct PathProcs { - static inline void rmoveto (ENV &env, PARAM& param) + static void rmoveto (ENV &env, PARAM& param) { Point pt1 = env.get_pt (); const Number &dy = env.pop_arg (); @@ -469,21 +469,21 @@ struct PathProcs PATH::moveto (env, param, pt1); } - static inline void hmoveto (ENV &env, PARAM& param) + static void hmoveto (ENV &env, PARAM& param) { Point pt1 = env.get_pt (); pt1.move_x (env.pop_arg ()); PATH::moveto (env, param, pt1); } - static inline void vmoveto (ENV &env, PARAM& param) + static void vmoveto (ENV &env, PARAM& param) { Point pt1 = env.get_pt (); pt1.move_y (env.pop_arg ()); PATH::moveto (env, param, pt1); } - static inline void rlineto (ENV &env, PARAM& param) + static void rlineto (ENV &env, PARAM& param) { for (unsigned int i = 0; i + 2 <= env.argStack.get_count (); i += 2) { @@ -493,7 +493,7 @@ struct PathProcs } } - static inline void hlineto (ENV &env, PARAM& param) + static void hlineto (ENV &env, PARAM& param) { Point pt1; unsigned int i = 0; @@ -513,7 +513,7 @@ struct PathProcs } } - static inline void vlineto (ENV &env, PARAM& param) + static void vlineto (ENV &env, PARAM& param) { Point pt1; unsigned int i = 0; @@ -533,7 +533,7 @@ struct PathProcs } } - static inline void rrcurveto (ENV &env, PARAM& param) + static void rrcurveto (ENV &env, PARAM& param) { for (unsigned int i = 0; i + 6 <= env.argStack.get_count (); i += 6) { @@ -547,7 +547,7 @@ struct PathProcs } } - static inline void rcurveline (ENV &env, PARAM& param) + static void rcurveline (ENV &env, PARAM& param) { unsigned int i = 0; for (; i + 6 <= env.argStack.get_count (); i += 6) @@ -568,7 +568,7 @@ struct PathProcs } } - static inline void rlinecurve (ENV &env, PARAM& param) + static void rlinecurve (ENV &env, PARAM& param) { unsigned int i = 0; unsigned int line_limit = (env.argStack.get_count () % 6); @@ -590,7 +590,7 @@ struct PathProcs } } - static inline void vvcurveto (ENV &env, PARAM& param) + static void vvcurveto (ENV &env, PARAM& param) { unsigned int i = 0; Point pt1 = env.get_pt (); @@ -608,7 +608,7 @@ struct PathProcs } } - static inline void hhcurveto (ENV &env, PARAM& param) + static void hhcurveto (ENV &env, PARAM& param) { unsigned int i = 0; Point pt1 = env.get_pt (); @@ -626,7 +626,7 @@ struct PathProcs } } - static inline void vhcurveto (ENV &env, PARAM& param) + static void vhcurveto (ENV &env, PARAM& param) { Point pt1, pt2, pt3; unsigned int i = 0; @@ -687,7 +687,7 @@ struct PathProcs } } - static inline void hvcurveto (ENV &env, PARAM& param) + static void hvcurveto (ENV &env, PARAM& param) { Point pt1, pt2, pt3; unsigned int i = 0; @@ -749,16 +749,16 @@ struct PathProcs } /* default actions to be overridden */ - static inline void moveto (ENV &env, PARAM& param, const Point &pt) + static void moveto (ENV &env, PARAM& param, const Point &pt) { env.moveto (pt); } - static inline void line (ENV &env, PARAM& param, const Point &pt1) + static void line (ENV &env, PARAM& param, const Point &pt1) { PATH::moveto (env, param, pt1); } - static inline void curve (ENV &env, PARAM& param, const Point &pt1, const Point &pt2, const Point &pt3) + static void curve (ENV &env, PARAM& param, const Point &pt1, const Point &pt2, const Point &pt3) { PATH::moveto (env, param, pt3); } - static inline void hflex (ENV &env, PARAM& param) + static void hflex (ENV &env, PARAM& param) { if (likely (env.argStack.get_count () == 7)) { @@ -782,7 +782,7 @@ struct PathProcs env.set_error (); } - static inline void flex (ENV &env, PARAM& param) + static void flex (ENV &env, PARAM& param) { if (likely (env.argStack.get_count () == 13)) { @@ -805,7 +805,7 @@ struct PathProcs env.set_error (); } - static inline void hflex1 (ENV &env, PARAM& param) + static void hflex1 (ENV &env, PARAM& param) { if (likely (env.argStack.get_count () == 9)) { @@ -829,7 +829,7 @@ struct PathProcs env.set_error (); } - static inline void flex1 (ENV &env, PARAM& param) + static void flex1 (ENV &env, PARAM& param) { if (likely (env.argStack.get_count () == 11)) { @@ -868,9 +868,9 @@ struct PathProcs } protected: - static inline void curve2 (ENV &env, PARAM& param, - const Point &pt1, const Point &pt2, const Point &pt3, - const Point &pt4, const Point &pt5, const Point &pt6) + static void curve2 (ENV &env, PARAM& param, + const Point &pt1, const Point &pt2, const Point &pt3, + const Point &pt4, const Point &pt5, const Point &pt6) { PATH::curve (env, param, pt1, pt2, pt3); PATH::curve (env, param, pt4, pt5, pt6); @@ -880,7 +880,7 @@ struct PathProcs template struct CSInterpreter : Interpreter { - inline bool interpret (PARAM& param) + bool interpret (PARAM& param) { SUPER::env.set_endchar (false); diff --git a/src/hb-cff-interp-dict-common.hh b/src/hb-cff-interp-dict-common.hh index f35342c99..8815bbf2c 100644 --- a/src/hb-cff-interp-dict-common.hh +++ b/src/hb-cff-interp-dict-common.hh @@ -37,14 +37,8 @@ using namespace OT; /* an opstr and the parsed out dict value(s) */ struct DictVal : OpStr { - inline void init (void) - { - single_val.set_int (0); - } - - inline void fini (void) - { - } + void init (void) { single_val.set_int (0); } + void fini (void) {} Number single_val; }; @@ -56,19 +50,19 @@ template struct DictValues : ParsedValues {}; template struct TopDictValues : DictValues { - inline void init (void) + void init (void) { DictValues::init (); charStringsOffset = 0; FDArrayOffset = 0; } - inline void fini (void) + void fini (void) { DictValues::fini (); } - inline unsigned int calculate_serialized_op_size (const OPSTR& opstr) const + unsigned int calculate_serialized_op_size (const OPSTR& opstr) const { switch (opstr.op) { @@ -87,7 +81,7 @@ struct TopDictValues : DictValues struct DictOpSet : OpSet { - static inline void process_op (OpCode op, InterpEnv& env) + static void process_op (OpCode op, InterpEnv& env) { switch (op) { case OpCode_longintdict: /* 5-byte integer */ @@ -104,7 +98,7 @@ struct DictOpSet : OpSet } } - static inline double parse_bcd (SubByteStr& substr) + static double parse_bcd (SubByteStr& substr) { bool neg = false; double int_part = 0; @@ -230,7 +224,7 @@ struct DictOpSet : OpSet return value; } - static inline bool is_hint_op (OpCode op) + static bool is_hint_op (OpCode op) { switch (op) { @@ -258,7 +252,7 @@ struct DictOpSet : OpSet template struct TopDictOpSet : DictOpSet { - static inline void process_op (OpCode op, InterpEnv& env, TopDictValues & dictval) + static void process_op (OpCode op, InterpEnv& env, TopDictValues & dictval) { switch (op) { case OpCode_CharStrings: @@ -282,7 +276,7 @@ struct TopDictOpSet : DictOpSet template struct DictInterpreter : Interpreter { - inline bool interpret (PARAM& param) + bool interpret (PARAM& param) { param.init (); while (SUPER::env.substr.avail ()) diff --git a/src/hb-cff1-interp-cs.hh b/src/hb-cff1-interp-cs.hh index 95950b0c1..c4ff35197 100644 --- a/src/hb-cff1-interp-cs.hh +++ b/src/hb-cff1-interp-cs.hh @@ -38,7 +38,7 @@ typedef BiasedSubrs CFF1BiasedSubrs; struct CFF1CSInterpEnv : CSInterpEnv { template - inline void init (const ByteStr &str, ACC &acc, unsigned int fd) + void init (const ByteStr &str, ACC &acc, unsigned int fd) { SUPER::init (str, *acc.globalSubrs, *acc.privateDicts[fd].localSubrs); processed_width = false; @@ -47,12 +47,9 @@ struct CFF1CSInterpEnv : CSInterpEnv in_seac = false; } - inline void fini (void) - { - SUPER::fini (); - } + void fini (void) { SUPER::fini (); } - inline void set_width (bool has_width_) + void set_width (bool has_width_) { if (likely (!processed_width && (SUPER::argStack.get_count () > 0))) { @@ -66,13 +63,13 @@ struct CFF1CSInterpEnv : CSInterpEnv processed_width = true; } - inline void clear_args (void) + void clear_args (void) { arg_start = 0; SUPER::clear_args (); } - inline void set_in_seac (bool _in_seac) { in_seac = _in_seac; } + void set_in_seac (bool _in_seac) { in_seac = _in_seac; } bool processed_width; bool has_width; @@ -90,7 +87,7 @@ struct CFF1CSOpSet : CSOpSet /* PostScript-originated legacy opcodes (OpCode_add etc) are unsupported */ /* Type 1-originated deprecated opcodes, seac behavior of endchar and dotsection are supported */ - static inline void process_op (OpCode op, CFF1CSInterpEnv &env, PARAM& param) + static void process_op (OpCode op, CFF1CSInterpEnv &env, PARAM& param) { switch (op) { case OpCode_dotsection: @@ -112,7 +109,7 @@ struct CFF1CSOpSet : CSOpSet } } - static inline void check_width (OpCode op, CFF1CSInterpEnv &env, PARAM& param) + static void check_width (OpCode op, CFF1CSInterpEnv &env, PARAM& param) { if (!env.processed_width) { @@ -142,11 +139,11 @@ struct CFF1CSOpSet : CSOpSet } } - static inline void process_seac (CFF1CSInterpEnv &env, PARAM& param) + static void process_seac (CFF1CSInterpEnv &env, PARAM& param) { } - static inline void flush_args (CFF1CSInterpEnv &env, PARAM& param) + static void flush_args (CFF1CSInterpEnv &env, PARAM& param) { SUPER::flush_args (env, param); env.clear_args (); /* pop off width */ diff --git a/src/hb-cff2-interp-cs.hh b/src/hb-cff2-interp-cs.hh index 8e296b6ef..bf482a97d 100644 --- a/src/hb-cff2-interp-cs.hh +++ b/src/hb-cff2-interp-cs.hh @@ -35,23 +35,23 @@ using namespace OT; struct BlendArg : Number { - inline void init (void) + void init (void) { Number::init (); deltas.init (); } - inline void fini (void) + void fini (void) { Number::fini (); deltas.fini_deep (); } - inline void set_int (int v) { reset_blends (); Number::set_int (v); } - inline void set_fixed (int32_t v) { reset_blends (); Number::set_fixed (v); } - inline void set_real (double v) { reset_blends (); Number::set_real (v); } + void set_int (int v) { reset_blends (); Number::set_int (v); } + void set_fixed (int32_t v) { reset_blends (); Number::set_fixed (v); } + void set_real (double v) { reset_blends (); Number::set_real (v); } - inline void set_blends (unsigned int numValues_, unsigned int valueIndex_, + void set_blends (unsigned int numValues_, unsigned int valueIndex_, unsigned int numBlends, const hb_array_t &blends_) { numValues = numValues_; @@ -61,8 +61,8 @@ struct BlendArg : Number deltas[i] = blends_[i]; } - inline bool blending (void) const { return deltas.len > 0; } - inline void reset_blends (void) + bool blending (void) const { return deltas.len > 0; } + void reset_blends (void) { numValues = valueIndex = 0; deltas.resize (0); @@ -79,7 +79,7 @@ typedef BiasedSubrs CFF2BiasedSubrs; struct CFF2CSInterpEnv : CSInterpEnv { template - inline void init (const ByteStr &str, ACC &acc, unsigned int fd, + void init (const ByteStr &str, ACC &acc, unsigned int fd, const int *coords_=nullptr, unsigned int num_coords_=0) { SUPER::init (str, *acc.globalSubrs, *acc.privateDicts[fd].localSubrs); @@ -94,13 +94,13 @@ struct CFF2CSInterpEnv : CSInterpEnv set_ivs (acc.privateDicts[fd].ivs); } - inline void fini (void) + void fini (void) { scalars.fini (); SUPER::fini (); } - inline OpCode fetch_op (void) + OpCode fetch_op (void) { if (this->substr.avail ()) return SUPER::fetch_op (); @@ -112,21 +112,21 @@ struct CFF2CSInterpEnv : CSInterpEnv return OpCode_return; } - inline const BlendArg& eval_arg (unsigned int i) + const BlendArg& eval_arg (unsigned int i) { BlendArg &arg = argStack[i]; blend_arg (arg); return arg; } - inline const BlendArg& pop_arg (void) + const BlendArg& pop_arg (void) { BlendArg &arg = argStack.pop (); blend_arg (arg); return arg; } - inline void process_blend (void) + void process_blend (void) { if (!seen_blend) { @@ -142,7 +142,7 @@ struct CFF2CSInterpEnv : CSInterpEnv } } - inline void process_vsindex (void) + void process_vsindex (void) { unsigned int index = argStack.pop_uint (); if (unlikely (seen_vsindex () || seen_blend)) @@ -156,14 +156,14 @@ struct CFF2CSInterpEnv : CSInterpEnv seen_vsindex_ = true; } - inline unsigned int get_region_count (void) const { return region_count; } - inline void set_region_count (unsigned int region_count_) { region_count = region_count_; } - inline unsigned int get_ivs (void) const { return ivs; } - inline void set_ivs (unsigned int ivs_) { ivs = ivs_; } - inline bool seen_vsindex (void) const { return seen_vsindex_; } + unsigned int get_region_count (void) const { return region_count; } + void set_region_count (unsigned int region_count_) { region_count = region_count_; } + unsigned int get_ivs (void) const { return ivs; } + void set_ivs (unsigned int ivs_) { ivs = ivs_; } + bool seen_vsindex (void) const { return seen_vsindex_; } protected: - inline void blend_arg (BlendArg &arg) + void blend_arg (BlendArg &arg) { if (do_blend && arg.blending ()) { @@ -196,7 +196,7 @@ struct CFF2CSInterpEnv : CSInterpEnv template > struct CFF2CSOpSet : CSOpSet { - static inline void process_op (OpCode op, CFF2CSInterpEnv &env, PARAM& param) + static void process_op (OpCode op, CFF2CSInterpEnv &env, PARAM& param) { switch (op) { case OpCode_callsubr: @@ -228,7 +228,7 @@ struct CFF2CSOpSet : CSOpSet } } - static inline void process_blend (CFF2CSInterpEnv &env, PARAM& param) + static void process_blend (CFF2CSInterpEnv &env, PARAM& param) { unsigned int n, k; @@ -253,7 +253,7 @@ struct CFF2CSOpSet : CSOpSet env.argStack.pop (k * n); } - static inline void process_vsindex (CFF2CSInterpEnv &env, PARAM& param) + static void process_vsindex (CFF2CSInterpEnv &env, PARAM& param) { env.process_vsindex (); env.clear_args (); diff --git a/src/hb-common.cc b/src/hb-common.cc index c3cffccb1..c64b48934 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -247,11 +247,10 @@ struct hb_language_item_t { struct hb_language_item_t *next; hb_language_t lang; - inline bool operator == (const char *s) const { - return lang_equal (lang, s); - } + bool operator == (const char *s) const + { return lang_equal (lang, s); } - inline hb_language_item_t & operator = (const char *s) { + hb_language_item_t & operator = (const char *s) { /* If a custom allocated is used calling strdup() pairs badly with a call to the custom free() in fini() below. Therefore don't call strdup(), implement its behavior. @@ -787,7 +786,7 @@ static void free_static_C_locale (void); static struct hb_C_locale_lazy_loader_t : hb_lazy_loader_t { - static inline HB_LOCALE_T create (void) + static HB_LOCALE_T create (void) { HB_LOCALE_T C_locale = HB_CREATE_LOCALE ("C"); @@ -797,11 +796,11 @@ static struct hb_C_locale_lazy_loader_t : hb_lazy_loader_t (what, obj, func, true, plevel ? *plevel : 0, +1, message, ap); va_end (ap); } - inline ~hb_auto_trace_t (void) + ~hb_auto_trace_t (void) { _hb_warn_no_return (returned); if (!returned) { @@ -293,9 +293,9 @@ struct hb_auto_trace_t if (plevel) --*plevel; } - inline ret_t ret (ret_t v, - const char *func = "", - unsigned int line = 0) + ret_t ret (ret_t v, + const char *func = "", + unsigned int line = 0) { if (unlikely (returned)) { fprintf (stderr, "OUCH, double calls to return_trace(). This is a bug, please report.\n"); @@ -327,18 +327,18 @@ struct hb_auto_trace_t<0, ret_t> const char *message, ...) HB_PRINTF_FUNC(6, 7) {} - inline ret_t ret (ret_t v, - const char *func HB_UNUSED = nullptr, - unsigned int line HB_UNUSED = 0) { return v; } + ret_t ret (ret_t v, + const char *func HB_UNUSED = nullptr, + unsigned int line HB_UNUSED = 0) { return v; } }; /* For disabled tracing; optimize out everything. * https://github.com/harfbuzz/harfbuzz/pull/605 */ template struct hb_no_trace_t { - inline ret_t ret (ret_t v, - const char *func HB_UNUSED = "", - unsigned int line HB_UNUSED = 0) { return v; } + ret_t ret (ret_t v, + const char *func HB_UNUSED = "", + unsigned int line HB_UNUSED = 0) { return v; } }; #define return_trace(RET) return trace.ret (RET, HB_FUNC, __LINE__) diff --git a/src/hb-directwrite.cc b/src/hb-directwrite.cc index c4b6e9458..ceaffa858 100644 --- a/src/hb-directwrite.cc +++ b/src/hb-directwrite.cc @@ -269,7 +269,7 @@ public: uint8_t mBidiLevel; bool mIsSideways; - inline bool ContainsTextPosition (uint32_t aTextPosition) const + bool ContainsTextPosition (uint32_t aTextPosition) const { return aTextPosition >= mTextStart && aTextPosition < mTextStart + mTextLength; diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh index f7bba5772..77c158f80 100644 --- a/src/hb-dsalgs.hh +++ b/src/hb-dsalgs.hh @@ -535,24 +535,24 @@ hb_codepoint_parse (const char *s, unsigned int len, int base, hb_codepoint_t *o struct hb_bytes_t { - inline hb_bytes_t (void) : arrayZ (nullptr), len (0) {} - inline hb_bytes_t (const char *bytes_, unsigned int len_) : arrayZ (bytes_), len (len_) {} - inline hb_bytes_t (const void *bytes_, unsigned int len_) : arrayZ ((const char *) bytes_), len (len_) {} + hb_bytes_t (void) : arrayZ (nullptr), len (0) {} + hb_bytes_t (const char *bytes_, unsigned int len_) : arrayZ (bytes_), len (len_) {} + hb_bytes_t (const void *bytes_, unsigned int len_) : arrayZ ((const char *) bytes_), len (len_) {} template - inline hb_bytes_t (const T& array) : arrayZ ((const char *) array.arrayZ), len (array.len * sizeof (array.arrayZ[0])) {} + hb_bytes_t (const T& array) : arrayZ ((const char *) array.arrayZ), len (array.len * sizeof (array.arrayZ[0])) {} - inline operator const void * (void) const { return arrayZ; } - inline operator const char * (void) const { return arrayZ; } + operator const void * (void) const { return arrayZ; } + operator const char * (void) const { return arrayZ; } - inline void free (void) { ::free ((void *) arrayZ); arrayZ = nullptr; len = 0; } + void free (void) { ::free ((void *) arrayZ); arrayZ = nullptr; len = 0; } - inline int cmp (const hb_bytes_t &a) const + int cmp (const hb_bytes_t &a) const { if (len != a.len) return (int) a.len - (int) len; return hb_memcmp (a.arrayZ, arrayZ, len); } - static inline int cmp (const void *pa, const void *pb) + static int cmp (const void *pa, const void *pb) { hb_bytes_t *a = (hb_bytes_t *) pa; hb_bytes_t *b = (hb_bytes_t *) pb; @@ -571,24 +571,24 @@ struct hb_array_t { static_assert ((bool) (unsigned) hb_static_size (Type), ""); - inline hb_array_t (void) : arrayZ (nullptr), len (0) {} - inline hb_array_t (const hb_array_t &o) : arrayZ (o.arrayZ), len (o.len) {} - inline hb_array_t (Type *array_, unsigned int len_) : arrayZ (array_), len (len_) {} + hb_array_t (void) : arrayZ (nullptr), len (0) {} + hb_array_t (const hb_array_t &o) : arrayZ (o.arrayZ), len (o.len) {} + hb_array_t (Type *array_, unsigned int len_) : arrayZ (array_), len (len_) {} - inline Type& operator [] (int i_) const + Type& operator [] (int i_) const { unsigned int i = (unsigned int) i_; if (unlikely (i >= len)) return Null(Type); return arrayZ[i]; } - template inline operator T * (void) const { return arrayZ; } + template operator T * (void) const { return arrayZ; } - inline Type * operator & (void) const { return arrayZ; } + Type * operator & (void) const { return arrayZ; } - inline unsigned int get_size (void) const { return len * sizeof (Type); } + unsigned int get_size (void) const { return len * sizeof (Type); } - inline hb_array_t sub_array (unsigned int start_offset = 0, unsigned int *seg_count = nullptr /* IN/OUT */) const + hb_array_t sub_array (unsigned int start_offset = 0, unsigned int *seg_count = nullptr /* IN/OUT */) const { if (!start_offset && !seg_count) return *this; @@ -602,14 +602,14 @@ struct hb_array_t count = *seg_count = MIN (count, *seg_count); return hb_array_t (arrayZ + start_offset, count); } - inline hb_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const + hb_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const { return sub_array (start_offset, &seg_count); } - inline hb_bytes_t as_bytes (void) const + hb_bytes_t as_bytes (void) const { return hb_bytes_t (arrayZ, len * sizeof (Type)); } template - inline Type *lsearch (const T &x, + Type *lsearch (const T &x, Type *not_found = nullptr) { unsigned int count = len; @@ -619,7 +619,7 @@ struct hb_array_t return not_found; } template - inline const Type *lsearch (const T &x, const Type *not_found = nullptr) const + const Type *lsearch (const T &x, const Type *not_found = nullptr) const { unsigned int count = len; for (unsigned int i = 0; i < count; i++) @@ -628,28 +628,28 @@ struct hb_array_t return not_found; } - inline hb_sorted_array_t qsort (int (*cmp)(const void*, const void*)) + hb_sorted_array_t qsort (int (*cmp)(const void*, const void*)) { ::qsort (arrayZ, len, sizeof (Type), cmp); return hb_sorted_array_t (*this); } - inline hb_sorted_array_t qsort (void) + hb_sorted_array_t qsort (void) { ::qsort (arrayZ, len, sizeof (Type), Type::cmp); return hb_sorted_array_t (*this); } - inline void qsort (unsigned int start, unsigned int end) + void qsort (unsigned int start, unsigned int end) { end = MIN (end, len); assert (start <= end); ::qsort (arrayZ + start, end - start, sizeof (Type), Type::cmp); } - inline void free (void) + void free (void) { ::free ((void *) arrayZ); arrayZ = nullptr; len = 0; } template - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { return c->check_array (arrayZ, len); } public: @@ -670,29 +670,29 @@ enum hb_bfind_not_found_t template struct hb_sorted_array_t : hb_array_t { - inline hb_sorted_array_t (void) : hb_array_t () {} - inline hb_sorted_array_t (const hb_array_t &o) : hb_array_t (o) {} - inline hb_sorted_array_t (Type *array_, unsigned int len_) : hb_array_t (array_, len_) {} + hb_sorted_array_t (void) : hb_array_t () {} + hb_sorted_array_t (const hb_array_t &o) : hb_array_t (o) {} + hb_sorted_array_t (Type *array_, unsigned int len_) : hb_array_t (array_, len_) {} - inline hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int *seg_count /* IN/OUT */) const + hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int *seg_count /* IN/OUT */) const { return hb_sorted_array_t (((const hb_array_t *) (this))->sub_array (start_offset, seg_count)); } - inline hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const + hb_sorted_array_t sub_array (unsigned int start_offset, unsigned int seg_count) const { return sub_array (start_offset, &seg_count); } template - inline Type *bsearch (const T &x, Type *not_found = nullptr) + Type *bsearch (const T &x, Type *not_found = nullptr) { unsigned int i; return bfind (x, &i) ? &this->arrayZ[i] : not_found; } template - inline const Type *bsearch (const T &x, const Type *not_found = nullptr) const + const Type *bsearch (const T &x, const Type *not_found = nullptr) const { unsigned int i; return bfind (x, &i) ? &this->arrayZ[i] : not_found; } template - inline bool bfind (const T &x, unsigned int *i = nullptr, + bool bfind (const T &x, unsigned int *i = nullptr, hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE, unsigned int to_store = (unsigned int) -1) const { @@ -773,13 +773,13 @@ struct HbOpXor template struct hb_vector_size_t { - inline elt_t& operator [] (unsigned int i) { return u.v[i]; } - inline const elt_t& operator [] (unsigned int i) const { return u.v[i]; } + elt_t& operator [] (unsigned int i) { return u.v[i]; } + const elt_t& operator [] (unsigned int i) const { return u.v[i]; } - inline void clear (unsigned char v = 0) { memset (this, v, sizeof (*this)); } + void clear (unsigned char v = 0) { memset (this, v, sizeof (*this)); } template - inline hb_vector_size_t process (const hb_vector_size_t &o) const + hb_vector_size_t process (const hb_vector_size_t &o) const { hb_vector_size_t r; #if HB_VECTOR_SIZE @@ -792,13 +792,13 @@ struct hb_vector_size_t Op::process (r.u.v[i], u.v[i], o.u.v[i]); return r; } - inline hb_vector_size_t operator | (const hb_vector_size_t &o) const + hb_vector_size_t operator | (const hb_vector_size_t &o) const { return process (o); } - inline hb_vector_size_t operator & (const hb_vector_size_t &o) const + hb_vector_size_t operator & (const hb_vector_size_t &o) const { return process (o); } - inline hb_vector_size_t operator ^ (const hb_vector_size_t &o) const + hb_vector_size_t operator ^ (const hb_vector_size_t &o) const { return process (o); } - inline hb_vector_size_t operator ~ (void) const + hb_vector_size_t operator ~ (void) const { hb_vector_size_t r; #if HB_VECTOR_SIZE && 0 diff --git a/src/hb-face.cc b/src/hb-face.cc index 724f54d53..a9e0c0173 100644 --- a/src/hb-face.cc +++ b/src/hb-face.cc @@ -588,7 +588,7 @@ struct hb_face_builder_data_t { struct table_entry_t { - inline int cmp (hb_tag_t t) const + int cmp (hb_tag_t t) const { if (t < tag) return -1; if (t > tag) return -1; diff --git a/src/hb-face.hh b/src/hb-face.hh index 0b672336f..014ab3bde 100644 --- a/src/hb-face.hh +++ b/src/hb-face.hh @@ -67,7 +67,7 @@ struct hb_face_t }; hb_atomic_ptr_t shape_plans; - inline hb_blob_t *reference_table (hb_tag_t tag) const + hb_blob_t *reference_table (hb_tag_t tag) const { hb_blob_t *blob; @@ -81,7 +81,7 @@ struct hb_face_t return blob; } - inline HB_PURE_FUNC unsigned int get_upem (void) const + HB_PURE_FUNC unsigned int get_upem (void) const { unsigned int ret = upem.get_relaxed (); if (unlikely (!ret)) @@ -91,7 +91,7 @@ struct hb_face_t return ret; } - inline unsigned int get_num_glyphs (void) const + unsigned int get_num_glyphs (void) const { unsigned int ret = num_glyphs.get_relaxed (); if (unlikely (ret == (unsigned int) -1)) diff --git a/src/hb-font.hh b/src/hb-font.hh index 73733b34b..5ae6cae6f 100644 --- a/src/hb-font.hh +++ b/src/hb-font.hh @@ -127,40 +127,42 @@ struct hb_font_t /* Convert from font-space to user-space */ - inline int dir_scale (hb_direction_t direction) + int dir_scale (hb_direction_t direction) { return HB_DIRECTION_IS_VERTICAL(direction) ? y_scale : x_scale; } - inline hb_position_t em_scale_x (int16_t v) { return em_scale (v, x_scale); } - inline hb_position_t em_scale_y (int16_t v) { return em_scale (v, y_scale); } - inline hb_position_t em_scalef_x (float v) { return em_scalef (v, this->x_scale); } - inline hb_position_t em_scalef_y (float v) { return em_scalef (v, this->y_scale); } - inline float em_fscale_x (int16_t v) { return em_fscale (v, x_scale); } - inline float em_fscale_y (int16_t v) { return em_fscale (v, y_scale); } - inline hb_position_t em_scale_dir (int16_t v, hb_direction_t direction) + hb_position_t em_scale_x (int16_t v) { return em_scale (v, x_scale); } + hb_position_t em_scale_y (int16_t v) { return em_scale (v, y_scale); } + hb_position_t em_scalef_x (float v) { return em_scalef (v, this->x_scale); } + hb_position_t em_scalef_y (float v) { return em_scalef (v, this->y_scale); } + float em_fscale_x (int16_t v) { return em_fscale (v, x_scale); } + float em_fscale_y (int16_t v) { return em_fscale (v, y_scale); } + hb_position_t em_scale_dir (int16_t v, hb_direction_t direction) { return em_scale (v, dir_scale (direction)); } /* Convert from parent-font user-space to our user-space */ - inline hb_position_t parent_scale_x_distance (hb_position_t v) { + hb_position_t parent_scale_x_distance (hb_position_t v) + { if (unlikely (parent && parent->x_scale != x_scale)) return (hb_position_t) (v * (int64_t) this->x_scale / this->parent->x_scale); return v; } - inline hb_position_t parent_scale_y_distance (hb_position_t v) { + hb_position_t parent_scale_y_distance (hb_position_t v) + { if (unlikely (parent && parent->y_scale != y_scale)) return (hb_position_t) (v * (int64_t) this->y_scale / this->parent->y_scale); return v; } - inline hb_position_t parent_scale_x_position (hb_position_t v) { - return parent_scale_x_distance (v); - } - inline hb_position_t parent_scale_y_position (hb_position_t v) { - return parent_scale_y_distance (v); - } + hb_position_t parent_scale_x_position (hb_position_t v) + { return parent_scale_x_distance (v); } + hb_position_t parent_scale_y_position (hb_position_t v) + { return parent_scale_y_distance (v); } - inline void parent_scale_distance (hb_position_t *x, hb_position_t *y) { + void parent_scale_distance (hb_position_t *x, hb_position_t *y) + { *x = parent_scale_x_distance (*x); *y = parent_scale_y_distance (*y); } - inline void parent_scale_position (hb_position_t *x, hb_position_t *y) { + void parent_scale_position (hb_position_t *x, hb_position_t *y) + { *x = parent_scale_x_position (*x); *y = parent_scale_y_position (*y); } @@ -190,14 +192,14 @@ struct hb_font_t HB_FONT_FUNCS_IMPLEMENT_CALLBACKS #undef HB_FONT_FUNC_IMPLEMENT - inline hb_bool_t get_font_h_extents (hb_font_extents_t *extents) + hb_bool_t get_font_h_extents (hb_font_extents_t *extents) { memset (extents, 0, sizeof (*extents)); return klass->get.f.font_h_extents (this, user_data, extents, klass->user_data.font_h_extents); } - inline hb_bool_t get_font_v_extents (hb_font_extents_t *extents) + hb_bool_t get_font_v_extents (hb_font_extents_t *extents) { memset (extents, 0, sizeof (*extents)); return klass->get.f.font_v_extents (this, user_data, @@ -205,13 +207,13 @@ struct hb_font_t klass->user_data.font_v_extents); } - inline bool has_glyph (hb_codepoint_t unicode) + bool has_glyph (hb_codepoint_t unicode) { hb_codepoint_t glyph; return get_nominal_glyph (unicode, &glyph); } - inline hb_bool_t get_nominal_glyph (hb_codepoint_t unicode, + hb_bool_t get_nominal_glyph (hb_codepoint_t unicode, hb_codepoint_t *glyph) { *glyph = 0; @@ -219,11 +221,11 @@ struct hb_font_t unicode, glyph, klass->user_data.nominal_glyph); } - inline unsigned int get_nominal_glyphs (unsigned int count, - const hb_codepoint_t *first_unicode, - unsigned int unicode_stride, - hb_codepoint_t *first_glyph, - unsigned int glyph_stride) + unsigned int get_nominal_glyphs (unsigned int count, + const hb_codepoint_t *first_unicode, + unsigned int unicode_stride, + hb_codepoint_t *first_glyph, + unsigned int glyph_stride) { return klass->get.f.nominal_glyphs (this, user_data, count, @@ -232,8 +234,8 @@ struct hb_font_t klass->user_data.nominal_glyphs); } - inline hb_bool_t get_variation_glyph (hb_codepoint_t unicode, hb_codepoint_t variation_selector, - hb_codepoint_t *glyph) + hb_bool_t get_variation_glyph (hb_codepoint_t unicode, hb_codepoint_t variation_selector, + hb_codepoint_t *glyph) { *glyph = 0; return klass->get.f.variation_glyph (this, user_data, @@ -241,25 +243,25 @@ struct hb_font_t klass->user_data.variation_glyph); } - inline hb_position_t get_glyph_h_advance (hb_codepoint_t glyph) + hb_position_t get_glyph_h_advance (hb_codepoint_t glyph) { return klass->get.f.glyph_h_advance (this, user_data, glyph, klass->user_data.glyph_h_advance); } - inline hb_position_t get_glyph_v_advance (hb_codepoint_t glyph) + hb_position_t get_glyph_v_advance (hb_codepoint_t glyph) { return klass->get.f.glyph_v_advance (this, user_data, glyph, klass->user_data.glyph_v_advance); } - inline void get_glyph_h_advances (unsigned int count, - const hb_codepoint_t *first_glyph, - unsigned int glyph_stride, - hb_position_t *first_advance, - unsigned int advance_stride) + void get_glyph_h_advances (unsigned int count, + const hb_codepoint_t *first_glyph, + unsigned int glyph_stride, + hb_position_t *first_advance, + unsigned int advance_stride) { return klass->get.f.glyph_h_advances (this, user_data, count, @@ -268,11 +270,11 @@ struct hb_font_t klass->user_data.glyph_h_advances); } - inline void get_glyph_v_advances (unsigned int count, - const hb_codepoint_t *first_glyph, - unsigned int glyph_stride, - hb_position_t *first_advance, - unsigned int advance_stride) + void get_glyph_v_advances (unsigned int count, + const hb_codepoint_t *first_glyph, + unsigned int glyph_stride, + hb_position_t *first_advance, + unsigned int advance_stride) { return klass->get.f.glyph_v_advances (this, user_data, count, @@ -281,7 +283,7 @@ struct hb_font_t klass->user_data.glyph_v_advances); } - inline hb_bool_t get_glyph_h_origin (hb_codepoint_t glyph, + hb_bool_t get_glyph_h_origin (hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y) { *x = *y = 0; @@ -290,8 +292,8 @@ struct hb_font_t klass->user_data.glyph_h_origin); } - inline hb_bool_t get_glyph_v_origin (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + hb_bool_t get_glyph_v_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { *x = *y = 0; return klass->get.f.glyph_v_origin (this, user_data, @@ -299,21 +301,23 @@ struct hb_font_t klass->user_data.glyph_v_origin); } - inline hb_position_t get_glyph_h_kerning (hb_codepoint_t left_glyph, hb_codepoint_t right_glyph) + hb_position_t get_glyph_h_kerning (hb_codepoint_t left_glyph, + hb_codepoint_t right_glyph) { return klass->get.f.glyph_h_kerning (this, user_data, left_glyph, right_glyph, klass->user_data.glyph_h_kerning); } - inline hb_position_t get_glyph_v_kerning (hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph) + hb_position_t get_glyph_v_kerning (hb_codepoint_t top_glyph, + hb_codepoint_t bottom_glyph) { return klass->get.f.glyph_v_kerning (this, user_data, top_glyph, bottom_glyph, klass->user_data.glyph_v_kerning); } - inline hb_bool_t get_glyph_extents (hb_codepoint_t glyph, + hb_bool_t get_glyph_extents (hb_codepoint_t glyph, hb_glyph_extents_t *extents) { memset (extents, 0, sizeof (*extents)); @@ -323,7 +327,7 @@ struct hb_font_t klass->user_data.glyph_extents); } - inline hb_bool_t get_glyph_contour_point (hb_codepoint_t glyph, unsigned int point_index, + hb_bool_t get_glyph_contour_point (hb_codepoint_t glyph, unsigned int point_index, hb_position_t *x, hb_position_t *y) { *x = *y = 0; @@ -333,8 +337,8 @@ struct hb_font_t klass->user_data.glyph_contour_point); } - inline hb_bool_t get_glyph_name (hb_codepoint_t glyph, - char *name, unsigned int size) + hb_bool_t get_glyph_name (hb_codepoint_t glyph, + char *name, unsigned int size) { if (size) *name = '\0'; return klass->get.f.glyph_name (this, user_data, @@ -343,8 +347,8 @@ struct hb_font_t klass->user_data.glyph_name); } - inline hb_bool_t get_glyph_from_name (const char *name, int len, /* -1 means nul-terminated */ - hb_codepoint_t *glyph) + hb_bool_t get_glyph_from_name (const char *name, int len, /* -1 means nul-terminated */ + hb_codepoint_t *glyph) { *glyph = 0; if (len == -1) len = strlen (name); @@ -357,7 +361,7 @@ struct hb_font_t /* A bit higher-level, and with fallback */ - inline void get_h_extents_with_fallback (hb_font_extents_t *extents) + void get_h_extents_with_fallback (hb_font_extents_t *extents) { if (!get_font_h_extents (extents)) { @@ -366,7 +370,7 @@ struct hb_font_t extents->line_gap = 0; } } - inline void get_v_extents_with_fallback (hb_font_extents_t *extents) + void get_v_extents_with_fallback (hb_font_extents_t *extents) { if (!get_font_v_extents (extents)) { @@ -376,8 +380,8 @@ struct hb_font_t } } - inline void get_extents_for_direction (hb_direction_t direction, - hb_font_extents_t *extents) + void get_extents_for_direction (hb_direction_t direction, + hb_font_extents_t *extents) { if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) get_h_extents_with_fallback (extents); @@ -385,9 +389,9 @@ struct hb_font_t get_v_extents_with_fallback (extents); } - inline void get_glyph_advance_for_direction (hb_codepoint_t glyph, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y) + void get_glyph_advance_for_direction (hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) { *x = *y = 0; if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) @@ -395,12 +399,12 @@ struct hb_font_t else *y = get_glyph_v_advance (glyph); } - inline void get_glyph_advances_for_direction (hb_direction_t direction, - unsigned int count, - const hb_codepoint_t *first_glyph, - unsigned glyph_stride, - hb_position_t *first_advance, - unsigned advance_stride) + void get_glyph_advances_for_direction (hb_direction_t direction, + unsigned int count, + const hb_codepoint_t *first_glyph, + unsigned glyph_stride, + hb_position_t *first_advance, + unsigned advance_stride) { if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) get_glyph_h_advances (count, first_glyph, glyph_stride, first_advance, advance_stride); @@ -408,8 +412,8 @@ struct hb_font_t get_glyph_v_advances (count, first_glyph, glyph_stride, first_advance, advance_stride); } - inline void guess_v_origin_minus_h_origin (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void guess_v_origin_minus_h_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { *x = get_glyph_h_advance (glyph) / 2; @@ -419,8 +423,8 @@ struct hb_font_t *y = extents.ascender; } - inline void get_glyph_h_origin_with_fallback (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void get_glyph_h_origin_with_fallback (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { if (!get_glyph_h_origin (glyph, x, y) && get_glyph_v_origin (glyph, x, y)) @@ -430,8 +434,8 @@ struct hb_font_t *x -= dx; *y -= dy; } } - inline void get_glyph_v_origin_with_fallback (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void get_glyph_v_origin_with_fallback (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { if (!get_glyph_v_origin (glyph, x, y) && get_glyph_h_origin (glyph, x, y)) @@ -442,9 +446,9 @@ struct hb_font_t } } - inline void get_glyph_origin_for_direction (hb_codepoint_t glyph, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y) + void get_glyph_origin_for_direction (hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) { if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) get_glyph_h_origin_with_fallback (glyph, x, y); @@ -452,8 +456,8 @@ struct hb_font_t get_glyph_v_origin_with_fallback (glyph, x, y); } - inline void add_glyph_h_origin (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void add_glyph_h_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { hb_position_t origin_x, origin_y; @@ -462,8 +466,8 @@ struct hb_font_t *x += origin_x; *y += origin_y; } - inline void add_glyph_v_origin (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void add_glyph_v_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { hb_position_t origin_x, origin_y; @@ -472,9 +476,9 @@ struct hb_font_t *x += origin_x; *y += origin_y; } - inline void add_glyph_origin_for_direction (hb_codepoint_t glyph, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y) + void add_glyph_origin_for_direction (hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) { hb_position_t origin_x, origin_y; @@ -484,8 +488,8 @@ struct hb_font_t *y += origin_y; } - inline void subtract_glyph_h_origin (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void subtract_glyph_h_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { hb_position_t origin_x, origin_y; @@ -494,8 +498,8 @@ struct hb_font_t *x -= origin_x; *y -= origin_y; } - inline void subtract_glyph_v_origin (hb_codepoint_t glyph, - hb_position_t *x, hb_position_t *y) + void subtract_glyph_v_origin (hb_codepoint_t glyph, + hb_position_t *x, hb_position_t *y) { hb_position_t origin_x, origin_y; @@ -504,9 +508,9 @@ struct hb_font_t *x -= origin_x; *y -= origin_y; } - inline void subtract_glyph_origin_for_direction (hb_codepoint_t glyph, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y) + void subtract_glyph_origin_for_direction (hb_codepoint_t glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) { hb_position_t origin_x, origin_y; @@ -516,9 +520,9 @@ struct hb_font_t *y -= origin_y; } - inline void get_glyph_kerning_for_direction (hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y) + void get_glyph_kerning_for_direction (hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) { if (likely (HB_DIRECTION_IS_HORIZONTAL (direction))) { *y = 0; @@ -529,9 +533,9 @@ struct hb_font_t } } - inline hb_bool_t get_glyph_extents_for_origin (hb_codepoint_t glyph, - hb_direction_t direction, - hb_glyph_extents_t *extents) + hb_bool_t get_glyph_extents_for_origin (hb_codepoint_t glyph, + hb_direction_t direction, + hb_glyph_extents_t *extents) { hb_bool_t ret = get_glyph_extents (glyph, extents); @@ -541,9 +545,9 @@ struct hb_font_t return ret; } - inline hb_bool_t get_glyph_contour_point_for_origin (hb_codepoint_t glyph, unsigned int point_index, - hb_direction_t direction, - hb_position_t *x, hb_position_t *y) + hb_bool_t get_glyph_contour_point_for_origin (hb_codepoint_t glyph, unsigned int point_index, + hb_direction_t direction, + hb_position_t *x, hb_position_t *y) { hb_bool_t ret = get_glyph_contour_point (glyph, point_index, x, y); @@ -554,7 +558,7 @@ struct hb_font_t } /* Generates gidDDD if glyph has no name. */ - inline void + void glyph_to_string (hb_codepoint_t glyph, char *s, unsigned int size) { @@ -565,7 +569,7 @@ struct hb_font_t } /* Parses gidDDD and uniUUUU strings automatically. */ - inline hb_bool_t + hb_bool_t glyph_from_string (const char *s, int len, /* -1 means nul-terminated */ hb_codepoint_t *glyph) { @@ -595,21 +599,17 @@ struct hb_font_t return false; } - inline hb_position_t em_scale (int16_t v, int scale) + hb_position_t em_scale (int16_t v, int scale) { int upem = face->get_upem (); int64_t scaled = v * (int64_t) scale; scaled += scaled >= 0 ? upem/2 : -upem/2; /* Round. */ return (hb_position_t) (scaled / upem); } - inline hb_position_t em_scalef (float v, int scale) - { - return (hb_position_t) round (v * scale / face->get_upem ()); - } - inline float em_fscale (int16_t v, int scale) - { - return (float) v * scale / face->get_upem (); - } + hb_position_t em_scalef (float v, int scale) + { return (hb_position_t) round (v * scale / face->get_upem ()); } + float em_fscale (int16_t v, int scale) + { return (float) v * scale / face->get_upem (); } }; DECLARE_NULL_INSTANCE (hb_font_t); diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 633e0ecd2..1aeaa4a5d 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -484,7 +484,7 @@ static void free_static_ft_funcs (void); static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t { - static inline hb_font_funcs_t *create (void) + static hb_font_funcs_t *create (void) { hb_font_funcs_t *funcs = hb_font_funcs_create (); @@ -751,7 +751,7 @@ static void free_static_ft_library (void); static struct hb_ft_library_lazy_loader_t : hb_lazy_loader_t { - static inline FT_Library create (void) + static FT_Library create (void) { FT_Library l; if (FT_Init_FreeType (&l)) @@ -763,11 +763,11 @@ static struct hb_ft_library_lazy_loader_t : hb_lazy_loader_t { - static inline hb_unicode_funcs_t *create (void) + static hb_unicode_funcs_t *create (void) { hb_unicode_funcs_t *funcs = hb_unicode_funcs_create (nullptr); diff --git a/src/hb-icu.cc b/src/hb-icu.cc index 287f86340..ea44d657f 100644 --- a/src/hb-icu.cc +++ b/src/hb-icu.cc @@ -307,7 +307,7 @@ static void free_static_icu_funcs (void); static struct hb_icu_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_t { - static inline hb_unicode_funcs_t *create (void) + static hb_unicode_funcs_t *create (void) { void *user_data = nullptr; #if U_ICU_VERSION_MAJOR_NUM >= 49 diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 6fd6aed79..64260f842 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -65,28 +65,28 @@ struct Iter typedef T Value; /* Constructors. */ - inline Iter (T *array_, int length_) : + Iter (T *array_, int length_) : array (array_), length (MAX (length_, 0)) {} template explicit inline Iter (T (&array_)[length_]) : array (array_), length (length_) {} /* Emptiness. */ - explicit_operator inline operator bool (void) const { return bool (length); } + explicit_operator operator bool (void) const { return bool (length); } /* Current item. */ - inline T &operator * (void) + T &operator * (void) { if (unlikely (!length)) return CrapOrNull(T); return *array; } - inline T &operator -> (void) + T &operator -> (void) { return (operator *); } /* Next. */ - inline Iter & operator ++ (void) + Iter & operator ++ (void) { if (unlikely (!length)) return *this; array++; @@ -94,7 +94,7 @@ struct Iter return *this; } /* Might return void, or a copy of pre-increment iterator. */ - inline void operator ++ (int) + void operator ++ (int) { if (unlikely (!length)) return; array++; @@ -102,11 +102,11 @@ struct Iter } /* Some iterators might implement len(). */ - inline unsigned int len (void) const { return length; } + unsigned int len (void) const { return length; } /* Some iterators might implement fast-forward. * Only implement it if it's constant-time. */ - inline void operator += (unsigned int n) + void operator += (unsigned int n) { n = MIN (n, length); array += n; @@ -115,7 +115,7 @@ struct Iter /* Some iterators might implement random-access. * Only implement it if it's constant-time. */ - inline Iter & operator [] (unsigned int i) + Iter & operator [] (unsigned int i) { if (unlikely (i >= length)) return CrapOrNull(T); return array[i]; diff --git a/src/hb-kern.hh b/src/hb-kern.hh index aa01b470f..fd5bb9e45 100644 --- a/src/hb-kern.hh +++ b/src/hb-kern.hh @@ -44,10 +44,10 @@ struct hb_kern_machine_t crossStream (crossStream_) {} HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW - inline void kern (hb_font_t *font, - hb_buffer_t *buffer, - hb_mask_t kern_mask, - bool scale = true) const + void kern (hb_font_t *font, + hb_buffer_t *buffer, + hb_mask_t kern_mask, + bool scale = true) const { OT::hb_ot_apply_context_t c (1, font, buffer); c.set_lookup_mask (kern_mask); diff --git a/src/hb-machinery.hh b/src/hb-machinery.hh index 3af3a606a..2702eb4cb 100644 --- a/src/hb-machinery.hh +++ b/src/hb-machinery.hh @@ -81,14 +81,14 @@ static inline Type& StructAfter(TObject &X) /* Check _assertion in a method environment */ #define _DEFINE_INSTANCE_ASSERTION1(_line, _assertion) \ - inline void _instance_assertion_on_line_##_line (void) const \ + void _instance_assertion_on_line_##_line (void) const \ { static_assert ((_assertion), ""); } # define _DEFINE_INSTANCE_ASSERTION0(_line, _assertion) _DEFINE_INSTANCE_ASSERTION1 (_line, _assertion) # define DEFINE_INSTANCE_ASSERTION(_assertion) _DEFINE_INSTANCE_ASSERTION0 (__LINE__, _assertion) /* Check that _code compiles in a method environment */ #define _DEFINE_COMPILES_ASSERTION1(_line, _code) \ - inline void _compiles_assertion_on_line_##_line (void) const \ + void _compiles_assertion_on_line_##_line (void) const \ { _code; } # define _DEFINE_COMPILES_ASSERTION0(_line, _code) _DEFINE_COMPILES_ASSERTION1 (_line, _code) # define DEFINE_COMPILES_ASSERTION(_code) _DEFINE_COMPILES_ASSERTION0 (__LINE__, _code) @@ -96,7 +96,7 @@ static inline Type& StructAfter(TObject &X) #define DEFINE_SIZE_STATIC(size) \ DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size)) \ - inline unsigned int get_size (void) const { return (size); } \ + unsigned int get_size (void) const { return (size); } \ enum { null_size = (size) }; \ enum { min_size = (size) }; \ enum { static_size = (size) } @@ -123,7 +123,7 @@ static inline Type& StructAfter(TObject &X) enum { min_size = (size) } #define DEFINE_SIZE_ARRAY_SIZED(size, array) \ - inline unsigned int get_size (void) const { return (size - (array).min_size + (array).get_size ()); } \ + unsigned int get_size (void) const { return (size - (array).min_size + (array).get_size ()); } \ DEFINE_SIZE_ARRAY(size, array) @@ -137,7 +137,7 @@ struct hb_dispatch_context_t enum { max_debug_depth = MaxDebugDepth }; typedef Return return_t; template - inline bool may_dispatch (const T *obj HB_UNUSED, const F *format HB_UNUSED) { return true; } + bool may_dispatch (const T *obj HB_UNUSED, const F *format HB_UNUSED) { return true; } static return_t no_dispatch_return_value (void) { return Context::default_return_value (); } static bool stop_sublookup_iteration (const return_t r HB_UNUSED) { return false; } }; @@ -226,7 +226,7 @@ struct hb_dispatch_context_t struct hb_sanitize_context_t : hb_dispatch_context_t { - inline hb_sanitize_context_t (void) : + hb_sanitize_context_t (void) : debug_depth (0), start (nullptr), end (nullptr), max_ops (0), @@ -235,33 +235,33 @@ struct hb_sanitize_context_t : num_glyphs (65536), num_glyphs_set (false) {} - inline const char *get_name (void) { return "SANITIZE"; } + const char *get_name (void) { return "SANITIZE"; } template - inline bool may_dispatch (const T *obj HB_UNUSED, const F *format) + bool may_dispatch (const T *obj HB_UNUSED, const F *format) { return format->sanitize (this); } template - inline return_t dispatch (const T &obj) { return obj.sanitize (this); } + return_t dispatch (const T &obj) { return obj.sanitize (this); } static return_t default_return_value (void) { return true; } static return_t no_dispatch_return_value (void) { return false; } bool stop_sublookup_iteration (const return_t r) const { return !r; } - inline void init (hb_blob_t *b) + void init (hb_blob_t *b) { this->blob = hb_blob_reference (b); this->writable = false; } - inline void set_num_glyphs (unsigned int num_glyphs_) + void set_num_glyphs (unsigned int num_glyphs_) { num_glyphs = num_glyphs_; num_glyphs_set = true; } - inline unsigned int get_num_glyphs (void) { return num_glyphs; } + unsigned int get_num_glyphs (void) { return num_glyphs; } - inline void set_max_ops (int max_ops_) { max_ops = max_ops_; } + void set_max_ops (int max_ops_) { max_ops = max_ops_; } template - inline void set_object (const T *obj) + void set_object (const T *obj) { reset_object (); @@ -280,14 +280,14 @@ struct hb_sanitize_context_t : } } - inline void reset_object (void) + void reset_object (void) { this->start = this->blob->data; this->end = this->start + this->blob->length; assert (this->start <= this->end); /* Must not overflow. */ } - inline void start_processing (void) + void start_processing (void) { reset_object (); this->max_ops = MAX ((unsigned int) (this->end - this->start) * HB_SANITIZE_MAX_OPS_FACTOR, @@ -301,7 +301,7 @@ struct hb_sanitize_context_t : (unsigned long) (this->end - this->start)); } - inline void end_processing (void) + void end_processing (void) { DEBUG_MSG_LEVEL (SANITIZE, this->start, 0, -1, "end [%p..%p] %u edit requests", @@ -312,7 +312,7 @@ struct hb_sanitize_context_t : this->start = this->end = nullptr; } - inline bool check_range (const void *base, + bool check_range (const void *base, unsigned int len) const { const char *p = (const char *) base; @@ -331,7 +331,7 @@ struct hb_sanitize_context_t : } template - inline bool check_range (const T *base, + bool check_range (const T *base, unsigned int a, unsigned int b) const { @@ -340,7 +340,7 @@ struct hb_sanitize_context_t : } template - inline bool check_range (const T *base, + bool check_range (const T *base, unsigned int a, unsigned int b, unsigned int c) const @@ -350,14 +350,14 @@ struct hb_sanitize_context_t : } template - inline bool check_array (const T *base, + bool check_array (const T *base, unsigned int len) const { return this->check_range (base, len, T::static_size); } template - inline bool check_array (const T *base, + bool check_array (const T *base, unsigned int a, unsigned int b) const { @@ -365,12 +365,10 @@ struct hb_sanitize_context_t : } template - inline bool check_struct (const Type *obj) const - { - return likely (this->check_range (obj, obj->min_size)); - } + bool check_struct (const Type *obj) const + { return likely (this->check_range (obj, obj->min_size)); } - inline bool may_edit (const void *base, unsigned int len) + bool may_edit (const void *base, unsigned int len) { if (this->edit_count >= HB_SANITIZE_MAX_EDITS) return false; @@ -389,7 +387,7 @@ struct hb_sanitize_context_t : } template - inline bool try_set (const Type *obj, const ValueType &v) { + bool try_set (const Type *obj, const ValueType &v) { if (this->may_edit (obj, obj->static_size)) { const_cast (obj)->set (v); return true; @@ -398,7 +396,7 @@ struct hb_sanitize_context_t : } template - inline hb_blob_t *sanitize_blob (hb_blob_t *blob) + hb_blob_t *sanitize_blob (hb_blob_t *blob) { bool sane; @@ -465,7 +463,7 @@ struct hb_sanitize_context_t : } template - inline hb_blob_t *reference_table (const hb_face_t *face, hb_tag_t tableTag = Type::tableTag) + hb_blob_t *reference_table (const hb_face_t *face, hb_tag_t tableTag = Type::tableTag) { if (!num_glyphs_set) set_num_glyphs (hb_face_get_glyph_count (face)); @@ -486,15 +484,11 @@ struct hb_sanitize_context_t : struct hb_sanitize_with_object_t { template - inline hb_sanitize_with_object_t (hb_sanitize_context_t *c, + hb_sanitize_with_object_t (hb_sanitize_context_t *c, const T& obj) : c (c) - { - c->set_object (obj); - } - inline ~hb_sanitize_with_object_t (void) - { - c->reset_object (); - } + { c->set_object (obj); } + ~hb_sanitize_with_object_t (void) + { c->reset_object (); } private: hb_sanitize_context_t *c; @@ -507,25 +501,25 @@ struct hb_sanitize_with_object_t struct hb_serialize_context_t { - inline hb_serialize_context_t (void *start_, unsigned int size) + hb_serialize_context_t (void *start_, unsigned int size) { this->start = (char *) start_; this->end = this->start + size; reset (); } - inline void reset (void) + void reset (void) { this->ran_out_of_room = false; this->head = this->start; this->debug_depth = 0; } - inline bool err (bool e) { return this->ran_out_of_room = this->ran_out_of_room || e; } + bool err (bool e) { return this->ran_out_of_room = this->ran_out_of_room || e; } /* To be called around main operation. */ template - inline Type *start_serialize (void) + Type *start_serialize (void) { DEBUG_MSG_LEVEL (SERIALIZE, this->start, 0, +1, "start [%p..%p] (%lu bytes)", @@ -534,7 +528,7 @@ struct hb_serialize_context_t return start_embed (); } - inline void end_serialize (void) + void end_serialize (void) { DEBUG_MSG_LEVEL (SERIALIZE, this->start, 0, -1, "end [%p..%p] serialized %d bytes; %s", @@ -543,9 +537,9 @@ struct hb_serialize_context_t this->ran_out_of_room ? "RAN OUT OF ROOM" : "did not ran out of room"); } - inline unsigned int length (void) const { return this->head - this->start; } + unsigned int length (void) const { return this->head - this->start; } - inline void align (unsigned int alignment) + void align (unsigned int alignment) { unsigned int l = length () % alignment; if (l) @@ -553,14 +547,14 @@ struct hb_serialize_context_t } template - inline Type *start_embed (const Type *_ HB_UNUSED = nullptr) const + Type *start_embed (const Type *_ HB_UNUSED = nullptr) const { Type *ret = reinterpret_cast (this->head); return ret; } template - inline Type *allocate_size (unsigned int size) + Type *allocate_size (unsigned int size) { if (unlikely (this->ran_out_of_room || this->end - this->head < ptrdiff_t (size))) { this->ran_out_of_room = true; @@ -573,13 +567,13 @@ struct hb_serialize_context_t } template - inline Type *allocate_min (void) + Type *allocate_min (void) { return this->allocate_size (Type::min_size); } template - inline Type *embed (const Type &obj) + Type *embed (const Type &obj) { unsigned int size = obj.get_size (); Type *ret = this->allocate_size (size); @@ -589,7 +583,7 @@ struct hb_serialize_context_t } template - inline Type *extend_size (Type &obj, unsigned int size) + Type *extend_size (Type &obj, unsigned int size) { assert (this->start <= (char *) &obj); assert ((char *) &obj <= this->head); @@ -599,14 +593,14 @@ struct hb_serialize_context_t } template - inline Type *extend_min (Type &obj) { return extend_size (obj, obj.min_size); } + Type *extend_min (Type &obj) { return extend_size (obj, obj.min_size); } template - inline Type *extend (Type &obj) { return extend_size (obj, obj.get_size ()); } + Type *extend (Type &obj) { return extend_size (obj, obj.get_size ()); } /* Output routines. */ template - inline Type *copy (void) const + Type *copy (void) const { assert (!this->ran_out_of_room); unsigned int len = this->head - this->start; @@ -615,7 +609,7 @@ struct hb_serialize_context_t memcpy (p, this->start, len); return reinterpret_cast (p); } - inline hb_bytes_t copy_bytes (void) const + hb_bytes_t copy_bytes (void) const { assert (!this->ran_out_of_room); unsigned int len = this->head - this->start; @@ -626,7 +620,7 @@ struct hb_serialize_context_t return hb_bytes_t (); return hb_bytes_t (p, len); } - inline hb_blob_t *copy_blob (void) const + hb_blob_t *copy_blob (void) const { assert (!this->ran_out_of_room); return hb_blob_create (this->start, @@ -649,32 +643,32 @@ struct hb_serialize_context_t template struct Supplier { - inline Supplier (const Type *array, unsigned int len_, unsigned int stride_=sizeof (Type)) + Supplier (const Type *array, unsigned int len_, unsigned int stride_=sizeof (Type)) { head = array; len = len_; stride = stride_; } - inline Supplier (hb_array_t v) + Supplier (hb_array_t v) { head = v.arrayZ; len = v.len; stride = sizeof (Type); } - inline Supplier (const hb_vector_t &v) + Supplier (const hb_vector_t &v) { head = (const Type *) v; len = v.len; stride = sizeof (Type); } - inline const Type operator [] (unsigned int i) const + const Type operator [] (unsigned int i) const { if (unlikely (i >= len)) return Type (); return * (const Type *) (const void *) ((const char *) head + stride * i); } - inline Supplier & operator += (unsigned int count) + Supplier & operator += (unsigned int count) { if (unlikely (count > len)) count = len; @@ -684,8 +678,8 @@ struct Supplier } private: - inline Supplier (const Supplier &); /* Disallow copy */ - inline Supplier& operator= (const Supplier &); /* Disallow copy */ + Supplier (const Supplier &); /* Disallow copy */ + Supplier& operator= (const Supplier &); /* Disallow copy */ unsigned int len; unsigned int stride; @@ -704,14 +698,10 @@ struct BEInt { public: typedef Type type; - inline void set (Type V) - { - v = V; - } - inline operator Type (void) const - { - return v; - } + void set (Type V) + { v = V; } + operator Type (void) const + { return v; } private: uint8_t v; }; template @@ -719,12 +709,12 @@ struct BEInt { public: typedef Type type; - inline void set (Type V) + void set (Type V) { v[0] = (V >> 8) & 0xFF; v[1] = (V ) & 0xFF; } - inline operator Type (void) const + operator Type (void) const { #if (defined(__GNUC__) && __GNUC__ >= 5) || defined(__clang__) /* Spoon-feed the compiler a big-endian integer with alignment 1. @@ -742,13 +732,13 @@ struct BEInt { public: typedef Type type; - inline void set (Type V) + void set (Type V) { v[0] = (V >> 16) & 0xFF; v[1] = (V >> 8) & 0xFF; v[2] = (V ) & 0xFF; } - inline operator Type (void) const + operator Type (void) const { return (v[0] << 16) + (v[1] << 8) @@ -761,14 +751,14 @@ struct BEInt { public: typedef Type type; - inline void set (Type V) + void set (Type V) { v[0] = (V >> 24) & 0xFF; v[1] = (V >> 16) & 0xFF; v[2] = (V >> 8) & 0xFF; v[3] = (V ) & 0xFF; } - inline operator Type (void) const + operator Type (void) const { return (v[0] << 24) + (v[1] << 16) @@ -788,23 +778,23 @@ struct hb_data_wrapper_t { static_assert (WheresData > 0, ""); - inline Data * get_data (void) const + Data * get_data (void) const { return *(((Data **) (void *) this) - WheresData); } - inline bool is_inert (void) const { return !get_data (); } + bool is_inert (void) const { return !get_data (); } template - inline Stored * call_create (void) const { return Subclass::create (get_data ()); } + Stored * call_create (void) const { return Subclass::create (get_data ()); } }; template <> struct hb_data_wrapper_t { - inline bool is_inert (void) const { return false; } + bool is_inert (void) const { return false; } template - inline Stored * call_create (void) const { return Funcs::create (); } + Stored * call_create (void) const { return Funcs::create (); } }; template struct hb_non_void_t { typedef T1 value; }; @@ -821,13 +811,13 @@ struct hb_lazy_loader_t : hb_data_wrapper_t hb_lazy_loader_t >::value Funcs; - inline void init0 (void) {} /* Init, when memory is already set to 0. No-op for us. */ - inline void init (void) { instance.set_relaxed (nullptr); } - inline void fini (void) + void init0 (void) {} /* Init, when memory is already set to 0. No-op for us. */ + void init (void) { instance.set_relaxed (nullptr); } + void fini (void) { do_destroy (instance.get ()); } - inline void free_instance (void) + void free_instance (void) { retry: Stored *p = instance.get (); @@ -836,19 +826,19 @@ struct hb_lazy_loader_t : hb_data_wrapper_t do_destroy (p); } - static inline void do_destroy (Stored *p) + static void do_destroy (Stored *p) { if (p && p != const_cast (Funcs::get_null ())) Funcs::destroy (p); } - inline const Returned * operator -> (void) const { return get (); } - inline const Returned & operator * (void) const { return *get (); } - explicit_operator inline operator bool (void) const + const Returned * operator -> (void) const { return get (); } + const Returned & operator * (void) const { return *get (); } + explicit_operator operator bool (void) const { return get_stored () != Funcs::get_null (); } - template inline operator const C * (void) const { return get (); } + template operator const C * (void) const { return get (); } - inline Stored * get_stored (void) const + Stored * get_stored (void) const { retry: Stored *p = this->instance.get (); @@ -869,41 +859,41 @@ struct hb_lazy_loader_t : hb_data_wrapper_t } return p; } - inline Stored * get_stored_relaxed (void) const + Stored * get_stored_relaxed (void) const { return this->instance.get_relaxed (); } - inline bool cmpexch (Stored *current, Stored *value) const + bool cmpexch (Stored *current, Stored *value) const { /* This *must* be called when there are no other threads accessing. */ return this->instance.cmpexch (current, value); } - inline const Returned * get (void) const { return Funcs::convert (get_stored ()); } - inline const Returned * get_relaxed (void) const { return Funcs::convert (get_stored_relaxed ()); } - inline Returned * get_unconst (void) const { return const_cast (Funcs::convert (get_stored ())); } + const Returned * get (void) const { return Funcs::convert (get_stored ()); } + const Returned * get_relaxed (void) const { return Funcs::convert (get_stored_relaxed ()); } + Returned * get_unconst (void) const { return const_cast (Funcs::convert (get_stored ())); } /* To be possibly overloaded by subclasses. */ - static inline Returned* convert (Stored *p) { return p; } + static Returned* convert (Stored *p) { return p; } /* By default null/init/fini the object. */ - static inline const Stored* get_null (void) { return &Null(Stored); } - static inline Stored *create (Data *data) + static const Stored* get_null (void) { return &Null(Stored); } + static Stored *create (Data *data) { Stored *p = (Stored *) calloc (1, sizeof (Stored)); if (likely (p)) p->init (data); return p; } - static inline Stored *create (void) + static Stored *create (void) { Stored *p = (Stored *) calloc (1, sizeof (Stored)); if (likely (p)) p->init (); return p; } - static inline void destroy (Stored *p) + static void destroy (Stored *p) { p->fini (); free (p); @@ -927,24 +917,24 @@ struct hb_table_lazy_loader_t : hb_lazy_loader_t { - static inline hb_blob_t *create (hb_face_t *face) + static hb_blob_t *create (hb_face_t *face) { return hb_sanitize_context_t ().reference_table (face); } - static inline void destroy (hb_blob_t *p) + static void destroy (hb_blob_t *p) { hb_blob_destroy (p); } - static inline const hb_blob_t *get_null (void) + static const hb_blob_t *get_null (void) { return hb_blob_get_empty (); } - static inline const T* convert (const hb_blob_t *blob) + static const T* convert (const hb_blob_t *blob) { return blob->as (); } - inline hb_blob_t* get_blob (void) const + hb_blob_t* get_blob (void) const { return this->get_stored (); } @@ -953,11 +943,11 @@ struct hb_table_lazy_loader_t : hb_lazy_loader_t struct hb_font_funcs_lazy_loader_t : hb_lazy_loader_t { - static inline void destroy (hb_font_funcs_t *p) + static void destroy (hb_font_funcs_t *p) { hb_font_funcs_destroy (p); } - static inline const hb_font_funcs_t *get_null (void) + static const hb_font_funcs_t *get_null (void) { return hb_font_funcs_get_empty (); } @@ -965,11 +955,11 @@ struct hb_font_funcs_lazy_loader_t : hb_lazy_loader_t template struct hb_unicode_funcs_lazy_loader_t : hb_lazy_loader_t { - static inline void destroy (hb_unicode_funcs_t *p) + static void destroy (hb_unicode_funcs_t *p) { hb_unicode_funcs_destroy (p); } - static inline const hb_unicode_funcs_t *get_null (void) + static const hb_unicode_funcs_t *get_null (void) { return hb_unicode_funcs_get_empty (); } diff --git a/src/hb-map.hh b/src/hb-map.hh index 520c4795b..9415a3051 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -45,16 +45,16 @@ inline uint32_t Hash (const T &v) struct hb_map_t { HB_NO_COPY_ASSIGN (hb_map_t); - inline hb_map_t (void) { init (); } - inline ~hb_map_t (void) { fini (); } + hb_map_t (void) { init (); } + ~hb_map_t (void) { fini (); } struct item_t { hb_codepoint_t key; hb_codepoint_t value; - inline bool is_unused (void) const { return key == INVALID; } - inline bool is_tombstone (void) const { return key != INVALID && value == INVALID; } + bool is_unused (void) const { return key == INVALID; } + bool is_tombstone (void) const { return key != INVALID && value == INVALID; } }; hb_object_header_t header; @@ -65,7 +65,7 @@ struct hb_map_t unsigned int prime; item_t *items; - inline void init_shallow (void) + void init_shallow (void) { successful = true; population = occupancy = 0; @@ -73,24 +73,24 @@ struct hb_map_t prime = 0; items = nullptr; } - inline void init (void) + void init (void) { hb_object_init (this); init_shallow (); } - inline void fini_shallow (void) + void fini_shallow (void) { free (items); items = nullptr; } - inline void fini (void) + void fini (void) { population = occupancy = 0; hb_object_fini (this); fini_shallow (); } - inline bool resize (void) + bool resize (void) { if (unlikely (!successful)) return false; @@ -124,7 +124,7 @@ struct hb_map_t return true; } - inline void set (hb_codepoint_t key, hb_codepoint_t value) + void set (hb_codepoint_t key, hb_codepoint_t value) { if (unlikely (!successful)) return; if (unlikely (key == INVALID)) return; @@ -149,36 +149,36 @@ struct hb_map_t population++; } - inline hb_codepoint_t get (hb_codepoint_t key) const + hb_codepoint_t get (hb_codepoint_t key) const { if (unlikely (!items)) return INVALID; unsigned int i = bucket_for (key); return items[i].key == key ? items[i].value : INVALID; } - inline void del (hb_codepoint_t key) { set (key, INVALID); } + void del (hb_codepoint_t key) { set (key, INVALID); } - inline bool has (hb_codepoint_t key) const + bool has (hb_codepoint_t key) const { return get (key) != INVALID; } - inline hb_codepoint_t operator [] (unsigned int key) const + hb_codepoint_t operator [] (unsigned int key) const { return get (key); } enum { INVALID = HB_MAP_VALUE_INVALID }; - inline void clear (void) + void clear (void) { memset (items, 0xFF, ((size_t) mask + 1) * sizeof (item_t)); population = occupancy = 0; } - inline bool is_empty (void) const { return population == 0; } + bool is_empty (void) const { return population == 0; } - inline unsigned int get_population (void) const { return population; } + unsigned int get_population (void) const { return population; } protected: - inline unsigned int bucket_for (hb_codepoint_t key) const + unsigned int bucket_for (hb_codepoint_t key) const { unsigned int i = Hash (key) % prime; unsigned int step = 0; @@ -194,7 +194,7 @@ struct hb_map_t return tombstone == INVALID ? i : tombstone; } - static inline unsigned int prime_for (unsigned int shift) + static unsigned int prime_for (unsigned int shift) { /* Following comment and table copied from glib. */ /* Each table size has an associated prime modulo (the first prime diff --git a/src/hb-mutex.hh b/src/hb-mutex.hh index b529091d4..45ef6766e 100644 --- a/src/hb-mutex.hh +++ b/src/hb-mutex.hh @@ -131,16 +131,16 @@ struct hb_mutex_t hb_mutex_impl_t m; - inline void init (void) { hb_mutex_impl_init (&m); } - inline void lock (void) { hb_mutex_impl_lock (&m); } - inline void unlock (void) { hb_mutex_impl_unlock (&m); } - inline void fini (void) { hb_mutex_impl_finish (&m); } + void init (void) { hb_mutex_impl_init (&m); } + void lock (void) { hb_mutex_impl_lock (&m); } + void unlock (void) { hb_mutex_impl_unlock (&m); } + void fini (void) { hb_mutex_impl_finish (&m); } }; struct hb_lock_t { - inline hb_lock_t (hb_mutex_t &mutex_) : mutex (mutex_) { mutex.lock (); } - inline ~hb_lock_t (void) { mutex.unlock (); } + hb_lock_t (hb_mutex_t &mutex_) : mutex (mutex_) { mutex.lock (); } + ~hb_lock_t (void) { mutex.unlock (); } private: hb_mutex_t &mutex; }; diff --git a/src/hb-null.hh b/src/hb-null.hh index 6a868685e..f7b3f7c27 100644 --- a/src/hb-null.hh +++ b/src/hb-null.hh @@ -91,7 +91,7 @@ template struct NullHelper { typedef typename hb_remove_const (typename hb_remove_reference (QType)) Type; - static inline const Type & get_null (void) { return Null (); } + static const Type & get_null (void) { return Null (); } }; #define Null(Type) NullHelper::get_null () @@ -140,17 +140,17 @@ template struct CrapHelper { typedef typename hb_remove_const (typename hb_remove_reference (QType)) Type; - static inline Type & get_crap (void) { return Crap (); } + static Type & get_crap (void) { return Crap (); } }; #define Crap(Type) CrapHelper::get_crap () template struct CrapOrNullHelper { - static inline Type & get (void) { return Crap(Type); } + static Type & get (void) { return Crap(Type); } }; template struct CrapOrNullHelper { - static inline const Type & get (void) { return Null(Type); } + static const Type & get (void) { return Null(Type); } }; #define CrapOrNull(Type) CrapOrNullHelper::get () @@ -164,16 +164,16 @@ struct hb_nonnull_ptr_t { typedef typename hb_remove_pointer (P) T; - inline hb_nonnull_ptr_t (T *v_ = nullptr) : v (v_) {} - inline T * operator = (T *v_) { return v = v_; } - inline T * operator -> (void) const { return get (); } - inline T & operator * (void) const { return *get (); } - inline T ** operator & (void) const { return &v; } + hb_nonnull_ptr_t (T *v_ = nullptr) : v (v_) {} + T * operator = (T *v_) { return v = v_; } + T * operator -> (void) const { return get (); } + T & operator * (void) const { return *get (); } + T ** operator & (void) const { return &v; } /* Only auto-cast to const types. */ - template inline operator const C * (void) const { return get (); } - inline operator const char * (void) const { return (const char *) get (); } - inline T * get (void) const { return v ? v : const_cast (&Null(T)); } - inline T * get_raw (void) const { return v; } + template operator const C * (void) const { return get (); } + operator const char * (void) const { return (const char *) get (); } + T * get (void) const { return v ? v : const_cast (&Null(T)); } + T * get_raw (void) const { return v; } T *v; }; diff --git a/src/hb-object.hh b/src/hb-object.hh index cdacf49f4..96d686f0e 100644 --- a/src/hb-object.hh +++ b/src/hb-object.hh @@ -47,10 +47,10 @@ struct hb_lockable_set_t { hb_vector_t items; - inline void init (void) { items.init (); } + void init (void) { items.init (); } template - inline item_t *replace_or_insert (T v, lock_t &l, bool replace) + item_t *replace_or_insert (T v, lock_t &l, bool replace) { l.lock (); item_t *item = items.find (v); @@ -73,7 +73,7 @@ struct hb_lockable_set_t } template - inline void remove (T v, lock_t &l) + void remove (T v, lock_t &l) { l.lock (); item_t *item = items.find (v); @@ -89,7 +89,7 @@ struct hb_lockable_set_t } template - inline bool find (T v, item_t *i, lock_t &l) + bool find (T v, item_t *i, lock_t &l) { l.lock (); item_t *item = items.find (v); @@ -100,7 +100,7 @@ struct hb_lockable_set_t } template - inline item_t *find_or_insert (T v, lock_t &l) + item_t *find_or_insert (T v, lock_t &l) { l.lock (); item_t *item = items.find (v); @@ -111,7 +111,7 @@ struct hb_lockable_set_t return item; } - inline void fini (lock_t &l) + void fini (lock_t &l) { if (!items.len) { /* No need for locking. */ @@ -145,14 +145,14 @@ struct hb_reference_count_t { mutable hb_atomic_int_t ref_count; - inline void init (int v = 1) { ref_count.set_relaxed (v); } - inline int get_relaxed (void) const { return ref_count.get_relaxed (); } - inline int inc (void) const { return ref_count.inc (); } - inline int dec (void) const { return ref_count.dec (); } - inline void fini (void) { ref_count.set_relaxed (HB_REFERENCE_COUNT_POISON_VALUE); } + void init (int v = 1) { ref_count.set_relaxed (v); } + int get_relaxed (void) const { return ref_count.get_relaxed (); } + int inc (void) const { return ref_count.inc (); } + int dec (void) const { return ref_count.dec (); } + void fini (void) { ref_count.set_relaxed (HB_REFERENCE_COUNT_POISON_VALUE); } - inline bool is_inert (void) const { return ref_count.get_relaxed () == HB_REFERENCE_COUNT_INERT_VALUE; } - inline bool is_valid (void) const { return ref_count.get_relaxed () > 0; } + bool is_inert (void) const { return ref_count.get_relaxed () == HB_REFERENCE_COUNT_INERT_VALUE; } + bool is_valid (void) const { return ref_count.get_relaxed () > 0; } }; @@ -165,8 +165,8 @@ struct hb_user_data_array_t void *data; hb_destroy_func_t destroy; - inline bool operator == (hb_user_data_key_t *other_key) const { return key == other_key; } - inline bool operator == (hb_user_data_item_t &other) const { return key == other.key; } + bool operator == (hb_user_data_key_t *other_key) const { return key == other_key; } + bool operator == (hb_user_data_item_t &other) const { return key == other.key; } void fini (void) { if (destroy) destroy (data); } }; @@ -174,7 +174,7 @@ struct hb_user_data_array_t hb_mutex_t lock; hb_lockable_set_t items; - inline void init (void) { lock.init (); items.init (); } + void init (void) { lock.init (); items.init (); } HB_INTERNAL bool set (hb_user_data_key_t *key, void * data, @@ -183,7 +183,7 @@ struct hb_user_data_array_t HB_INTERNAL void *get (hb_user_data_key_t *key); - inline void fini (void) { items.fini (lock); lock.fini (); } + void fini (void) { items.fini (lock); lock.fini (); } }; diff --git a/src/hb-open-file.hh b/src/hb-open-file.hh index af68892ab..6963b085a 100644 --- a/src/hb-open-file.hh +++ b/src/hb-open-file.hh @@ -64,7 +64,7 @@ typedef struct TableRecord return b->cmp (a->tag); } - 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)); @@ -83,13 +83,13 @@ typedef struct OffsetTable { friend struct OpenTypeFontFile; - inline unsigned int get_table_count (void) const + unsigned int get_table_count (void) const { return tables.len; } - inline const TableRecord& get_table (unsigned int i) const + const TableRecord& get_table (unsigned int i) const { return tables[i]; } - inline unsigned int get_table_tags (unsigned int start_offset, + unsigned int get_table_tags (unsigned int start_offset, unsigned int *table_count, /* IN/OUT */ hb_tag_t *table_tags /* OUT */) const { @@ -107,13 +107,13 @@ typedef struct OffsetTable } return tables.len; } - inline bool find_table_index (hb_tag_t tag, unsigned int *table_index) const + bool find_table_index (hb_tag_t tag, unsigned int *table_index) const { Tag t; t.set (tag); return tables.bfind (t, table_index, HB_BFIND_NOT_FOUND_STORE, Index::NOT_FOUND_INDEX); } - inline const TableRecord& get_table_by_tag (hb_tag_t tag) const + const TableRecord& get_table_by_tag (hb_tag_t tag) const { unsigned int table_index; find_table_index (tag, &table_index); @@ -122,11 +122,11 @@ typedef struct OffsetTable public: - inline bool serialize (hb_serialize_context_t *c, - hb_tag_t sfnt_tag, - Supplier &tags, - Supplier &blobs, - unsigned int table_count) + bool serialize (hb_serialize_context_t *c, + hb_tag_t sfnt_tag, + Supplier &tags, + Supplier &blobs, + unsigned int table_count) { TRACE_SERIALIZE (this); /* Alloc 12 for the OTHeader. */ @@ -192,7 +192,7 @@ typedef struct OffsetTable return_trace (true); } - 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) && tables.sanitize (c)); @@ -215,10 +215,10 @@ struct TTCHeaderVersion1 { friend struct TTCHeader; - inline unsigned int get_face_count (void) const { return table.len; } - inline const OpenTypeFontFace& get_face (unsigned int i) const { return this+table[i]; } + unsigned int get_face_count (void) const { return table.len; } + const OpenTypeFontFace& get_face (unsigned int i) const { return this+table[i]; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (table.sanitize (c, this)); @@ -241,7 +241,7 @@ struct TTCHeader private: - inline unsigned int get_face_count (void) const + unsigned int get_face_count (void) const { switch (u.header.version.major) { case 2: /* version 2 is compatible with version 1 */ @@ -249,7 +249,7 @@ struct TTCHeader default:return 0; } } - inline const OpenTypeFontFace& get_face (unsigned int i) const + const OpenTypeFontFace& get_face (unsigned int i) const { switch (u.header.version.major) { case 2: /* version 2 is compatible with version 1 */ @@ -258,7 +258,7 @@ struct TTCHeader } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!u.header.version.sanitize (c))) return_trace (false); @@ -288,10 +288,10 @@ struct TTCHeader struct ResourceRecord { - inline const OpenTypeFontFace & get_face (const void *data_base) const + const OpenTypeFontFace & get_face (const void *data_base) const { return CastR ((data_base+offset).arrayZ); } - inline bool sanitize (hb_sanitize_context_t *c, + bool sanitize (hb_sanitize_context_t *c, const void *data_base) const { TRACE_SANITIZE (this); @@ -317,20 +317,20 @@ struct ResourceRecord struct ResourceTypeRecord { - inline unsigned int get_resource_count (void) const + unsigned int get_resource_count (void) const { return tag == HB_TAG_sfnt ? resCountM1 + 1 : 0; } - inline bool is_sfnt (void) const { return tag == HB_TAG_sfnt; } + bool is_sfnt (void) const { return tag == HB_TAG_sfnt; } - inline const ResourceRecord& get_resource_record (unsigned int i, - const void *type_base) const + const ResourceRecord& get_resource_record (unsigned int i, + const void *type_base) const { return (type_base+resourcesZ).as_array (get_resource_count ())[i]; } - inline bool sanitize (hb_sanitize_context_t *c, - const void *type_base, - const void *data_base) const + bool sanitize (hb_sanitize_context_t *c, + const void *type_base, + const void *data_base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -351,7 +351,7 @@ struct ResourceTypeRecord struct ResourceMap { - inline unsigned int get_face_count (void) const + unsigned int get_face_count (void) const { unsigned int count = get_type_count (); for (unsigned int i = 0; i < count; i++) @@ -363,8 +363,8 @@ struct ResourceMap return 0; } - inline const OpenTypeFontFace& get_face (unsigned int idx, - const void *data_base) const + const OpenTypeFontFace& get_face (unsigned int idx, + const void *data_base) const { unsigned int count = get_type_count (); for (unsigned int i = 0; i < count; i++) @@ -378,7 +378,7 @@ struct ResourceMap return Null (OpenTypeFontFace); } - inline bool sanitize (hb_sanitize_context_t *c, const void *data_base) const + bool sanitize (hb_sanitize_context_t *c, const void *data_base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -388,9 +388,9 @@ struct ResourceMap } private: - inline unsigned int get_type_count (void) const { return (this+typeList).lenM1 + 1; } + unsigned int get_type_count (void) const { return (this+typeList).lenM1 + 1; } - inline const ResourceTypeRecord& get_type_record (unsigned int i) const + const ResourceTypeRecord& get_type_record (unsigned int i) const { return (this+typeList)[i]; } protected: @@ -409,11 +409,11 @@ struct ResourceMap struct ResourceForkHeader { - inline unsigned int get_face_count (void) const + unsigned int get_face_count (void) const { return (this+map).get_face_count (); } - inline const OpenTypeFontFace& get_face (unsigned int idx, - unsigned int *base_offset = nullptr) const + const OpenTypeFontFace& get_face (unsigned int idx, + unsigned int *base_offset = nullptr) const { const OpenTypeFontFace &face = (this+map).get_face (idx, &(this+data)); if (base_offset) @@ -421,7 +421,7 @@ struct ResourceForkHeader return face; } - 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) && @@ -457,9 +457,9 @@ struct OpenTypeFontFile Typ1Tag = HB_TAG ('t','y','p','1') /* Obsolete Apple Type1 font in SFNT container */ }; - inline hb_tag_t get_tag (void) const { return u.tag; } + hb_tag_t get_tag (void) const { return u.tag; } - inline unsigned int get_face_count (void) const + unsigned int get_face_count (void) const { switch (u.tag) { case CFFTag: /* All the non-collection tags */ @@ -471,7 +471,7 @@ struct OpenTypeFontFile default: return 0; } } - inline const OpenTypeFontFace& get_face (unsigned int i, unsigned int *base_offset = nullptr) const + const OpenTypeFontFace& get_face (unsigned int i, unsigned int *base_offset = nullptr) const { if (base_offset) *base_offset = 0; @@ -489,11 +489,11 @@ struct OpenTypeFontFile } } - inline bool serialize_single (hb_serialize_context_t *c, - hb_tag_t sfnt_tag, - Supplier &tags, - Supplier &blobs, - unsigned int table_count) + bool serialize_single (hb_serialize_context_t *c, + hb_tag_t sfnt_tag, + Supplier &tags, + Supplier &blobs, + unsigned int table_count) { TRACE_SERIALIZE (this); assert (sfnt_tag != TTCTag); @@ -501,7 +501,7 @@ struct OpenTypeFontFile return_trace (u.fontFace.serialize (c, sfnt_tag, tags, blobs, table_count)); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!u.tag.sanitize (c))) return_trace (false); diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 302ba9fbf..e4f4eb9a9 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -63,13 +63,13 @@ struct IntType typedef Type type; typedef typename hb_signedness_int::value>::value wide_type; - inline void set (wide_type i) { v.set (i); } - inline operator wide_type (void) const { return v; } - inline bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; } - inline bool operator != (const IntType &o) const { return !(*this == o); } - static inline int cmp (const IntType *a, const IntType *b) { return b->cmp (*a); } + void set (wide_type i) { v.set (i); } + operator wide_type (void) const { return v; } + bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; } + bool operator != (const IntType &o) const { return !(*this == o); } + static int cmp (const IntType *a, const IntType *b) { return b->cmp (*a); } template - inline int cmp (Type2 a) const + int cmp (Type2 a) const { Type b = v; if (sizeof (Type) < sizeof (int) && sizeof (Type2) < sizeof (int)) @@ -77,7 +77,7 @@ struct IntType else return a < b ? -1 : a == b ? 0 : +1; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -111,8 +111,8 @@ typedef HBUINT16 UFWORD; struct F2DOT14 : HBINT16 { // 16384 means 1<<14 - inline float to_float (void) const { return ((int32_t) v) / 16384.f; } - inline void set_float (float f) { v.set (round (f * 16384.f)); } + float to_float (void) const { return ((int32_t) v) / 16384.f; } + void set_float (float f) { v.set (round (f * 16384.f)); } public: DEFINE_SIZE_STATIC (2); }; @@ -121,8 +121,8 @@ struct F2DOT14 : HBINT16 struct Fixed : HBINT32 { // 65536 means 1<<16 - inline float to_float (void) const { return ((int32_t) v) / 65536.f; } - inline void set_float (float f) { v.set (round (f * 65536.f)); } + float to_float (void) const { return ((int32_t) v) / 65536.f; } + void set_float (float f) { v.set (round (f * 65536.f)); } public: DEFINE_SIZE_STATIC (4); }; @@ -131,7 +131,7 @@ struct Fixed : HBINT32 * 1904. The value is represented as a signed 64-bit integer. */ struct LONGDATETIME { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -148,8 +148,8 @@ struct LONGDATETIME struct Tag : HBUINT32 { /* What the char* converters return is NOT nul-terminated. Print using "%.4s" */ - inline operator const char* (void) const { return reinterpret_cast (&this->v); } - inline operator char* (void) { return reinterpret_cast (&this->v); } + operator const char* (void) const { return reinterpret_cast (&this->v); } + operator char* (void) { return reinterpret_cast (&this->v); } public: DEFINE_SIZE_STATIC (4); }; @@ -171,9 +171,9 @@ struct Offset : Type { typedef Type type; - inline bool is_null (void) const { return has_null && 0 == *this; } + bool is_null (void) const { return has_null && 0 == *this; } - inline void *serialize (hb_serialize_context_t *c, const void *base) + void *serialize (hb_serialize_context_t *c, const void *base) { void *t = c->start_embed (); this->set ((char *) t - (char *) base); /* TODO(serialize) Overflow? */ @@ -192,7 +192,7 @@ typedef Offset Offset32; struct CheckSum : HBUINT32 { /* This is reference implementation from the spec. */ - static inline uint32_t CalcTableChecksum (const HBUINT32 *Table, uint32_t Length) + static uint32_t CalcTableChecksum (const HBUINT32 *Table, uint32_t Length) { uint32_t Sum = 0L; assert (0 == (Length & 3)); @@ -204,7 +204,7 @@ struct CheckSum : HBUINT32 } /* Note: data should be 4byte aligned and have 4byte padding at the end. */ - inline void set_for_data (const void *data, unsigned int length) + void set_for_data (const void *data, unsigned int length) { set (CalcTableChecksum ((const HBUINT32 *) data, length)); } public: @@ -219,9 +219,9 @@ struct CheckSum : HBUINT32 template struct FixedVersion { - inline uint32_t to_int (void) const { return (major << (sizeof (FixedType) * 8)) + minor; } + uint32_t to_int (void) const { return (major << (sizeof (FixedType) * 8)) + minor; } - 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)); @@ -242,37 +242,37 @@ struct FixedVersion template struct _hb_has_null { - static inline const Type *get_null (void) { return nullptr; } - static inline Type *get_crap (void) { return nullptr; } + static const Type *get_null (void) { return nullptr; } + static Type *get_crap (void) { return nullptr; } }; template struct _hb_has_null { - static inline const Type *get_null (void) { return &Null(Type); } - static inline Type *get_crap (void) { return &Crap(Type); } + static const Type *get_null (void) { return &Null(Type); } + static Type *get_crap (void) { return &Crap(Type); } }; template struct OffsetTo : Offset { - inline const Type& operator () (const void *base) const + const Type& operator () (const void *base) const { if (unlikely (this->is_null ())) return *_hb_has_null::get_null (); return StructAtOffset (base, *this); } - inline Type& operator () (void *base) const + Type& operator () (void *base) const { if (unlikely (this->is_null ())) return *_hb_has_null::get_crap (); return StructAtOffset (base, *this); } - inline Type& serialize (hb_serialize_context_t *c, const void *base) + Type& serialize (hb_serialize_context_t *c, const void *base) { return * (Type *) Offset::serialize (c, base); } template - inline void serialize_subset (hb_subset_context_t *c, const T &src, const void *base) + void serialize_subset (hb_subset_context_t *c, const T &src, const void *base) { if (&src == &Null (T)) { @@ -284,7 +284,7 @@ struct OffsetTo : Offset this->set (0); } - inline bool sanitize_shallow (hb_sanitize_context_t *c, const void *base) const + bool sanitize_shallow (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) return_trace (false); @@ -293,7 +293,7 @@ struct OffsetTo : Offset return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && @@ -302,7 +302,7 @@ struct OffsetTo : Offset neuter (c))); } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1) const + bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1) const { TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && @@ -311,7 +311,7 @@ struct OffsetTo : Offset neuter (c))); } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1, T2 d2) const + bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1, T2 d2) const { TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && @@ -320,7 +320,7 @@ struct OffsetTo : Offset neuter (c))); } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1, T2 d2, T3 d3) const + bool sanitize (hb_sanitize_context_t *c, const void *base, T1 d1, T2 d2, T3 d3) const { TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && @@ -330,7 +330,7 @@ struct OffsetTo : Offset } /* Set the offset to Null */ - inline bool neuter (hb_sanitize_context_t *c) const + bool neuter (hb_sanitize_context_t *c) const { if (!has_null) return false; return c->try_set (this, 0); @@ -358,14 +358,14 @@ struct UnsizedArrayOf HB_NO_CREATE_COPY_ASSIGN_TEMPLATE (UnsizedArrayOf, Type); - inline const Type& operator [] (int i_) const + const Type& operator [] (int i_) const { unsigned int i = (unsigned int) i_; const Type *p = &arrayZ[i]; if (unlikely (p < arrayZ)) return Null (Type); /* Overflowed. */ return *p; } - inline Type& operator [] (int i_) + Type& operator [] (int i_) { unsigned int i = (unsigned int) i_; Type *p = &arrayZ[i]; @@ -373,29 +373,29 @@ struct UnsizedArrayOf return *p; } - inline unsigned int get_size (unsigned int len) const + unsigned int get_size (unsigned int len) const { return len * Type::static_size; } - template inline operator T * (void) { return arrayZ; } - template inline operator const T * (void) const { return arrayZ; } - inline hb_array_t as_array (unsigned int len) + template operator T * (void) { return arrayZ; } + template operator const T * (void) const { return arrayZ; } + hb_array_t as_array (unsigned int len) { return hb_array (arrayZ, len); } - inline hb_array_t as_array (unsigned int len) const + hb_array_t as_array (unsigned int len) const { return hb_array (arrayZ, len); } - inline operator hb_array_t (void) { return as_array (); } - inline operator hb_array_t (void) const { as_array (); } + operator hb_array_t (void) { return as_array (); } + operator hb_array_t (void) const { as_array (); } template - inline Type &lsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type)) + Type &lsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type)) { return *as_array (len).lsearch (x, ¬_found); } template - inline const Type &lsearch (unsigned int len, const T &x, const Type ¬_found = Null (Type)) const + const Type &lsearch (unsigned int len, const T &x, const Type ¬_found = Null (Type)) const { return *as_array (len).lsearch (x, ¬_found); } - inline void qsort (unsigned int len, unsigned int start = 0, unsigned int end = (unsigned int) -1) + void qsort (unsigned int len, unsigned int start = 0, unsigned int end = (unsigned int) -1) { as_array (len).qsort (start, end); } - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c, count))) return_trace (false); @@ -411,7 +411,7 @@ struct UnsizedArrayOf return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count, const void *base) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count, const void *base) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c, count))) return_trace (false); @@ -421,7 +421,7 @@ struct UnsizedArrayOf return_trace (true); } template - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count, const void *base, T user_data) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count, const void *base, T user_data) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c, count))) return_trace (false); @@ -431,7 +431,7 @@ struct UnsizedArrayOf return_trace (true); } - inline bool sanitize_shallow (hb_sanitize_context_t *c, unsigned int count) const + bool sanitize_shallow (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); return_trace (c->check_array (arrayZ, count)); @@ -451,14 +451,14 @@ struct UnsizedOffsetArrayOf : UnsizedArrayOf struct UnsizedOffsetListOf : UnsizedOffsetArrayOf { - inline const Type& operator [] (int i_) const + const Type& operator [] (int i_) const { unsigned int i = (unsigned int) i_; const OffsetTo *p = &this->arrayZ[i]; if (unlikely (p < this->arrayZ)) return Null (Type); /* Overflowed. */ return this+*p; } - inline Type& operator [] (int i_) + Type& operator [] (int i_) { unsigned int i = (unsigned int) i_; const OffsetTo *p = &this->arrayZ[i]; @@ -467,13 +467,13 @@ struct UnsizedOffsetListOf : UnsizedOffsetArrayOf } - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); return_trace ((UnsizedOffsetArrayOf::sanitize (c, count, this))); } template - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count, T user_data) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count, T user_data) const { TRACE_SANITIZE (this); return_trace ((UnsizedOffsetArrayOf::sanitize (c, count, this, user_data))); @@ -484,21 +484,21 @@ struct UnsizedOffsetListOf : UnsizedOffsetArrayOf template struct SortedUnsizedArrayOf : UnsizedArrayOf { - inline hb_sorted_array_t as_array (unsigned int len) + hb_sorted_array_t as_array (unsigned int len) { return hb_sorted_array (this->arrayZ, len); } - inline hb_sorted_array_t as_array (unsigned int len) const + hb_sorted_array_t as_array (unsigned int len) const { return hb_sorted_array (this->arrayZ, len); } - inline operator hb_sorted_array_t (void) { return as_array (); } - inline operator hb_sorted_array_t (void) const { as_array (); } + operator hb_sorted_array_t (void) { return as_array (); } + operator hb_sorted_array_t (void) const { as_array (); } template - inline Type &bsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type)) + Type &bsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type)) { return *as_array (len).bsearch (x, ¬_found); } template - inline const Type &bsearch (unsigned int len, const T &x, const Type ¬_found = Null (Type)) const + const Type &bsearch (unsigned int len, const T &x, const Type ¬_found = Null (Type)) const { return *as_array (len).bsearch (x, ¬_found); } template - inline bool bfind (unsigned int len, const T &x, unsigned int *i = nullptr, + bool bfind (unsigned int len, const T &x, unsigned int *i = nullptr, hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE, unsigned int to_store = (unsigned int) -1) const { return as_array (len).bfind (x, i, not_found, to_store); } @@ -515,40 +515,39 @@ struct ArrayOf HB_NO_CREATE_COPY_ASSIGN_TEMPLATE2 (ArrayOf, Type, LenType); - inline const Type& operator [] (int i_) const + const Type& operator [] (int i_) const { unsigned int i = (unsigned int) i_; if (unlikely (i >= len)) return Null (Type); return arrayZ[i]; } - inline Type& operator [] (int i_) + Type& operator [] (int i_) { unsigned int i = (unsigned int) i_; if (unlikely (i >= len)) return Crap (Type); return arrayZ[i]; } - inline unsigned int get_size (void) const + unsigned int get_size (void) const { return len.static_size + len * Type::static_size; } - inline hb_array_t as_array (void) + hb_array_t as_array (void) { return hb_array (arrayZ, len); } - inline hb_array_t as_array (void) const + hb_array_t as_array (void) const { return hb_array (arrayZ, len); } - inline operator hb_array_t (void) { return as_array (); } - inline operator hb_array_t (void) const { as_array (); } + operator hb_array_t (void) { return as_array (); } + operator hb_array_t (void) const { as_array (); } - inline hb_array_t sub_array (unsigned int start_offset, unsigned int count) const + hb_array_t sub_array (unsigned int start_offset, unsigned int count) const { return as_array ().sub_array (start_offset, count);} - inline hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const + hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const { return as_array ().sub_array (start_offset, count);} - inline hb_array_t sub_array (unsigned int start_offset, unsigned int count) + hb_array_t sub_array (unsigned int start_offset, unsigned int count) { return as_array ().sub_array (start_offset, count);} - inline hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) + hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) { return as_array ().sub_array (start_offset, count);} - inline bool serialize (hb_serialize_context_t *c, - unsigned int items_len) + bool serialize (hb_serialize_context_t *c, unsigned int items_len) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -556,9 +555,9 @@ struct ArrayOf if (unlikely (!c->extend (*this))) return_trace (false); return_trace (true); } - inline bool serialize (hb_serialize_context_t *c, - Supplier &items, - unsigned int items_len) + bool serialize (hb_serialize_context_t *c, + Supplier &items, + unsigned int items_len) { TRACE_SERIALIZE (this); if (unlikely (!serialize (c, items_len))) return_trace (false); @@ -568,7 +567,7 @@ struct ArrayOf return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -584,7 +583,7 @@ struct ArrayOf return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -595,7 +594,7 @@ struct ArrayOf return_trace (true); } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const + bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -607,16 +606,16 @@ struct ArrayOf } template - inline Type &lsearch (const T &x, Type ¬_found = Crap (Type)) + Type &lsearch (const T &x, Type ¬_found = Crap (Type)) { return *as_array ().lsearch (x, ¬_found); } template - inline const Type &lsearch (const T &x, const Type ¬_found = Null (Type)) const + const Type &lsearch (const T &x, const Type ¬_found = Null (Type)) const { return *as_array ().lsearch (x, ¬_found); } - inline void qsort (unsigned int start = 0, unsigned int end = (unsigned int) -1) + void qsort (unsigned int start = 0, unsigned int end = (unsigned int) -1) { as_array ().qsort (start, end); } - inline bool sanitize_shallow (hb_sanitize_context_t *c) const + bool sanitize_shallow (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (len.sanitize (c) && c->check_array (arrayZ, len)); @@ -643,20 +642,20 @@ struct LOffsetLArrayOf : ArrayOf, HBUINT32> {}; template struct OffsetListOf : OffsetArrayOf { - inline const Type& operator [] (int i_) const + const Type& operator [] (int i_) const { unsigned int i = (unsigned int) i_; if (unlikely (i >= this->len)) return Null (Type); return this+this->arrayZ[i]; } - inline const Type& operator [] (int i_) + const Type& operator [] (int i_) { unsigned int i = (unsigned int) i_; if (unlikely (i >= this->len)) return Crap (Type); return this+this->arrayZ[i]; } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); struct OffsetListOf *out = c->serializer->embed (*this); @@ -667,13 +666,13 @@ struct OffsetListOf : OffsetArrayOf return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (OffsetArrayOf::sanitize (c, this)); } template - inline bool sanitize (hb_sanitize_context_t *c, T user_data) const + bool sanitize (hb_sanitize_context_t *c, T user_data) const { TRACE_SANITIZE (this); return_trace (OffsetArrayOf::sanitize (c, this, user_data)); @@ -688,24 +687,24 @@ struct HeadlessArrayOf HB_NO_CREATE_COPY_ASSIGN_TEMPLATE2 (HeadlessArrayOf, Type, LenType); - inline const Type& operator [] (int i_) const + const Type& operator [] (int i_) const { unsigned int i = (unsigned int) i_; if (unlikely (i >= lenP1 || !i)) return Null (Type); return arrayZ[i-1]; } - inline Type& operator [] (int i_) + Type& operator [] (int i_) { unsigned int i = (unsigned int) i_; if (unlikely (i >= lenP1 || !i)) return Crap (Type); return arrayZ[i-1]; } - inline unsigned int get_size (void) const + unsigned int get_size (void) const { return lenP1.static_size + (lenP1 ? lenP1 - 1 : 0) * Type::static_size; } - inline bool serialize (hb_serialize_context_t *c, - Supplier &items, - unsigned int items_len) + bool serialize (hb_serialize_context_t *c, + Supplier &items, + unsigned int items_len) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -718,7 +717,7 @@ struct HeadlessArrayOf return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -736,7 +735,7 @@ struct HeadlessArrayOf } private: - inline bool sanitize_shallow (hb_sanitize_context_t *c) const + bool sanitize_shallow (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (lenP1.sanitize (c) && @@ -756,23 +755,23 @@ struct ArrayOfM1 { HB_NO_CREATE_COPY_ASSIGN_TEMPLATE2 (ArrayOfM1, Type, LenType); - inline const Type& operator [] (int i_) const + const Type& operator [] (int i_) const { unsigned int i = (unsigned int) i_; if (unlikely (i > lenM1)) return Null (Type); return arrayZ[i]; } - inline Type& operator [] (int i_) + Type& operator [] (int i_) { unsigned int i = (unsigned int) i_; if (unlikely (i > lenM1)) return Crap (Type); return arrayZ[i]; } - inline unsigned int get_size (void) const + unsigned int get_size (void) const { return lenM1.static_size + (lenM1 + 1) * Type::static_size; } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const + bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -784,7 +783,7 @@ struct ArrayOfM1 } private: - inline bool sanitize_shallow (hb_sanitize_context_t *c) const + bool sanitize_shallow (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (lenM1.sanitize (c) && @@ -802,30 +801,30 @@ struct ArrayOfM1 template struct SortedArrayOf : ArrayOf { - inline hb_sorted_array_t as_array (void) + hb_sorted_array_t as_array (void) { return hb_sorted_array (this->arrayZ, this->len); } - inline hb_sorted_array_t as_array (void) const + hb_sorted_array_t as_array (void) const { return hb_sorted_array (this->arrayZ, this->len); } - inline operator hb_sorted_array_t (void) { return as_array (); } - inline operator hb_sorted_array_t (void) const { as_array (); } + operator hb_sorted_array_t (void) { return as_array (); } + operator hb_sorted_array_t (void) const { as_array (); } - inline hb_array_t sub_array (unsigned int start_offset, unsigned int count) const + hb_array_t sub_array (unsigned int start_offset, unsigned int count) const { return as_array ().sub_array (start_offset, count);} - inline hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const + hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const { return as_array ().sub_array (start_offset, count);} - inline hb_array_t sub_array (unsigned int start_offset, unsigned int count) + hb_array_t sub_array (unsigned int start_offset, unsigned int count) { return as_array ().sub_array (start_offset, count);} - inline hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) + hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) { return as_array ().sub_array (start_offset, count);} template - inline Type &bsearch (const T &x, Type ¬_found = Crap (Type)) + Type &bsearch (const T &x, Type ¬_found = Crap (Type)) { return *as_array ().bsearch (x, ¬_found); } template - inline const Type &bsearch (const T &x, const Type ¬_found = Null (Type)) const + const Type &bsearch (const T &x, const Type ¬_found = Null (Type)) const { return *as_array ().bsearch (x, ¬_found); } template - inline bool bfind (const T &x, unsigned int *i = nullptr, + bool bfind (const T &x, unsigned int *i = nullptr, hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE, unsigned int to_store = (unsigned int) -1) const { return as_array ().bfind (x, i, not_found, to_store); } @@ -838,15 +837,15 @@ struct SortedArrayOf : ArrayOf template struct BinSearchHeader { - inline operator uint32_t (void) const { return len; } + operator uint32_t (void) const { return len; } - 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)); } - inline void set (unsigned int v) + void set (unsigned int v) { len.set (v); assert (len == v); @@ -874,7 +873,7 @@ struct BinSearchArrayOf : SortedArrayOf > {}; struct VarSizedBinSearchHeader { - 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)); @@ -900,7 +899,7 @@ struct VarSizedBinSearchArrayOf HB_NO_CREATE_COPY_ASSIGN_TEMPLATE (VarSizedBinSearchArrayOf, Type); - inline bool last_is_terminator (void) const + bool last_is_terminator (void) const { if (unlikely (!header.nUnits)) return false; @@ -916,26 +915,26 @@ struct VarSizedBinSearchArrayOf return true; } - inline const Type& operator [] (int i_) const + const Type& operator [] (int i_) const { unsigned int i = (unsigned int) i_; if (unlikely (i >= get_length ())) return Null (Type); return StructAtOffset (&bytesZ, i * header.unitSize); } - inline Type& operator [] (int i_) + Type& operator [] (int i_) { unsigned int i = (unsigned int) i_; if (unlikely (i >= get_length ())) return Crap (Type); return StructAtOffset (&bytesZ, i * header.unitSize); } - inline unsigned int get_length (void) const + unsigned int get_length (void) const { return header.nUnits - last_is_terminator (); } - inline unsigned int get_size (void) const + unsigned int get_size (void) const { return header.static_size + header.nUnits * header.unitSize; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -951,7 +950,7 @@ struct VarSizedBinSearchArrayOf return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -962,7 +961,7 @@ struct VarSizedBinSearchArrayOf return_trace (true); } template - inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const + bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return_trace (false); @@ -974,7 +973,7 @@ struct VarSizedBinSearchArrayOf } template - inline const Type *bsearch (const T &key) const + const Type *bsearch (const T &key) const { unsigned int size = header.unitSize; int min = 0, max = (int) get_length () - 1; @@ -991,7 +990,7 @@ struct VarSizedBinSearchArrayOf } private: - inline bool sanitize_shallow (hb_sanitize_context_t *c) const + bool sanitize_shallow (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (header.sanitize (c) && diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index eca38cbdc..6b5173890 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -64,12 +64,9 @@ struct code_pair typedef hb_vector_t StrBuff; struct StrBuffArray : hb_vector_t { - inline void fini (void) - { - SUPER::fini_deep (); - } + void fini (void) { SUPER::fini_deep (); } - inline unsigned int total_size (void) const + unsigned int total_size (void) const { unsigned int size = 0; for (unsigned int i = 0; i < len; i++) @@ -85,7 +82,7 @@ struct StrBuffArray : hb_vector_t template struct CFFIndex { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely ((count.sanitize (c) && count == 0) || /* empty INDEX */ @@ -94,13 +91,13 @@ struct CFFIndex c->check_array ((const HBUINT8*)data_base (), 1, max_offset () - 1)))); } - inline static unsigned int calculate_offset_array_size (unsigned int offSize, unsigned int count) + static unsigned int calculate_offset_array_size (unsigned int offSize, unsigned int count) { return offSize * (count + 1); } - inline unsigned int offset_array_size (void) const + unsigned int offset_array_size (void) const { return calculate_offset_array_size (offSize, count); } - inline static unsigned int calculate_serialized_size (unsigned int offSize, unsigned int count, unsigned int dataSize) + static unsigned int calculate_serialized_size (unsigned int offSize, unsigned int count, unsigned int dataSize) { if (count == 0) return COUNT::static_size; @@ -108,7 +105,7 @@ struct CFFIndex return min_size + calculate_offset_array_size (offSize, count) + dataSize; } - inline bool serialize (hb_serialize_context_t *c, const CFFIndex &src) + bool serialize (hb_serialize_context_t *c, const CFFIndex &src) { TRACE_SERIALIZE (this); unsigned int size = src.get_size (); @@ -118,9 +115,9 @@ struct CFFIndex return_trace (true); } - inline bool serialize (hb_serialize_context_t *c, - unsigned int offSize_, - const ByteStrArray &byteArray) + bool serialize (hb_serialize_context_t *c, + unsigned int offSize_, + const ByteStrArray &byteArray) { TRACE_SERIALIZE (this); if (byteArray.len == 0) @@ -160,9 +157,9 @@ struct CFFIndex return_trace (true); } - inline bool serialize (hb_serialize_context_t *c, - unsigned int offSize_, - const StrBuffArray &buffArray) + bool serialize (hb_serialize_context_t *c, + unsigned int offSize_, + const StrBuffArray &buffArray) { ByteStrArray byteArray; byteArray.init (); @@ -176,7 +173,7 @@ struct CFFIndex return result; } - inline void set_offset_at (unsigned int index, unsigned int offset) + void set_offset_at (unsigned int index, unsigned int offset) { HBUINT8 *p = offsets + offSize * index + offSize; unsigned int size = offSize; @@ -188,7 +185,7 @@ struct CFFIndex } } - inline unsigned int offset_at (unsigned int index) const + unsigned int offset_at (unsigned int index) const { assert (index <= count); const HBUINT8 *p = offsets + offSize * index; @@ -199,7 +196,7 @@ struct CFFIndex return offset; } - inline unsigned int length_at (unsigned int index) const + unsigned int length_at (unsigned int index) const { if (likely ((offset_at (index + 1) >= offset_at (index)) && (offset_at (index + 1) <= offset_at (count)))) @@ -208,13 +205,13 @@ struct CFFIndex return 0; } - inline const char *data_base (void) const + const char *data_base (void) const { return (const char *)this + min_size + offset_array_size (); } - inline unsigned int data_size (void) const + unsigned int data_size (void) const { return HBINT8::static_size; } - inline ByteStr operator [] (unsigned int index) const + ByteStr operator [] (unsigned int index) const { if (likely (index < count)) return ByteStr (data_base () + offset_at (index) - 1, length_at (index)); @@ -222,7 +219,7 @@ struct CFFIndex return Null(ByteStr); } - inline unsigned int get_size (void) const + unsigned int get_size (void) const { if (this != &Null(CFFIndex)) { @@ -236,7 +233,7 @@ struct CFFIndex } protected: - inline unsigned int max_offset (void) const + unsigned int max_offset (void) const { unsigned int max = 0; for (unsigned int i = 0; i < count + 1u; i++) @@ -259,7 +256,7 @@ struct CFFIndex template struct CFFIndexOf : CFFIndex { - inline const ByteStr operator [] (unsigned int index) const + const ByteStr operator [] (unsigned int index) const { if (likely (index < CFFIndex::count)) return ByteStr (CFFIndex::data_base () + CFFIndex::offset_at (index) - 1, CFFIndex::length_at (index)); @@ -267,13 +264,13 @@ struct CFFIndexOf : CFFIndex } template - inline bool serialize (hb_serialize_context_t *c, - unsigned int offSize_, - const DATA *dataArray, - unsigned int dataArrayLen, - const hb_vector_t &dataSizeArray, - const PARAM1 ¶m1, - const PARAM2 ¶m2) + bool serialize (hb_serialize_context_t *c, + unsigned int offSize_, + const DATA *dataArray, + unsigned int dataArrayLen, + const hb_vector_t &dataSizeArray, + const PARAM1 ¶m1, + const PARAM2 ¶m2) { TRACE_SERIALIZE (this); /* serialize CFFIndex header */ @@ -306,11 +303,11 @@ struct CFFIndexOf : CFFIndex /* in parallel to above */ template - inline static unsigned int calculate_serialized_size (unsigned int &offSize_ /* OUT */, - const DATA *dataArray, - unsigned int dataArrayLen, - hb_vector_t &dataSizeArray, /* OUT */ - const PARAM ¶m) + static unsigned int calculate_serialized_size (unsigned int &offSize_ /* OUT */, + const DATA *dataArray, + unsigned int dataArrayLen, + hb_vector_t &dataSizeArray, /* OUT */ + const PARAM ¶m) { /* determine offset size */ unsigned int totalDataSize = 0; @@ -330,10 +327,10 @@ struct CFFIndexOf : CFFIndex struct Dict : UnsizedByteStr { template - inline bool serialize (hb_serialize_context_t *c, - const DICTVAL &dictval, - OP_SERIALIZER& opszr, - PARAM& param) + bool serialize (hb_serialize_context_t *c, + const DICTVAL &dictval, + OP_SERIALIZER& opszr, + PARAM& param) { TRACE_SERIALIZE (this); for (unsigned int i = 0; i < dictval.get_count (); i++) @@ -346,9 +343,9 @@ struct Dict : UnsizedByteStr /* in parallel to above */ template - inline static unsigned int calculate_serialized_size (const DICTVAL &dictval, - OP_SERIALIZER& opszr, - PARAM& param) + static unsigned int calculate_serialized_size (const DICTVAL &dictval, + OP_SERIALIZER& opszr, + PARAM& param) { unsigned int size = 0; for (unsigned int i = 0; i < dictval.get_count (); i++) @@ -357,8 +354,8 @@ struct Dict : UnsizedByteStr } template - inline static unsigned int calculate_serialized_size (const DICTVAL &dictval, - OP_SERIALIZER& opszr) + static unsigned int calculate_serialized_size (const DICTVAL &dictval, + OP_SERIALIZER& opszr) { unsigned int size = 0; for (unsigned int i = 0; i < dictval.get_count (); i++) @@ -367,7 +364,7 @@ struct Dict : UnsizedByteStr } template - inline static bool serialize_int_op (hb_serialize_context_t *c, OpCode op, int value, OpCode intOp) + static bool serialize_int_op (hb_serialize_context_t *c, OpCode op, int value, OpCode intOp) { // XXX: not sure why but LLVM fails to compile the following 'unlikely' macro invocation if (/*unlikely*/ (!serialize_int (c, intOp, value))) @@ -387,18 +384,18 @@ struct Dict : UnsizedByteStr return_trace (true); } - inline static bool serialize_uint4_op (hb_serialize_context_t *c, OpCode op, int value) + static bool serialize_uint4_op (hb_serialize_context_t *c, OpCode op, int value) { return serialize_int_op (c, op, value, OpCode_longintdict); } - inline static bool serialize_uint2_op (hb_serialize_context_t *c, OpCode op, int value) + static bool serialize_uint2_op (hb_serialize_context_t *c, OpCode op, int value) { return serialize_int_op (c, op, value, OpCode_shortint); } - inline static bool serialize_offset4_op (hb_serialize_context_t *c, OpCode op, int value) + static bool serialize_offset4_op (hb_serialize_context_t *c, OpCode op, int value) { return serialize_uint4_op (c, op, value); } - inline static bool serialize_offset2_op (hb_serialize_context_t *c, OpCode op, int value) + static bool serialize_offset2_op (hb_serialize_context_t *c, OpCode op, int value) { return serialize_uint2_op (c, op, value); } @@ -421,13 +418,11 @@ struct TableInfo * set to CFF_UNDEF_CODE if excluded from subset */ struct Remap : hb_vector_t { - inline void init (void) - { SUPER::init (); } + void init (void) { SUPER::init (); } - inline void fini (void) - { SUPER::fini (); } + void fini (void) { SUPER::fini (); } - inline bool reset (unsigned int size) + bool reset (unsigned int size) { if (unlikely (!SUPER::resize (size))) return false; @@ -437,7 +432,7 @@ struct Remap : hb_vector_t return true; } - inline bool identity (unsigned int size) + bool identity (unsigned int size) { if (unlikely (!SUPER::resize (size))) return false; @@ -448,20 +443,20 @@ struct Remap : hb_vector_t return true; } - inline bool excludes (hb_codepoint_t id) const + bool excludes (hb_codepoint_t id) const { return (id < len) && ((*this)[id] == CFF_UNDEF_CODE); } - inline bool includes (hb_codepoint_t id) const + bool includes (hb_codepoint_t id) const { return !excludes (id); } - inline unsigned int add (unsigned int i) + unsigned int add (unsigned int i) { if ((*this)[i] == CFF_UNDEF_CODE) (*this)[i] = count++; return (*this)[i]; } - inline hb_codepoint_t get_count (void) const + hb_codepoint_t get_count (void) const { return count; } protected: @@ -476,10 +471,10 @@ struct FDArray : CFFIndexOf { /* used by CFF1 */ template - inline bool serialize (hb_serialize_context_t *c, - unsigned int offSize_, - const hb_vector_t &fontDicts, - OP_SERIALIZER& opszr) + bool serialize (hb_serialize_context_t *c, + unsigned int offSize_, + const hb_vector_t &fontDicts, + OP_SERIALIZER& opszr) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -510,13 +505,13 @@ struct FDArray : CFFIndexOf /* used by CFF2 */ template - inline bool serialize (hb_serialize_context_t *c, - unsigned int offSize_, - const hb_vector_t &fontDicts, - unsigned int fdCount, - const Remap &fdmap, - OP_SERIALIZER& opszr, - const hb_vector_t &privateInfos) + bool serialize (hb_serialize_context_t *c, + unsigned int offSize_, + const hb_vector_t &fontDicts, + unsigned int fdCount, + const Remap &fdmap, + OP_SERIALIZER& opszr, + const hb_vector_t &privateInfos) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -549,11 +544,11 @@ struct FDArray : CFFIndexOf /* in parallel to above */ template - inline static unsigned int calculate_serialized_size (unsigned int &offSize_ /* OUT */, - const hb_vector_t &fontDicts, - unsigned int fdCount, - const Remap &fdmap, - OP_SERIALIZER& opszr) + static unsigned int calculate_serialized_size (unsigned int &offSize_ /* OUT */, + const hb_vector_t &fontDicts, + unsigned int fdCount, + const Remap &fdmap, + OP_SERIALIZER& opszr) { unsigned int dictsSize = 0; for (unsigned int i = 0; i < fontDicts.len; i++) @@ -567,7 +562,7 @@ struct FDArray : CFFIndexOf /* FDSelect */ struct FDSelect0 { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const + bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const { TRACE_SANITIZE (this); if (unlikely (!(c->check_struct (this)))) @@ -579,12 +574,12 @@ struct FDSelect0 { return_trace (true); } - inline hb_codepoint_t get_fd (hb_codepoint_t glyph) const + hb_codepoint_t get_fd (hb_codepoint_t glyph) const { return (hb_codepoint_t)fds[glyph]; } - inline unsigned int get_size (unsigned int num_glyphs) const + unsigned int get_size (unsigned int num_glyphs) const { return HBUINT8::static_size * num_glyphs; } HBUINT8 fds[VAR]; @@ -594,7 +589,7 @@ struct FDSelect0 { template struct FDSelect3_4_Range { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const + bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && (first < c->get_num_glyphs ()) && (fd < fdcount))); @@ -608,10 +603,10 @@ struct FDSelect3_4_Range { template struct FDSelect3_4 { - inline unsigned int get_size (void) const + unsigned int get_size (void) const { return GID_TYPE::static_size * 2 + FDSelect3_4_Range::static_size * nRanges; } - inline bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const + bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const { TRACE_SANITIZE (this); if (unlikely (!(c->check_struct (this) && (nRanges > 0) && (ranges[0].first == 0)))) @@ -630,7 +625,7 @@ struct FDSelect3_4 { return_trace (true); } - inline hb_codepoint_t get_fd (hb_codepoint_t glyph) const + hb_codepoint_t get_fd (hb_codepoint_t glyph) const { unsigned int i; for (i = 1; i < nRanges; i++) @@ -640,8 +635,8 @@ struct FDSelect3_4 { return (hb_codepoint_t)ranges[i - 1].fd; } - inline GID_TYPE &sentinel (void) { return StructAfter (ranges[nRanges - 1]); } - inline const GID_TYPE &sentinel (void) const { return StructAfter (ranges[nRanges - 1]); } + GID_TYPE &sentinel (void) { return StructAfter (ranges[nRanges - 1]); } + const GID_TYPE &sentinel (void) const { return StructAfter (ranges[nRanges - 1]); } GID_TYPE nRanges; FDSelect3_4_Range ranges[VAR]; @@ -654,7 +649,7 @@ typedef FDSelect3_4 FDSelect3; typedef FDSelect3_4_Range FDSelect3_Range; struct FDSelect { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const + bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const { TRACE_SANITIZE (this); @@ -664,7 +659,7 @@ struct FDSelect { u.format3.sanitize (c, fdcount))); } - inline bool serialize (hb_serialize_context_t *c, const FDSelect &src, unsigned int num_glyphs) + bool serialize (hb_serialize_context_t *c, const FDSelect &src, unsigned int num_glyphs) { TRACE_SERIALIZE (this); unsigned int size = src.get_size (num_glyphs); @@ -674,10 +669,10 @@ struct FDSelect { return_trace (true); } - inline unsigned int calculate_serialized_size (unsigned int num_glyphs) const + unsigned int calculate_serialized_size (unsigned int num_glyphs) const { return get_size (num_glyphs); } - inline unsigned int get_size (unsigned int num_glyphs) const + unsigned int get_size (unsigned int num_glyphs) const { unsigned int size = format.static_size; if (format == 0) @@ -687,7 +682,7 @@ struct FDSelect { return size; } - inline hb_codepoint_t get_fd (hb_codepoint_t glyph) const + hb_codepoint_t get_fd (hb_codepoint_t glyph) const { if (this == &Null(FDSelect)) return 0; diff --git a/src/hb-ot-cff1-table.cc b/src/hb-ot-cff1-table.cc index d1e0a1fa9..b1c78bcd9 100644 --- a/src/hb-ot-cff1-table.cc +++ b/src/hb-ot-cff1-table.cc @@ -163,13 +163,13 @@ hb_codepoint_t OT::cff1::lookup_standard_encoding_for_sid (hb_codepoint_t code) struct Bounds { - inline void init (void) + void init (void) { min.set_int (0x7FFFFFFF, 0x7FFFFFFF); max.set_int (-0x80000000, -0x80000000); } - inline void update (const Point &pt) + void update (const Point &pt) { if (pt.x < min.x) min.x = pt.x; if (pt.x > max.x) max.x = pt.x; @@ -177,7 +177,7 @@ struct Bounds if (pt.y > max.y) max.y = pt.y; } - inline void merge (const Bounds &b) + void merge (const Bounds &b) { if (empty ()) *this = b; @@ -190,7 +190,7 @@ struct Bounds } } - inline void offset (const Point &delta) + void offset (const Point &delta) { if (!empty ()) { @@ -199,7 +199,7 @@ struct Bounds } } - inline bool empty (void) const + bool empty (void) const { return (min.x >= max.x) || (min.y >= max.y); } @@ -210,16 +210,16 @@ struct Bounds struct ExtentsParam { - inline void init (const OT::cff1::accelerator_t *_cff) + void init (const OT::cff1::accelerator_t *_cff) { path_open = false; cff = _cff; bounds.init (); } - inline void start_path (void) { path_open = true; } - inline void end_path (void) { path_open = false; } - inline bool is_path_open (void) const { return path_open; } + void start_path (void) { path_open = true; } + void end_path (void) { path_open = false; } + bool is_path_open (void) const { return path_open; } bool path_open; Bounds bounds; @@ -229,13 +229,13 @@ struct ExtentsParam struct CFF1PathProcs_Extents : PathProcs { - static inline void moveto (CFF1CSInterpEnv &env, ExtentsParam& param, const Point &pt) + static void moveto (CFF1CSInterpEnv &env, ExtentsParam& param, const Point &pt) { param.end_path (); env.moveto (pt); } - static inline void line (CFF1CSInterpEnv &env, ExtentsParam& param, const Point &pt1) + static void line (CFF1CSInterpEnv &env, ExtentsParam& param, const Point &pt1) { if (!param.is_path_open ()) { @@ -246,7 +246,7 @@ struct CFF1PathProcs_Extents : PathProcs { - static inline void process_seac (CFF1CSInterpEnv &env, ExtentsParam& param) + static void process_seac (CFF1CSInterpEnv &env, ExtentsParam& param) { unsigned int n = env.argStack.get_count (); Point delta; @@ -338,14 +338,14 @@ bool OT::cff1::accelerator_t::get_extents (hb_codepoint_t glyph, hb_glyph_extent struct GetSeacParam { - inline void init (const OT::cff1::accelerator_t *_cff) + void init (const OT::cff1::accelerator_t *_cff) { cff = _cff; base = 0; accent = 0; } - inline bool has_seac (void) const + bool has_seac (void) const { return base && accent; } const OT::cff1::accelerator_t *cff; @@ -355,7 +355,7 @@ struct GetSeacParam struct CFF1CSOpSet_Seac : CFF1CSOpSet { - static inline void process_seac (CFF1CSInterpEnv &env, GetSeacParam& param) + static void process_seac (CFF1CSInterpEnv &env, GetSeacParam& param) { unsigned int n = env.argStack.get_count (); hb_codepoint_t base_char = (hb_codepoint_t)env.argStack[n-2].to_int (); diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index de4aa12fa..797779310 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -56,13 +56,13 @@ struct CFF1FDSelect : FDSelect {}; /* Encoding */ struct Encoding0 { - 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) && codes[nCodes - 1].sanitize (c)); } - inline hb_codepoint_t get_code (hb_codepoint_t glyph) const + hb_codepoint_t get_code (hb_codepoint_t glyph) const { assert (glyph > 0); glyph--; @@ -74,7 +74,7 @@ struct Encoding0 { return CFF_UNDEF_CODE; } - inline unsigned int get_size (void) const + unsigned int get_size (void) const { return HBUINT8::static_size * (nCodes + 1); } HBUINT8 nCodes; @@ -84,7 +84,7 @@ struct Encoding0 { }; struct Encoding1_Range { - 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)); @@ -97,16 +97,16 @@ struct Encoding1_Range { }; struct Encoding1 { - inline unsigned int get_size (void) const + unsigned int get_size (void) const { return HBUINT8::static_size + Encoding1_Range::static_size * nRanges; } - 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) && ((nRanges == 0) || (ranges[nRanges - 1]).sanitize (c))); } - inline hb_codepoint_t get_code (hb_codepoint_t glyph) const + hb_codepoint_t get_code (hb_codepoint_t glyph) const { assert (glyph > 0); glyph--; @@ -128,7 +128,7 @@ struct Encoding1 { }; struct SuppEncoding { - 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)); @@ -141,20 +141,20 @@ struct SuppEncoding { }; struct CFF1SuppEncData { - 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) && ((nSups == 0) || (supps[nSups - 1]).sanitize (c))); } - inline void get_codes (hb_codepoint_t sid, hb_vector_t &codes) const + void get_codes (hb_codepoint_t sid, hb_vector_t &codes) const { for (unsigned int i = 0; i < nSups; i++) if (sid == supps[i].glyph) codes.push (supps[i].code); } - inline unsigned int get_size (void) const + unsigned int get_size (void) const { return HBUINT8::static_size + SuppEncoding::static_size * nSups; } HBUINT8 nSups; @@ -164,7 +164,7 @@ struct CFF1SuppEncData { }; struct Encoding { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -179,7 +179,7 @@ struct Encoding { } /* serialize a fullset Encoding */ - inline bool serialize (hb_serialize_context_t *c, const Encoding &src) + bool serialize (hb_serialize_context_t *c, const Encoding &src) { TRACE_SERIALIZE (this); unsigned int size = src.get_size (); @@ -190,11 +190,11 @@ struct Encoding { } /* serialize a subset Encoding */ - inline bool serialize (hb_serialize_context_t *c, - uint8_t format, - unsigned int enc_count, - const hb_vector_t& code_ranges, - const hb_vector_t& supp_codes) + bool serialize (hb_serialize_context_t *c, + uint8_t format, + unsigned int enc_count, + const hb_vector_t& code_ranges, + const hb_vector_t& supp_codes) { TRACE_SERIALIZE (this); Encoding *dest = c->extend_min (*this); @@ -243,10 +243,9 @@ struct Encoding { } /* parallel to above: calculate the size of a subset Encoding */ - static inline unsigned int calculate_serialized_size ( - uint8_t format, - unsigned int enc_count, - unsigned int supp_count) + static unsigned int calculate_serialized_size (uint8_t format, + unsigned int enc_count, + unsigned int supp_count) { unsigned int size = min_size; if (format == 0) @@ -258,7 +257,7 @@ struct Encoding { return size; } - inline unsigned int get_size (void) const + unsigned int get_size (void) const { unsigned int size = min_size; if (table_format () == 0) @@ -270,7 +269,7 @@ struct Encoding { return size; } - inline hb_codepoint_t get_code (hb_codepoint_t glyph) const + hb_codepoint_t get_code (hb_codepoint_t glyph) const { if (table_format () == 0) return u.format0.get_code (glyph); @@ -278,10 +277,10 @@ struct Encoding { return u.format1.get_code (glyph); } - inline uint8_t table_format (void) const { return (format & 0x7F); } - inline bool has_supplement (void) const { return (format & 0x80) != 0; } + uint8_t table_format (void) const { return (format & 0x7F); } + bool has_supplement (void) const { return (format & 0x80) != 0; } - inline void get_supplement_codes (hb_codepoint_t sid, hb_vector_t &codes) const + void get_supplement_codes (hb_codepoint_t sid, hb_vector_t &codes) const { codes.resize (0); if (has_supplement ()) @@ -289,7 +288,7 @@ struct Encoding { } protected: - inline const CFF1SuppEncData &suppEncData (void) const + const CFF1SuppEncData &suppEncData (void) const { if ((format & 0x7F) == 0) return StructAfter (u.format0.codes[u.format0.nCodes-1]); @@ -311,13 +310,13 @@ struct Encoding { /* Charset */ struct Charset0 { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int num_glyphs) const + bool sanitize (hb_sanitize_context_t *c, unsigned int num_glyphs) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && sids[num_glyphs - 1].sanitize (c)); } - inline hb_codepoint_t get_sid (hb_codepoint_t glyph) const + hb_codepoint_t get_sid (hb_codepoint_t glyph) const { if (glyph == 0) return 0; @@ -325,7 +324,7 @@ struct Charset0 { return sids[glyph - 1]; } - inline hb_codepoint_t get_glyph (hb_codepoint_t sid, unsigned int num_glyphs) const + hb_codepoint_t get_glyph (hb_codepoint_t sid, unsigned int num_glyphs) const { if (sid == 0) return 0; @@ -338,7 +337,7 @@ struct Charset0 { return 0; } - inline unsigned int get_size (unsigned int num_glyphs) const + unsigned int get_size (unsigned int num_glyphs) const { assert (num_glyphs > 0); return HBUINT16::static_size * (num_glyphs - 1); @@ -351,7 +350,7 @@ struct Charset0 { template struct Charset_Range { - 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)); @@ -365,7 +364,7 @@ struct Charset_Range { template struct Charset1_2 { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int num_glyphs) const + bool sanitize (hb_sanitize_context_t *c, unsigned int num_glyphs) const { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) @@ -380,7 +379,7 @@ struct Charset1_2 { return_trace (true); } - inline hb_codepoint_t get_sid (hb_codepoint_t glyph) const + hb_codepoint_t get_sid (hb_codepoint_t glyph) const { if (glyph == 0) return 0; glyph--; @@ -394,7 +393,7 @@ struct Charset1_2 { return 0; } - inline hb_codepoint_t get_glyph (hb_codepoint_t sid, unsigned int num_glyphs) const + hb_codepoint_t get_glyph (hb_codepoint_t sid, unsigned int num_glyphs) const { if (sid == 0) return 0; hb_codepoint_t glyph = 1; @@ -410,7 +409,7 @@ struct Charset1_2 { return 0; } - inline unsigned int get_size (unsigned int num_glyphs) const + unsigned int get_size (unsigned int num_glyphs) const { unsigned int size = HBUINT8::static_size; int glyph = (int)num_glyphs; @@ -437,7 +436,7 @@ typedef Charset_Range Charset1_Range; typedef Charset_Range Charset2_Range; struct Charset { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -454,7 +453,7 @@ struct Charset { } /* serialize a fullset Charset */ - inline bool serialize (hb_serialize_context_t *c, const Charset &src, unsigned int num_glyphs) + bool serialize (hb_serialize_context_t *c, const Charset &src, unsigned int num_glyphs) { TRACE_SERIALIZE (this); unsigned int size = src.get_size (num_glyphs); @@ -465,10 +464,10 @@ struct Charset { } /* serialize a subset Charset */ - inline bool serialize (hb_serialize_context_t *c, - uint8_t format, - unsigned int num_glyphs, - const hb_vector_t& sid_ranges) + bool serialize (hb_serialize_context_t *c, + uint8_t format, + unsigned int num_glyphs, + const hb_vector_t& sid_ranges) { TRACE_SERIALIZE (this); Charset *dest = c->extend_min (*this); @@ -514,7 +513,7 @@ struct Charset { } /* parallel to above: calculate the size of a subset Charset */ - static inline unsigned int calculate_serialized_size ( + static unsigned int calculate_serialized_size ( uint8_t format, unsigned int count) { @@ -529,7 +528,7 @@ struct Charset { return size; } - inline unsigned int get_size (unsigned int num_glyphs) const + unsigned int get_size (unsigned int num_glyphs) const { unsigned int size = min_size; if (format == 0) @@ -541,7 +540,7 @@ struct Charset { return size; } - inline hb_codepoint_t get_sid (hb_codepoint_t glyph) const + hb_codepoint_t get_sid (hb_codepoint_t glyph) const { if (format == 0) return u.format0.get_sid (glyph); @@ -551,7 +550,7 @@ struct Charset { return u.format2.get_sid (glyph); } - inline hb_codepoint_t get_glyph (hb_codepoint_t sid, unsigned int num_glyphs) const + hb_codepoint_t get_glyph (hb_codepoint_t sid, unsigned int num_glyphs) const { if (format == 0) return u.format0.get_glyph (sid, num_glyphs); @@ -573,7 +572,8 @@ struct Charset { struct CFF1StringIndex : CFF1Index { - inline bool serialize (hb_serialize_context_t *c, const CFF1StringIndex &strings, unsigned int offSize_, const Remap &sidmap) + bool serialize (hb_serialize_context_t *c, const CFF1StringIndex &strings, + unsigned int offSize_, const Remap &sidmap) { TRACE_SERIALIZE (this); if (unlikely ((strings.count == 0) || (sidmap.get_count () == 0))) @@ -601,7 +601,7 @@ struct CFF1StringIndex : CFF1Index } /* in parallel to above */ - inline unsigned int calculate_serialized_size (unsigned int &offSize /*OUT*/, const Remap &sidmap) const + unsigned int calculate_serialized_size (unsigned int &offSize /*OUT*/, const Remap &sidmap) const { offSize = 0; if ((count == 0) || (sidmap.get_count () == 0)) @@ -619,7 +619,7 @@ struct CFF1StringIndex : CFF1Index struct CFF1TopDictInterpEnv : NumInterpEnv { - inline CFF1TopDictInterpEnv (void) + CFF1TopDictInterpEnv (void) : NumInterpEnv(), prev_offset(0), last_offset(0) {} unsigned int prev_offset; @@ -645,19 +645,19 @@ struct NameDictValues ValCount }; - inline void init (void) + void init (void) { for (unsigned int i = 0; i < ValCount; i++) values[i] = CFF_UNDEF_SID; } - inline unsigned int& operator[] (unsigned int i) + unsigned int& operator[] (unsigned int i) { assert (i < ValCount); return values[i]; } - inline unsigned int operator[] (unsigned int i) const + unsigned int operator[] (unsigned int i) const { assert (i < ValCount); return values[i]; } - static inline enum NameDictValIndex name_op_to_index (OpCode op) + static enum NameDictValIndex name_op_to_index (OpCode op) { switch (op) { default: // can't happen - just make some compiler happy @@ -692,7 +692,7 @@ struct CFF1TopDictVal : OpStr struct CFF1TopDictValues : TopDictValues { - inline void init (void) + void init (void) { TopDictValues::init (); @@ -704,13 +704,9 @@ struct CFF1TopDictValues : TopDictValues FDSelectOffset = 0; privateDictInfo.init (); } + void fini (void) { TopDictValues::fini (); } - inline void fini (void) - { - TopDictValues::fini (); - } - - inline bool is_CID (void) const + bool is_CID (void) const { return nameSIDs[NameDictValues::registry] != CFF_UNDEF_SID; } NameDictValues nameSIDs; @@ -726,7 +722,7 @@ struct CFF1TopDictValues : TopDictValues struct CFF1TopDictOpSet : TopDictOpSet { - static inline void process_op (OpCode op, CFF1TopDictInterpEnv& env, CFF1TopDictValues& dictval) + static void process_op (OpCode op, CFF1TopDictInterpEnv& env, CFF1TopDictValues& dictval) { CFF1TopDictVal val; val.last_arg_offset = (env.last_offset-1) - dictval.opStart; /* offset to the last argument */ @@ -813,14 +809,14 @@ struct CFF1TopDictOpSet : TopDictOpSet struct CFF1FontDictValues : DictValues { - inline void init (void) + void init (void) { DictValues::init (); privateDictInfo.init (); fontName = CFF_UNDEF_SID; } - inline void fini (void) + void fini (void) { DictValues::fini (); } @@ -831,7 +827,7 @@ struct CFF1FontDictValues : DictValues struct CFF1FontDictOpSet : DictOpSet { - static inline void process_op (OpCode op, NumInterpEnv& env, CFF1FontDictValues& dictval) + static void process_op (OpCode op, NumInterpEnv& env, CFF1FontDictValues& dictval) { switch (op) { case OpCode_FontName: @@ -863,19 +859,19 @@ struct CFF1FontDictOpSet : DictOpSet template struct CFF1PrivateDictValues_Base : DictValues { - inline void init (void) + void init (void) { DictValues::init (); subrsOffset = 0; localSubrs = &Null(CFF1Subrs); } - inline void fini (void) + void fini (void) { DictValues::fini (); } - inline unsigned int calculate_serialized_size (void) const + unsigned int calculate_serialized_size (void) const { unsigned int size = 0; for (unsigned int i = 0; i < DictValues::get_count; i++) @@ -895,7 +891,7 @@ typedef CFF1PrivateDictValues_Base CFF1PrivateDictValues; struct CFF1PrivateDictOpSet : DictOpSet { - static inline void process_op (OpCode op, NumInterpEnv& env, CFF1PrivateDictValues& dictval) + static void process_op (OpCode op, NumInterpEnv& env, CFF1PrivateDictValues& dictval) { NumDictVal val; val.init (); @@ -942,7 +938,7 @@ struct CFF1PrivateDictOpSet : DictOpSet struct CFF1PrivateDictOpSet_Subset : DictOpSet { - static inline void process_op (OpCode op, NumInterpEnv& env, CFF1PrivateDictValues_Subset& dictval) + static void process_op (OpCode op, NumInterpEnv& env, CFF1PrivateDictValues_Subset& dictval) { switch (op) { case OpCode_BlueValues: @@ -999,7 +995,7 @@ struct cff1 { static const hb_tag_t tableTag = HB_OT_TAG_cff1; - 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) && @@ -1009,7 +1005,7 @@ struct cff1 template struct accelerator_templ_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { topDict.init (); fontDicts.init (); @@ -1136,7 +1132,7 @@ struct cff1 } } - inline void fini (void) + void fini (void) { sc.end_processing (); topDict.fini (); @@ -1146,12 +1142,12 @@ struct cff1 blob = nullptr; } - inline bool is_valid (void) const { return blob != nullptr; } - inline bool is_CID (void) const { return topDict.is_CID (); } + bool is_valid (void) const { return blob != nullptr; } + bool is_CID (void) const { return topDict.is_CID (); } - inline bool is_predef_charset (void) const { return topDict.CharsetOffset <= ExpertSubsetCharset; } + bool is_predef_charset (void) const { return topDict.CharsetOffset <= ExpertSubsetCharset; } - inline unsigned int std_code_to_glyph (hb_codepoint_t code) const + unsigned int std_code_to_glyph (hb_codepoint_t code) const { hb_codepoint_t sid = lookup_standard_encoding_for_sid (code); if (unlikely (sid == CFF_UNDEF_SID)) @@ -1194,7 +1190,7 @@ struct cff1 struct accelerator_subset_t : accelerator_templ_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { SUPER::init (face); if (blob == nullptr) return; @@ -1215,9 +1211,9 @@ struct cff1 } } - inline bool is_predef_encoding (void) const { return topDict.EncodingOffset <= ExpertEncoding; } + bool is_predef_encoding (void) const { return topDict.EncodingOffset <= ExpertEncoding; } - inline hb_codepoint_t glyph_to_code (hb_codepoint_t glyph) const + hb_codepoint_t glyph_to_code (hb_codepoint_t glyph) const { if (encoding != &Null(Encoding)) return encoding->get_code (glyph); @@ -1241,7 +1237,7 @@ struct cff1 } } - inline hb_codepoint_t glyph_to_sid (hb_codepoint_t glyph) const + hb_codepoint_t glyph_to_sid (hb_codepoint_t glyph) const { if (charset != &Null(Charset)) return charset->get_sid (glyph); @@ -1272,7 +1268,7 @@ struct cff1 typedef accelerator_templ_t SUPER; }; - inline bool subset (hb_subset_plan_t *plan) const + bool subset (hb_subset_plan_t *plan) const { hb_blob_t *cff_prime = nullptr; diff --git a/src/hb-ot-cff2-table.cc b/src/hb-ot-cff2-table.cc index b5c807c42..8885e0ac4 100644 --- a/src/hb-ot-cff2-table.cc +++ b/src/hb-ot-cff2-table.cc @@ -31,7 +31,7 @@ using namespace CFF; struct ExtentsParam { - inline void init (void) + void init (void) { path_open = false; min_x.set_int (0x7FFFFFFF); @@ -40,11 +40,11 @@ struct ExtentsParam max_y.set_int (-0x80000000); } - inline void start_path (void) { path_open = true; } - inline void end_path (void) { path_open = false; } - inline bool is_path_open (void) const { return path_open; } + void start_path (void) { path_open = true; } + void end_path (void) { path_open = false; } + bool is_path_open (void) const { return path_open; } - inline void update_bounds (const Point &pt) + void update_bounds (const Point &pt) { if (pt.x < min_x) min_x = pt.x; if (pt.x > max_x) max_x = pt.x; @@ -61,13 +61,13 @@ struct ExtentsParam struct CFF2PathProcs_Extents : PathProcs { - static inline void moveto (CFF2CSInterpEnv &env, ExtentsParam& param, const Point &pt) + static void moveto (CFF2CSInterpEnv &env, ExtentsParam& param, const Point &pt) { param.end_path (); env.moveto (pt); } - static inline void line (CFF2CSInterpEnv &env, ExtentsParam& param, const Point &pt1) + static void line (CFF2CSInterpEnv &env, ExtentsParam& param, const Point &pt1) { if (!param.is_path_open ()) { @@ -78,7 +78,7 @@ struct CFF2PathProcs_Extents : PathProcs FDSelect4_Range; struct CFF2FDSelect { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const + bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const { TRACE_SANITIZE (this); @@ -63,7 +63,7 @@ struct CFF2FDSelect u.format4.sanitize (c, fdcount)))); } - inline bool serialize (hb_serialize_context_t *c, const CFF2FDSelect &src, unsigned int num_glyphs) + bool serialize (hb_serialize_context_t *c, const CFF2FDSelect &src, unsigned int num_glyphs) { TRACE_SERIALIZE (this); unsigned int size = src.get_size (num_glyphs); @@ -73,10 +73,10 @@ struct CFF2FDSelect return_trace (true); } - inline unsigned int calculate_serialized_size (unsigned int num_glyphs) const + unsigned int calculate_serialized_size (unsigned int num_glyphs) const { return get_size (num_glyphs); } - inline unsigned int get_size (unsigned int num_glyphs) const + unsigned int get_size (unsigned int num_glyphs) const { unsigned int size = format.static_size; if (format == 0) @@ -88,7 +88,7 @@ struct CFF2FDSelect return size; } - inline hb_codepoint_t get_fd (hb_codepoint_t glyph) const + hb_codepoint_t get_fd (hb_codepoint_t glyph) const { if (this == &Null(CFF2FDSelect)) return 0; @@ -112,13 +112,13 @@ struct CFF2FDSelect struct CFF2VariationStore { - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this)) && c->check_range (&varStore, size) && varStore.sanitize (c)); } - inline bool serialize (hb_serialize_context_t *c, const CFF2VariationStore *varStore) + bool serialize (hb_serialize_context_t *c, const CFF2VariationStore *varStore) { TRACE_SERIALIZE (this); unsigned int size_ = varStore->get_size (); @@ -128,7 +128,7 @@ struct CFF2VariationStore return_trace (true); } - inline unsigned int get_size (void) const { return HBUINT16::static_size + size; } + unsigned int get_size (void) const { return HBUINT16::static_size + size; } HBUINT16 size; VariationStore varStore; @@ -138,19 +138,15 @@ struct CFF2VariationStore struct CFF2TopDictValues : TopDictValues<> { - inline void init (void) + void init (void) { TopDictValues<>::init (); vstoreOffset = 0; FDSelectOffset = 0; } + void fini (void) { TopDictValues<>::fini (); } - inline void fini (void) - { - TopDictValues<>::fini (); - } - - inline unsigned int calculate_serialized_size (void) const + unsigned int calculate_serialized_size (void) const { unsigned int size = 0; for (unsigned int i = 0; i < get_count (); i++) @@ -176,7 +172,7 @@ struct CFF2TopDictValues : TopDictValues<> struct CFF2TopDictOpSet : TopDictOpSet<> { - static inline void process_op (OpCode op, NumInterpEnv& env, CFF2TopDictValues& dictval) + static void process_op (OpCode op, NumInterpEnv& env, CFF2TopDictValues& dictval) { switch (op) { case OpCode_FontMatrix: @@ -213,13 +209,13 @@ struct CFF2TopDictOpSet : TopDictOpSet<> struct CFF2FontDictValues : DictValues { - inline void init (void) + void init (void) { DictValues::init (); privateDictInfo.init (); } - inline void fini (void) + void fini (void) { DictValues::fini (); } @@ -229,7 +225,7 @@ struct CFF2FontDictValues : DictValues struct CFF2FontDictOpSet : DictOpSet { - static inline void process_op (OpCode op, NumInterpEnv& env, CFF2FontDictValues& dictval) + static void process_op (OpCode op, NumInterpEnv& env, CFF2FontDictValues& dictval) { switch (op) { case OpCode_Private: @@ -256,7 +252,7 @@ struct CFF2FontDictOpSet : DictOpSet template struct CFF2PrivateDictValues_Base : DictValues { - inline void init (void) + void init (void) { DictValues::init (); subrsOffset = 0; @@ -264,12 +260,12 @@ struct CFF2PrivateDictValues_Base : DictValues ivs = 0; } - inline void fini (void) + void fini (void) { DictValues::fini (); } - inline unsigned int calculate_serialized_size (void) const + unsigned int calculate_serialized_size (void) const { unsigned int size = 0; for (unsigned int i = 0; i < DictValues::get_count; i++) @@ -290,14 +286,14 @@ typedef CFF2PrivateDictValues_Base CFF2PrivateDictValues; struct CFF2PrivDictInterpEnv : NumInterpEnv { - inline void init (const ByteStr &str) + void init (const ByteStr &str) { NumInterpEnv::init (str); ivs = 0; seen_vsindex = false; } - inline void process_vsindex (void) + void process_vsindex (void) { if (likely (!seen_vsindex)) { @@ -306,8 +302,8 @@ struct CFF2PrivDictInterpEnv : NumInterpEnv seen_vsindex = true; } - inline unsigned int get_ivs (void) const { return ivs; } - inline void set_ivs (unsigned int ivs_) { ivs = ivs_; } + unsigned int get_ivs (void) const { return ivs; } + void set_ivs (unsigned int ivs_) { ivs = ivs_; } protected: unsigned int ivs; @@ -316,7 +312,7 @@ struct CFF2PrivDictInterpEnv : NumInterpEnv struct CFF2PrivateDictOpSet : DictOpSet { - static inline void process_op (OpCode op, CFF2PrivDictInterpEnv& env, CFF2PrivateDictValues& dictval) + static void process_op (OpCode op, CFF2PrivDictInterpEnv& env, CFF2PrivateDictValues& dictval) { NumDictVal val; val.init (); @@ -366,7 +362,7 @@ struct CFF2PrivateDictOpSet : DictOpSet struct CFF2PrivateDictOpSet_Subset : DictOpSet { - static inline void process_op (OpCode op, CFF2PrivDictInterpEnv& env, CFF2PrivateDictValues_Subset& dictval) + static void process_op (OpCode op, CFF2PrivDictInterpEnv& env, CFF2PrivateDictValues_Subset& dictval) { switch (op) { case OpCode_BlueValues: @@ -422,7 +418,7 @@ struct cff2 { static const hb_tag_t tableTag = HB_OT_TAG_cff2; - 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) && @@ -432,7 +428,7 @@ struct cff2 template struct accelerator_templ_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { topDict.init (); fontDicts.init (); @@ -505,7 +501,7 @@ struct cff2 } } - inline void fini (void) + void fini (void) { sc.end_processing (); fontDicts.fini_deep (); @@ -514,7 +510,7 @@ struct cff2 blob = nullptr; } - inline bool is_valid (void) const { return blob != nullptr; } + bool is_valid (void) const { return blob != nullptr; } protected: hb_blob_t *blob; @@ -544,7 +540,7 @@ struct cff2 typedef accelerator_templ_t accelerator_subset_t; - inline bool subset (hb_subset_plan_t *plan) const + bool subset (hb_subset_plan_t *plan) const { hb_blob_t *cff2_prime = nullptr; diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 1013dc6e0..2efb45f43 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -41,7 +41,7 @@ namespace OT { struct CmapSubtableFormat0 { - inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const { hb_codepoint_t gid = codepoint < 256 ? glyphIdArray[codepoint] : 0; if (!gid) @@ -49,14 +49,14 @@ struct CmapSubtableFormat0 *glyph = gid; return true; } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { for (unsigned int i = 0; i < 256; i++) if (glyphIdArray[i]) out->add (i); } - 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)); @@ -154,7 +154,7 @@ struct CmapSubtableFormat4 return_trace (true); } - static inline size_t get_sub_table_size (const hb_vector_t &segments) + static size_t get_sub_table_size (const hb_vector_t &segments) { size_t segment_size = 0; for (unsigned int i = 0; i < segments.len; i++) @@ -176,8 +176,8 @@ struct CmapSubtableFormat4 + segment_size; } - static inline bool create_sub_table_plan (const hb_subset_plan_t *plan, - hb_vector_t *segments) + static bool create_sub_table_plan (const hb_subset_plan_t *plan, + hb_vector_t *segments) { segment_plan *segment = nullptr; hb_codepoint_t last_gid = 0; @@ -226,11 +226,11 @@ struct CmapSubtableFormat4 struct accelerator_t { - inline accelerator_t (void) {} - inline accelerator_t (const CmapSubtableFormat4 *subtable) { init (subtable); } - inline ~accelerator_t (void) { fini (); } + accelerator_t (void) {} + accelerator_t (const CmapSubtableFormat4 *subtable) { init (subtable); } + ~accelerator_t (void) { fini (); } - inline void init (const CmapSubtableFormat4 *subtable) + void init (const CmapSubtableFormat4 *subtable) { segCount = subtable->segCountX2 / 2; endCount = subtable->values.arrayZ; @@ -240,9 +240,9 @@ struct CmapSubtableFormat4 glyphIdArray = idRangeOffset + segCount; glyphIdArrayLength = (subtable->length - 16 - 8 * segCount) / 2; } - inline void fini (void) {} + void fini (void) {} - inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const { /* Custom two-array bsearch. */ int min = 0, max = (int) this->segCount - 1; @@ -286,11 +286,11 @@ struct CmapSubtableFormat4 *glyph = gid; return true; } - static inline bool get_glyph_func (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph) + static bool get_glyph_func (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph) { return ((const accelerator_t *) obj)->get_glyph (codepoint, glyph); } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { unsigned int count = this->segCount; if (count && this->startCount[count - 1] == 0xFFFFu) @@ -327,18 +327,18 @@ struct CmapSubtableFormat4 unsigned int glyphIdArrayLength; }; - inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const { accelerator_t accel (this); return accel.get_glyph_func (&accel, codepoint, glyph); } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { accelerator_t accel (this); accel.collect_unicodes (out); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) @@ -403,7 +403,7 @@ struct CmapSubtableLongGroup return 0; } - 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)); @@ -422,7 +422,7 @@ DECLARE_NULL_NAMESPACE_BYTES (OT, CmapSubtableLongGroup); template struct CmapSubtableTrimmed { - inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const { /* Rely on our implicit array bound-checking. */ hb_codepoint_t gid = glyphIdArray[codepoint - startCharCode]; @@ -431,7 +431,7 @@ struct CmapSubtableTrimmed *glyph = gid; return true; } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { hb_codepoint_t start = startCharCode; unsigned int count = glyphIdArray.len; @@ -440,7 +440,7 @@ struct CmapSubtableTrimmed out->add (start + i); } - 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) && glyphIdArray.sanitize (c)); @@ -466,7 +466,7 @@ struct CmapSubtableLongSegmented { friend struct cmap; - inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const + bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const { hb_codepoint_t gid = T::group_get_glyph (groups.bsearch (codepoint), codepoint); if (!gid) @@ -475,7 +475,7 @@ struct CmapSubtableLongSegmented return true; } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { for (unsigned int i = 0; i < this->groups.len; i++) { out->add_range (this->groups[i].startCharCode, @@ -484,14 +484,14 @@ struct CmapSubtableLongSegmented } } - 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) && groups.sanitize (c)); } - inline bool serialize (hb_serialize_context_t *c, - const hb_vector_t &group_data) + bool serialize (hb_serialize_context_t *c, + const hb_vector_t &group_data) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -513,8 +513,8 @@ struct CmapSubtableLongSegmented struct CmapSubtableFormat12 : CmapSubtableLongSegmented { - static inline hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, - hb_codepoint_t u) + static hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, + hb_codepoint_t u) { return likely (group.startCharCode <= group.endCharCode) ? group.glyphID + (u - group.startCharCode) : 0; } @@ -531,13 +531,13 @@ struct CmapSubtableFormat12 : CmapSubtableLongSegmented return CmapSubtableLongSegmented::serialize (c, groups); } - static inline size_t get_sub_table_size (const hb_vector_t &groups) + static size_t get_sub_table_size (const hb_vector_t &groups) { return 16 + 12 * groups.len; } - static inline bool create_sub_table_plan (const hb_subset_plan_t *plan, - hb_vector_t *groups) + static bool create_sub_table_plan (const hb_subset_plan_t *plan, + hb_vector_t *groups) { CmapSubtableLongGroup *group = nullptr; @@ -570,9 +570,9 @@ struct CmapSubtableFormat12 : CmapSubtableLongSegmented } private: - static inline bool _is_gid_consecutive (CmapSubtableLongGroup *group, - hb_codepoint_t cp, - hb_codepoint_t new_gid) + static bool _is_gid_consecutive (CmapSubtableLongGroup *group, + hb_codepoint_t cp, + hb_codepoint_t new_gid) { return (cp - 1 == group->endCharCode) && new_gid == group->glyphID + (cp - group->startCharCode); @@ -582,8 +582,8 @@ struct CmapSubtableFormat12 : CmapSubtableLongSegmented struct CmapSubtableFormat13 : CmapSubtableLongSegmented { - static inline hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, - hb_codepoint_t u HB_UNUSED) + static hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, + hb_codepoint_t u HB_UNUSED) { return group.glyphID; } }; @@ -596,14 +596,14 @@ typedef enum struct UnicodeValueRange { - inline int cmp (const hb_codepoint_t &codepoint) const + int cmp (const hb_codepoint_t &codepoint) const { if (codepoint < startUnicodeValue) return -1; if (codepoint > startUnicodeValue + additionalCount) return +1; return 0; } - 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)); @@ -618,7 +618,7 @@ struct UnicodeValueRange struct DefaultUVS : SortedArrayOf { - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { unsigned int count = len; for (unsigned int i = 0; i < count; i++) @@ -636,12 +636,12 @@ struct DefaultUVS : SortedArrayOf struct UVSMapping { - inline int cmp (const hb_codepoint_t &codepoint) const + int cmp (const hb_codepoint_t &codepoint) const { return unicodeValue.cmp (codepoint); } - 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)); @@ -655,7 +655,7 @@ struct UVSMapping struct NonDefaultUVS : SortedArrayOf { - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { unsigned int count = len; for (unsigned int i = 0; i < count; i++) @@ -668,9 +668,9 @@ struct NonDefaultUVS : SortedArrayOf struct VariationSelectorRecord { - inline glyph_variant_t get_glyph (hb_codepoint_t codepoint, - hb_codepoint_t *glyph, - const void *base) const + glyph_variant_t get_glyph (hb_codepoint_t codepoint, + hb_codepoint_t *glyph, + const void *base) const { if ((base+defaultUVS).bfind (codepoint)) return GLYPH_VARIANT_USE_DEFAULT; @@ -683,18 +683,18 @@ struct VariationSelectorRecord return GLYPH_VARIANT_NOT_FOUND; } - inline void collect_unicodes (hb_set_t *out, const void *base) const + void collect_unicodes (hb_set_t *out, const void *base) const { (base+defaultUVS).collect_unicodes (out); (base+nonDefaultUVS).collect_unicodes (out); } - inline int cmp (const hb_codepoint_t &variation_selector) const + int cmp (const hb_codepoint_t &variation_selector) const { return varSelector.cmp (variation_selector); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -713,26 +713,26 @@ struct VariationSelectorRecord struct CmapSubtableFormat14 { - inline glyph_variant_t get_glyph_variant (hb_codepoint_t codepoint, - hb_codepoint_t variation_selector, - hb_codepoint_t *glyph) const + glyph_variant_t get_glyph_variant (hb_codepoint_t codepoint, + hb_codepoint_t variation_selector, + hb_codepoint_t *glyph) const { return record.bsearch (variation_selector).get_glyph (codepoint, glyph, this); } - inline void collect_variation_selectors (hb_set_t *out) const + void collect_variation_selectors (hb_set_t *out) const { unsigned int count = record.len; for (unsigned int i = 0; i < count; i++) out->add (record.arrayZ[i].varSelector); } - inline void collect_variation_unicodes (hb_codepoint_t variation_selector, - hb_set_t *out) const + void collect_variation_unicodes (hb_codepoint_t variation_selector, + hb_set_t *out) const { record.bsearch (variation_selector).collect_unicodes (out, this); } - 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) && @@ -753,8 +753,8 @@ struct CmapSubtable { /* Note: We intentionally do NOT implement subtable formats 2 and 8. */ - inline bool get_glyph (hb_codepoint_t codepoint, - hb_codepoint_t *glyph) const + bool get_glyph (hb_codepoint_t codepoint, + hb_codepoint_t *glyph) const { switch (u.format) { case 0: return u.format0 .get_glyph (codepoint, glyph); @@ -767,7 +767,7 @@ struct CmapSubtable default: return false; } } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { switch (u.format) { case 0: u.format0 .collect_unicodes (out); return; @@ -781,7 +781,7 @@ struct CmapSubtable } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!u.format.sanitize (c)) return_trace (false); @@ -815,7 +815,7 @@ struct CmapSubtable struct EncodingRecord { - inline int cmp (const EncodingRecord &other) const + int cmp (const EncodingRecord &other) const { int ret; ret = platformID.cmp (other.platformID); @@ -825,7 +825,7 @@ struct EncodingRecord return 0; } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -846,7 +846,7 @@ struct cmap struct subset_plan { - inline size_t final_size (void) const + size_t final_size (void) const { return 4 // header + 8 * 3 // 3 EncodingRecord @@ -858,8 +858,8 @@ struct cmap hb_vector_t format12_groups; }; - inline bool _create_plan (const hb_subset_plan_t *plan, - subset_plan *cmap_plan) const + bool _create_plan (const hb_subset_plan_t *plan, + subset_plan *cmap_plan) const { if (unlikely (!CmapSubtableFormat4::create_sub_table_plan (plan, &cmap_plan->format4_segments))) return false; @@ -867,10 +867,10 @@ struct cmap return CmapSubtableFormat12::create_sub_table_plan (plan, &cmap_plan->format12_groups); } - inline bool _subset (const hb_subset_plan_t *plan, - const subset_plan &cmap_subset_plan, - size_t dest_sz, - void *dest) const + bool _subset (const hb_subset_plan_t *plan, + const subset_plan &cmap_subset_plan, + size_t dest_sz, + void *dest) const { hb_serialize_context_t c (dest, dest_sz); @@ -928,7 +928,7 @@ struct cmap return true; } - inline bool subset (hb_subset_plan_t *plan) const + bool subset (hb_subset_plan_t *plan) const { subset_plan cmap_subset_plan; @@ -995,7 +995,7 @@ struct cmap struct accelerator_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { this->table = hb_sanitize_context_t ().reference_table (face); bool symbol; @@ -1031,22 +1031,19 @@ struct cmap } } - inline void fini (void) - { - this->table.destroy (); - } + void fini (void) { this->table.destroy (); } - inline bool get_nominal_glyph (hb_codepoint_t unicode, + bool get_nominal_glyph (hb_codepoint_t unicode, hb_codepoint_t *glyph) const { if (unlikely (!this->get_glyph_funcZ)) return false; return this->get_glyph_funcZ (this->get_glyph_data, unicode, glyph); } - inline unsigned int get_nominal_glyphs (unsigned int count, - const hb_codepoint_t *first_unicode, - unsigned int unicode_stride, - hb_codepoint_t *first_glyph, - unsigned int glyph_stride) const + unsigned int get_nominal_glyphs (unsigned int count, + const hb_codepoint_t *first_unicode, + unsigned int unicode_stride, + hb_codepoint_t *first_glyph, + unsigned int glyph_stride) const { if (unlikely (!this->get_glyph_funcZ)) return 0; @@ -1064,9 +1061,9 @@ struct cmap return done; } - inline bool get_variation_glyph (hb_codepoint_t unicode, - hb_codepoint_t variation_selector, - hb_codepoint_t *glyph) const + bool get_variation_glyph (hb_codepoint_t unicode, + hb_codepoint_t variation_selector, + hb_codepoint_t *glyph) const { switch (this->subtable_uvs->get_glyph_variant (unicode, variation_selector, @@ -1080,16 +1077,16 @@ struct cmap return get_nominal_glyph (unicode, glyph); } - inline void collect_unicodes (hb_set_t *out) const + void collect_unicodes (hb_set_t *out) const { subtable->collect_unicodes (out); } - inline void collect_variation_selectors (hb_set_t *out) const + void collect_variation_selectors (hb_set_t *out) const { subtable_uvs->collect_variation_selectors (out); } - inline void collect_variation_unicodes (hb_codepoint_t variation_selector, - hb_set_t *out) const + void collect_variation_unicodes (hb_codepoint_t variation_selector, + hb_set_t *out) const { subtable_uvs->collect_variation_unicodes (variation_selector, out); } @@ -1100,16 +1097,16 @@ struct cmap hb_codepoint_t *glyph); template - static inline bool get_glyph_from (const void *obj, - hb_codepoint_t codepoint, - hb_codepoint_t *glyph) + static bool get_glyph_from (const void *obj, + hb_codepoint_t codepoint, + hb_codepoint_t *glyph) { const Type *typed_obj = (const Type *) obj; return typed_obj->get_glyph (codepoint, glyph); } template - static inline bool get_glyph_from_symbol (const void *obj, + static bool get_glyph_from_symbol (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph) { @@ -1144,8 +1141,8 @@ struct cmap protected: - inline const CmapSubtable *find_subtable (unsigned int platform_id, - unsigned int encoding_id) const + const CmapSubtable *find_subtable (unsigned int platform_id, + unsigned int encoding_id) const { EncodingRecord key; key.platformID.set (platform_id); @@ -1160,7 +1157,7 @@ struct cmap public: - 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) && diff --git a/src/hb-ot-color-cbdt-table.hh b/src/hb-ot-color-cbdt-table.hh index 9a2be910a..8fa0ca290 100644 --- a/src/hb-ot-color-cbdt-table.hh +++ b/src/hb-ot-color-cbdt-table.hh @@ -45,13 +45,13 @@ namespace OT { struct SmallGlyphMetrics { - 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)); } - inline void get_extents (hb_glyph_extents_t *extents) const + void get_extents (hb_glyph_extents_t *extents) const { extents->x_bearing = bearingX; extents->y_bearing = bearingY; @@ -79,7 +79,7 @@ struct BigGlyphMetrics : SmallGlyphMetrics struct SBitLineMetrics { - 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)); @@ -108,7 +108,7 @@ struct SBitLineMetrics struct IndexSubtableHeader { - 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)); @@ -124,7 +124,7 @@ struct IndexSubtableHeader template struct IndexSubtableFormat1Or3 { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int glyph_count) const + bool sanitize (hb_sanitize_context_t *c, unsigned int glyph_count) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -155,7 +155,7 @@ struct IndexSubtableFormat3 : IndexSubtableFormat1Or3 {}; struct IndexSubtable { - inline bool sanitize (hb_sanitize_context_t *c, unsigned int glyph_count) const + bool sanitize (hb_sanitize_context_t *c, unsigned int glyph_count) const { TRACE_SANITIZE (this); if (!u.header.sanitize (c)) return_trace (false); @@ -166,7 +166,7 @@ struct IndexSubtable } } - inline bool get_extents (hb_glyph_extents_t *extents HB_UNUSED) const + bool get_extents (hb_glyph_extents_t *extents HB_UNUSED) const { switch (u.header.indexFormat) { case 2: case 5: /* TODO */ @@ -201,7 +201,7 @@ struct IndexSubtable struct IndexSubtableRecord { - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -209,8 +209,8 @@ struct IndexSubtableRecord offsetToSubtable.sanitize (c, base, lastGlyphIndex - firstGlyphIndex + 1)); } - inline bool get_extents (hb_glyph_extents_t *extents, - const void *base) const + bool get_extents (hb_glyph_extents_t *extents, + const void *base) const { return (base+offsetToSubtable).get_extents (extents); } @@ -237,7 +237,7 @@ struct IndexSubtableArray { friend struct CBDT; - inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const + bool sanitize (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); return_trace (indexSubtablesZ.sanitize (c, count, this)); @@ -265,7 +265,7 @@ struct BitmapSizeTable friend struct CBLC; friend struct CBDT; - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -334,7 +334,7 @@ struct CBLC enum { tableTag = HB_OT_TAG_CBLC }; - 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) && @@ -382,7 +382,7 @@ struct CBDT struct accelerator_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { cblc = hb_sanitize_context_t().reference_table (face); cbdt = hb_sanitize_context_t().reference_table (face); @@ -390,14 +390,14 @@ struct CBDT upem = hb_face_get_upem (face); } - inline void fini (void) + void fini (void) { this->cblc.destroy (); this->cbdt.destroy (); } - inline bool get_extents (hb_font_t *font, hb_codepoint_t glyph, - hb_glyph_extents_t *extents) const + bool get_extents (hb_font_t *font, hb_codepoint_t glyph, + hb_glyph_extents_t *extents) const { const void *base; const BitmapSizeTable &strike = this->cblc->choose_strike (font); @@ -452,7 +452,7 @@ struct CBDT return true; } - inline hb_blob_t* reference_png (hb_font_t *font, + hb_blob_t* reference_png (hb_font_t *font, hb_codepoint_t glyph) const { const void *base; @@ -505,7 +505,7 @@ struct CBDT return hb_blob_get_empty (); } - inline bool has_data (void) const { return cbdt.get_length (); } + bool has_data (void) const { return cbdt.get_length (); } private: hb_blob_ptr_t cblc; @@ -514,7 +514,7 @@ struct CBDT unsigned int upem; }; - 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) && diff --git a/src/hb-ot-color-colr-table.hh b/src/hb-ot-color-colr-table.hh index fd73255a2..8213f9de7 100644 --- a/src/hb-ot-color-colr-table.hh +++ b/src/hb-ot-color-colr-table.hh @@ -39,7 +39,7 @@ namespace OT { struct LayerRecord { - 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)); @@ -63,10 +63,10 @@ struct LayerRecord struct BaseGlyphRecord { - inline int cmp (hb_codepoint_t g) const + int cmp (hb_codepoint_t g) const { return g < glyphId ? -1 : g > glyphId ? 1 : 0; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -89,12 +89,12 @@ struct COLR { enum { tableTag = HB_OT_TAG_COLR }; - inline bool has_data (void) const { return numBaseGlyphs; } + bool has_data (void) const { return numBaseGlyphs; } - inline unsigned int get_glyph_layers (hb_codepoint_t glyph, - unsigned int start_offset, - unsigned int *count, /* IN/OUT. May be NULL. */ - hb_ot_color_layer_t *layers /* OUT. May be NULL. */) const + unsigned int get_glyph_layers (hb_codepoint_t glyph, + unsigned int start_offset, + unsigned int *count, /* IN/OUT. May be NULL. */ + hb_ot_color_layer_t *layers /* OUT. May be NULL. */) const { const BaseGlyphRecord &record = (this+baseGlyphsZ).bsearch (numBaseGlyphs, glyph); @@ -114,7 +114,7 @@ struct COLR return glyph_layers.len; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && diff --git a/src/hb-ot-color-cpal-table.hh b/src/hb-ot-color-cpal-table.hh index 8f3e58252..31e064829 100644 --- a/src/hb-ot-color-cpal-table.hh +++ b/src/hb-ot-color-cpal-table.hh @@ -48,39 +48,36 @@ struct CPALV1Tail friend struct CPAL; private: - inline hb_ot_color_palette_flags_t - get_palette_flags (const void *base, - unsigned int palette_index, - unsigned int palette_count) const + hb_ot_color_palette_flags_t get_palette_flags (const void *base, + unsigned int palette_index, + unsigned int palette_count) const { if (!paletteFlagsZ) return HB_OT_COLOR_PALETTE_FLAG_DEFAULT; return (hb_ot_color_palette_flags_t) (uint32_t) (base+paletteFlagsZ).as_array (palette_count)[palette_index]; } - inline hb_ot_name_id_t - get_palette_name_id (const void *base, - unsigned int palette_index, - unsigned int palette_count) const + hb_ot_name_id_t get_palette_name_id (const void *base, + unsigned int palette_index, + unsigned int palette_count) const { if (!paletteLabelsZ) return HB_OT_NAME_ID_INVALID; return (base+paletteLabelsZ).as_array (palette_count)[palette_index]; } - inline hb_ot_name_id_t - get_color_name_id (const void *base, - unsigned int color_index, - unsigned int color_count) const + hb_ot_name_id_t get_color_name_id (const void *base, + unsigned int color_index, + unsigned int color_count) const { if (!colorLabelsZ) return HB_OT_NAME_ID_INVALID; return (base+colorLabelsZ).as_array (color_count)[color_index]; } public: - inline bool sanitize (hb_sanitize_context_t *c, - const void *base, - unsigned int palette_count, - unsigned int color_count) const + bool sanitize (hb_sanitize_context_t *c, + const void *base, + unsigned int palette_count, + unsigned int color_count) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -112,27 +109,27 @@ struct CPAL { enum { tableTag = HB_OT_TAG_CPAL }; - inline bool has_data (void) const { return numPalettes; } + bool has_data (void) const { return numPalettes; } - inline unsigned int get_size (void) const + unsigned int get_size (void) const { return min_size + numPalettes * sizeof (colorRecordIndicesZ[0]); } - inline unsigned int get_palette_count (void) const { return numPalettes; } - inline unsigned int get_color_count (void) const { return numColors; } + unsigned int get_palette_count (void) const { return numPalettes; } + unsigned int get_color_count (void) const { return numColors; } - inline hb_ot_color_palette_flags_t get_palette_flags (unsigned int palette_index) const + hb_ot_color_palette_flags_t get_palette_flags (unsigned int palette_index) const { return v1 ().get_palette_flags (this, palette_index, numPalettes); } - inline hb_ot_name_id_t get_palette_name_id (unsigned int palette_index) const + hb_ot_name_id_t get_palette_name_id (unsigned int palette_index) const { return v1 ().get_palette_name_id (this, palette_index, numPalettes); } - inline hb_ot_name_id_t get_color_name_id (unsigned int color_index) const + hb_ot_name_id_t get_color_name_id (unsigned int color_index) const { return v1 ().get_color_name_id (this, color_index, numColors); } - inline unsigned int get_palette_colors (unsigned int palette_index, - unsigned int start_offset, - unsigned int *color_count, /* IN/OUT. May be NULL. */ - hb_color_t *colors /* OUT. May be NULL. */) const + unsigned int get_palette_colors (unsigned int palette_index, + unsigned int start_offset, + unsigned int *color_count, /* IN/OUT. May be NULL. */ + hb_color_t *colors /* OUT. May be NULL. */) const { if (unlikely (palette_index >= numPalettes)) { @@ -156,14 +153,14 @@ struct CPAL } private: - inline const CPALV1Tail& v1 (void) const + const CPALV1Tail& v1 (void) const { if (version == 0) return Null(CPALV1Tail); return StructAfter (*this); } public: - 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) && diff --git a/src/hb-ot-color-sbix-table.hh b/src/hb-ot-color-sbix-table.hh index a9b084350..bbfd9c006 100644 --- a/src/hb-ot-color-sbix-table.hh +++ b/src/hb-ot-color-sbix-table.hh @@ -62,20 +62,20 @@ struct SBIXGlyph struct SBIXStrike { - 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) && imageOffsetsZ.sanitize_shallow (c, c->get_num_glyphs () + 1)); } - inline hb_blob_t *get_glyph_blob (unsigned int glyph_id, - hb_blob_t *sbix_blob, - hb_tag_t file_type, - int *x_offset, - int *y_offset, - unsigned int num_glyphs, - unsigned int *strike_ppem) const + hb_blob_t *get_glyph_blob (unsigned int glyph_id, + hb_blob_t *sbix_blob, + hb_tag_t file_type, + int *x_offset, + int *y_offset, + unsigned int num_glyphs, + unsigned int *strike_ppem) const { if (unlikely (!ppem)) return hb_blob_get_empty (); /* To get Null() object out of the way. */ @@ -132,23 +132,23 @@ struct sbix { enum { tableTag = HB_OT_TAG_sbix }; - inline bool has_data (void) const { return version; } + bool has_data (void) const { return version; } - inline const SBIXStrike &get_strike (unsigned int i) const { return this+strikes[i]; } + const SBIXStrike &get_strike (unsigned int i) const { return this+strikes[i]; } struct accelerator_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { table = hb_sanitize_context_t().reference_table (face); num_glyphs = face->get_num_glyphs (); } - inline void fini (void) { table.destroy (); } + void fini (void) { table.destroy (); } - inline bool has_data (void) const { return table->has_data (); } + bool has_data (void) const { return table->has_data (); } - inline bool get_extents (hb_font_t *font, + bool get_extents (hb_font_t *font, hb_codepoint_t glyph, hb_glyph_extents_t *extents) const { @@ -156,11 +156,11 @@ struct sbix return get_png_extents (font, glyph, extents); } - inline hb_blob_t *reference_png (hb_font_t *font, - hb_codepoint_t glyph_id, - int *x_offset, - int *y_offset, - unsigned int *available_ppem) const + hb_blob_t *reference_png (hb_font_t *font, + hb_codepoint_t glyph_id, + int *x_offset, + int *y_offset, + unsigned int *available_ppem) const { return choose_strike (font).get_glyph_blob (glyph_id, table.get_blob (), HB_TAG ('p','n','g',' '), @@ -170,7 +170,7 @@ struct sbix private: - inline const SBIXStrike &choose_strike (hb_font_t *font) const + const SBIXStrike &choose_strike (hb_font_t *font) const { unsigned count = table->strikes.len; if (unlikely (!count)) @@ -220,9 +220,9 @@ struct sbix DEFINE_SIZE_STATIC (29); }; - inline bool get_png_extents (hb_font_t *font, - hb_codepoint_t glyph, - hb_glyph_extents_t *extents) const + bool get_png_extents (hb_font_t *font, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents) const { /* Following code is safe to call even without data. * But faster to short-circuit. */ @@ -261,7 +261,7 @@ struct sbix unsigned int num_glyphs; }; - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && diff --git a/src/hb-ot-color-svg-table.hh b/src/hb-ot-color-svg-table.hh index 5c424e5a0..b636e4416 100644 --- a/src/hb-ot-color-svg-table.hh +++ b/src/hb-ot-color-svg-table.hh @@ -40,17 +40,17 @@ namespace OT { struct SVGDocumentIndexEntry { - inline int cmp (hb_codepoint_t g) const + int cmp (hb_codepoint_t g) const { return g < startGlyphID ? -1 : g > endGlyphID ? 1 : 0; } - inline hb_blob_t *reference_blob (hb_blob_t *svg_blob, unsigned int index_offset) const + hb_blob_t *reference_blob (hb_blob_t *svg_blob, unsigned int index_offset) const { return hb_blob_create_sub_blob (svg_blob, index_offset + (unsigned int) svgDoc, svgDocLength); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && @@ -75,31 +75,31 @@ struct SVG { enum { tableTag = HB_OT_TAG_SVG }; - inline bool has_data (void) const { return svgDocEntries; } + bool has_data (void) const { return svgDocEntries; } struct accelerator_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { table = hb_sanitize_context_t().reference_table (face); } - inline void fini (void) { table.destroy (); } + void fini (void) { table.destroy (); } - inline hb_blob_t *reference_blob_for_glyph (hb_codepoint_t glyph_id) const + hb_blob_t *reference_blob_for_glyph (hb_codepoint_t glyph_id) const { return table->get_glyph_entry (glyph_id).reference_blob (table.get_blob (), table->svgDocEntries); } - inline bool has_data (void) const { return table->has_data (); } + bool has_data (void) const { return table->has_data (); } private: hb_blob_ptr_t table; }; - inline const SVGDocumentIndexEntry &get_glyph_entry (hb_codepoint_t glyph_id) const + const SVGDocumentIndexEntry &get_glyph_entry (hb_codepoint_t glyph_id) const { return (this+svgDocEntries).bsearch (glyph_id); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 3491b605d..6b59cb544 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -255,7 +255,7 @@ static void free_static_ot_funcs (void); static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t { - static inline hb_font_funcs_t *create (void) + static hb_font_funcs_t *create (void) { hb_font_funcs_t *funcs = hb_font_funcs_create (); diff --git a/src/hb-ot-gasp-table.hh b/src/hb-ot-gasp-table.hh index 73c5b3fcb..d328fd222 100644 --- a/src/hb-ot-gasp-table.hh +++ b/src/hb-ot-gasp-table.hh @@ -41,7 +41,7 @@ namespace OT { struct GaspRange { - 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)); @@ -59,10 +59,10 @@ struct gasp { enum { tableTag = HB_OT_TAG_gasp }; - inline const GaspRange &get_gasp_range (unsigned int i) const + const GaspRange &get_gasp_range (unsigned int i) const { return gaspRanges[i]; } - 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) && diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh index 42e4c52ad..805eb958c 100644 --- a/src/hb-ot-glyf-table.hh +++ b/src/hb-ot-glyf-table.hh @@ -47,7 +47,7 @@ struct loca enum { tableTag = HB_OT_TAG_loca }; - inline bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const + bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const { TRACE_SANITIZE (this); return_trace (true); @@ -73,7 +73,7 @@ struct glyf { enum { tableTag = HB_OT_TAG_glyf }; - inline bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const + bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const { TRACE_SANITIZE (this); /* We don't check for anything specific here. The users of the @@ -81,7 +81,7 @@ struct glyf return_trace (true); } - inline bool subset (hb_subset_plan_t *plan) const + bool subset (hb_subset_plan_t *plan) const { hb_blob_t *glyf_prime = nullptr; hb_blob_t *loca_prime = nullptr; @@ -153,7 +153,7 @@ struct glyf HBUINT16 flags; GlyphID glyphIndex; - inline unsigned int get_size (void) const + unsigned int get_size (void) const { unsigned int size = min_size; // arg1 and 2 are int16 @@ -177,7 +177,7 @@ struct glyf const char *glyph_end; const CompositeGlyphHeader *current; - inline bool move_to_next (void) + bool move_to_next (void) { if (current->flags & CompositeGlyphHeader::MORE_COMPONENTS) { @@ -191,7 +191,7 @@ struct glyf return false; } - inline bool in_range (const CompositeGlyphHeader *composite) const + bool in_range (const CompositeGlyphHeader *composite) const { return (const char *) composite >= glyph_start && ((const char *) composite + CompositeGlyphHeader::min_size) <= glyph_end @@ -199,7 +199,7 @@ struct glyf } }; - static inline bool get_iterator (const char * glyph_data, + static bool get_iterator (const char * glyph_data, unsigned int length, CompositeGlyphHeader::Iterator *iterator /* OUT */) { @@ -228,7 +228,7 @@ struct glyf struct accelerator_t { - inline void init (hb_face_t *face) + void init (hb_face_t *face) { memset (this, 0, sizeof (accelerator_t)); @@ -244,7 +244,7 @@ struct glyf num_glyphs = MAX (1u, loca_table.get_length () / (short_offset ? 2 : 4)) - 1; } - inline void fini (void) + void fini (void) { loca_table.destroy (); glyf_table.destroy (); @@ -255,8 +255,8 @@ struct glyf * If true is returned a pointer to the composite glyph will be written into * composite. */ - inline bool get_composite (hb_codepoint_t glyph, - CompositeGlyphHeader::Iterator *composite /* OUT */) const + bool get_composite (hb_codepoint_t glyph, + CompositeGlyphHeader::Iterator *composite /* OUT */) const { if (unlikely (!num_glyphs)) return false; @@ -282,7 +282,7 @@ struct glyf }; /* based on FontTools _g_l_y_f.py::trim */ - inline bool remove_padding (unsigned int start_offset, + bool remove_padding (unsigned int start_offset, unsigned int *end_offset) const { if (*end_offset - start_offset < GlyphHeader::static_size) return true; @@ -354,7 +354,7 @@ struct glyf return true; } - inline bool get_offsets (hb_codepoint_t glyph, + bool get_offsets (hb_codepoint_t glyph, unsigned int *start_offset /* OUT */, unsigned int *end_offset /* OUT */) const { @@ -381,10 +381,10 @@ struct glyf return true; } - inline bool get_instruction_offsets (unsigned int start_offset, - unsigned int end_offset, - unsigned int *instruction_start /* OUT */, - unsigned int *instruction_end /* OUT */) const + bool get_instruction_offsets (unsigned int start_offset, + unsigned int end_offset, + unsigned int *instruction_start /* OUT */, + unsigned int *instruction_end /* OUT */) const { if (end_offset - start_offset < GlyphHeader::static_size) { @@ -440,8 +440,7 @@ struct glyf return true; } - inline bool get_extents (hb_codepoint_t glyph, - hb_glyph_extents_t *extents) const + bool get_extents (hb_codepoint_t glyph, hb_glyph_extents_t *extents) const { unsigned int start_offset, end_offset; if (!get_offsets (glyph, &start_offset, &end_offset)) diff --git a/src/hb-ot-hdmx-table.hh b/src/hb-ot-hdmx-table.hh index 8e7fd1c08..1e9e27e67 100644 --- a/src/hb-ot-hdmx-table.hh +++ b/src/hb-ot-hdmx-table.hh @@ -47,19 +47,19 @@ struct DeviceRecord unsigned int sizeDeviceRecord; hb_subset_plan_t *subset_plan; - inline void init (const DeviceRecord *source_device_record, - unsigned int sizeDeviceRecord, - hb_subset_plan_t *subset_plan) + void init (const DeviceRecord *source_device_record, + unsigned int sizeDeviceRecord, + hb_subset_plan_t *subset_plan) { this->source_device_record = source_device_record; this->sizeDeviceRecord = sizeDeviceRecord; this->subset_plan = subset_plan; } - inline unsigned int len (void) const + unsigned int len (void) const { return this->subset_plan->glyphs.len; } - inline const HBUINT8* operator [] (unsigned int i) const + const HBUINT8* operator [] (unsigned int i) const { if (unlikely (i >= len ())) return nullptr; hb_codepoint_t gid = this->subset_plan->glyphs [i]; @@ -70,12 +70,10 @@ struct DeviceRecord } }; - static inline unsigned int get_size (unsigned int count) - { - return hb_ceil_to_4 (min_size + count * HBUINT8::static_size); - } + static unsigned int get_size (unsigned int count) + { return hb_ceil_to_4 (min_size + count * HBUINT8::static_size); } - inline bool serialize (hb_serialize_context_t *c, const SubsetView &subset_view) + bool serialize (hb_serialize_context_t *c, const SubsetView &subset_view) { TRACE_SERIALIZE (this); @@ -104,7 +102,7 @@ struct DeviceRecord return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c, unsigned int sizeDeviceRecord) const + bool sanitize (hb_sanitize_context_t *c, unsigned int sizeDeviceRecord) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -123,12 +121,10 @@ struct hdmx { enum { tableTag = HB_OT_TAG_hdmx }; - inline unsigned int get_size (void) const - { - return min_size + numRecords * sizeDeviceRecord; - } + unsigned int get_size (void) const + { return min_size + numRecords * sizeDeviceRecord; } - inline const DeviceRecord& operator [] (unsigned int i) const + const DeviceRecord& operator [] (unsigned int i) const { /* XXX Null(DeviceRecord) is NOT safe as it's num-glyphs lengthed. * https://github.com/harfbuzz/harfbuzz/issues/1300 */ @@ -136,7 +132,7 @@ struct hdmx return StructAtOffset (&this->firstDeviceRecord, i * sizeDeviceRecord); } - inline bool serialize (hb_serialize_context_t *c, const hdmx *source_hdmx, hb_subset_plan_t *plan) + bool serialize (hb_serialize_context_t *c, const hdmx *source_hdmx, hb_subset_plan_t *plan) { TRACE_SERIALIZE (this); @@ -158,12 +154,12 @@ struct hdmx return_trace (true); } - static inline size_t get_subsetted_size (const hdmx *source_hdmx, hb_subset_plan_t *plan) + static size_t get_subsetted_size (const hdmx *source_hdmx, hb_subset_plan_t *plan) { return min_size + source_hdmx->numRecords * DeviceRecord::get_size (plan->glyphs.len); } - inline bool subset (hb_subset_plan_t *plan) const + bool subset (hb_subset_plan_t *plan) const { size_t dest_size = get_subsetted_size (this, plan); hdmx *dest = (hdmx *) malloc (dest_size); @@ -194,7 +190,7 @@ struct hdmx return result; } - 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) && diff --git a/src/hb-ot-head-table.hh b/src/hb-ot-head-table.hh index 85867dbb9..70aadba90 100644 --- a/src/hb-ot-head-table.hh +++ b/src/hb-ot-head-table.hh @@ -47,7 +47,7 @@ struct head enum { tableTag = HB_OT_TAG_head }; - inline unsigned int get_upem (void) const + unsigned int get_upem (void) const { unsigned int upem = unitsPerEm; /* If no valid head table found, assume 1000, which matches typical Type1 usage. */ @@ -63,11 +63,11 @@ struct head CONDENSED = 1u<<5 }; - inline bool is_bold (void) const { return macStyle & BOLD; } - inline bool is_italic (void) const { return macStyle & ITALIC; } - inline bool is_condensed (void) const { return macStyle & CONDENSED; } + bool is_bold (void) const { return macStyle & BOLD; } + bool is_italic (void) const { return macStyle & ITALIC; } + bool is_condensed (void) const { return macStyle & CONDENSED; } - 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) && diff --git a/src/hb-ot-hhea-table.hh b/src/hb-ot-hhea-table.hh index 0f47c63d0..7bc1817ee 100644 --- a/src/hb-ot-hhea-table.hh +++ b/src/hb-ot-hhea-table.hh @@ -45,7 +45,7 @@ namespace OT { template struct _hea { - 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) && likely (version.major == 1)); diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index cd5e798a6..ba9f083f0 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -56,7 +56,7 @@ struct LongMetric template struct hmtxvmtx { - inline bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const + bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const { TRACE_SANITIZE (this); /* We don't check for anything specific here. The users of the @@ -65,7 +65,7 @@ struct hmtxvmtx } - inline bool subset_update_header (hb_subset_plan_t *plan, + bool subset_update_header (hb_subset_plan_t *plan, unsigned int num_hmetrics) const { hb_blob_t *src_blob = hb_sanitize_context_t ().reference_table (plan->source, H::tableTag); @@ -86,7 +86,7 @@ struct hmtxvmtx return result; } - inline bool subset (hb_subset_plan_t *plan) const + bool subset (hb_subset_plan_t *plan) const { typename T::accelerator_t _mtx; _mtx.init (plan->source); @@ -186,7 +186,7 @@ struct hmtxvmtx { friend struct hmtxvmtx; - inline void init (hb_face_t *face, + void init (hb_face_t *face, unsigned int default_advance_ = 0) { default_advance = default_advance_ ? default_advance_ : hb_face_get_upem (face); @@ -234,14 +234,14 @@ struct hmtxvmtx var_table = hb_sanitize_context_t().reference_table (face, T::variationsTag); } - inline void fini (void) + void fini (void) { table.destroy (); var_table.destroy (); } /* TODO Add variations version. */ - inline unsigned int get_side_bearing (hb_codepoint_t glyph) const + unsigned int get_side_bearing (hb_codepoint_t glyph) const { if (glyph < num_advances) return table->longMetricZ[glyph].sb; @@ -253,7 +253,7 @@ struct hmtxvmtx return bearings[glyph - num_advances]; } - inline unsigned int get_advance (hb_codepoint_t glyph) const + unsigned int get_advance (hb_codepoint_t glyph) const { if (unlikely (glyph >= num_metrics)) { @@ -269,8 +269,8 @@ struct hmtxvmtx return table->longMetricZ[MIN (glyph, (uint32_t) num_advances - 1)].advance; } - inline unsigned int get_advance (hb_codepoint_t glyph, - hb_font_t *font) const + unsigned int get_advance (hb_codepoint_t glyph, + hb_font_t *font) const { unsigned int advance = get_advance (glyph); if (likely (glyph < num_metrics)) diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index e1348b705..86b4eb6d7 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -44,7 +44,7 @@ namespace OT { template struct KernSubTableFormat3 { - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const + int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { hb_array_t kernValue = kernValueZ.as_array (kernValueCount); hb_array_t leftClass = StructAfter > (kernValue).as_array (glyphCount); @@ -59,7 +59,7 @@ struct KernSubTableFormat3 return kernValue[kernIndex[i]]; } - inline bool apply (AAT::hb_aat_apply_context_t *c) const + bool apply (AAT::hb_aat_apply_context_t *c) const { TRACE_APPLY (this); @@ -75,7 +75,7 @@ struct KernSubTableFormat3 return_trace (true); } - 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) && @@ -109,10 +109,10 @@ struct KernSubTableFormat3 template struct KernSubTable { - inline unsigned int get_size (void) const { return u.header.length; } - inline unsigned int get_type (void) const { return u.header.format; } + unsigned int get_size (void) const { return u.header.length; } + unsigned int get_type (void) const { return u.header.format; } - inline int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const + int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { switch (get_type ()) { /* This method hooks up to hb_font_t's get_h_kerning. Only support Format0. */ @@ -122,7 +122,7 @@ struct KernSubTable } template - inline typename context_t::return_t dispatch (context_t *c) const + typename context_t::return_t dispatch (context_t *c) const { unsigned int subtable_type = get_type (); TRACE_DISPATCH (this, subtable_type); @@ -135,7 +135,7 @@ struct KernSubTable } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!u.header.sanitize (c) || @@ -163,8 +163,8 @@ struct KernOTSubTableHeader enum { apple = false }; typedef AAT::ObsoleteTypes Types; - inline unsigned int tuple_count (void) const { return 0; } - inline bool is_horizontal (void) const { return (coverage & Horizontal); } + unsigned int tuple_count (void) const { return 0; } + bool is_horizontal (void) const { return (coverage & Horizontal); } enum Coverage { @@ -178,7 +178,7 @@ struct KernOTSubTableHeader Variation = 0x00u, }; - 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)); @@ -218,8 +218,8 @@ struct KernAATSubTableHeader enum { apple = true }; typedef AAT::ObsoleteTypes Types; - inline unsigned int tuple_count (void) const { return 0; } - inline bool is_horizontal (void) const { return !(coverage & Vertical); } + unsigned int tuple_count (void) const { return 0; } + bool is_horizontal (void) const { return !(coverage & Vertical); } enum Coverage { @@ -231,7 +231,7 @@ struct KernAATSubTableHeader Backwards = 0x00u, }; - 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)); @@ -271,10 +271,10 @@ struct kern { enum { tableTag = HB_OT_TAG_kern }; - inline bool has_data (void) const { return u.version32; } - inline unsigned int get_type (void) const { return u.major; } + bool has_data (void) const { return u.version32; } + unsigned int get_type (void) const { return u.major; } - inline bool has_state_machine (void) const + bool has_state_machine (void) const { switch (get_type ()) { case 0: return u.ot.has_state_machine (); @@ -283,7 +283,7 @@ struct kern } } - inline bool has_cross_stream (void) const + bool has_cross_stream (void) const { switch (get_type ()) { case 0: return u.ot.has_cross_stream (); @@ -292,7 +292,7 @@ struct kern } } - inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const + int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const { switch (get_type ()) { case 0: return u.ot.get_h_kerning (left, right); @@ -301,11 +301,11 @@ struct kern } } - inline bool apply (AAT::hb_aat_apply_context_t *c) const + bool apply (AAT::hb_aat_apply_context_t *c) const { return dispatch (c); } template - inline typename context_t::return_t dispatch (context_t *c) const + typename context_t::return_t dispatch (context_t *c) const { unsigned int subtable_type = get_type (); TRACE_DISPATCH (this, subtable_type); @@ -316,7 +316,7 @@ struct kern } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (!u.version32.sanitize (c)) return_trace (false); diff --git a/src/hb-ot-layout-base-table.hh b/src/hb-ot-layout-base-table.hh index 4c3b86126..cc6c35061 100644 --- a/src/hb-ot-layout-base-table.hh +++ b/src/hb-ot-layout-base-table.hh @@ -44,9 +44,9 @@ namespace OT { struct BaseCoordFormat1 { - inline hb_position_t get_coord (void) const { return coordinate; } + hb_position_t get_coord (void) const { return coordinate; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this))); @@ -61,13 +61,13 @@ struct BaseCoordFormat1 struct BaseCoordFormat2 { - inline hb_position_t get_coord (void) const + hb_position_t get_coord (void) const { /* TODO */ return coordinate; } - 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)); @@ -85,9 +85,9 @@ struct BaseCoordFormat2 struct BaseCoordFormat3 { - inline hb_position_t get_coord (hb_font_t *font, - const VariationStore &var_store, - hb_direction_t direction) const + hb_position_t get_coord (hb_font_t *font, + const VariationStore &var_store, + hb_direction_t direction) const { const Device &device = this+deviceTable; return coordinate + (HB_DIRECTION_IS_VERTICAL (direction) ? @@ -96,7 +96,7 @@ struct BaseCoordFormat3 } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -116,9 +116,9 @@ struct BaseCoordFormat3 struct BaseCoord { - inline hb_position_t get_coord (hb_font_t *font, - const VariationStore &var_store, - hb_direction_t direction) const + hb_position_t get_coord (hb_font_t *font, + const VariationStore &var_store, + hb_direction_t direction) const { switch (u.format) { case 1: return u.format1.get_coord (); @@ -128,7 +128,7 @@ struct BaseCoord } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!u.format.sanitize (c))) return_trace (false); @@ -162,13 +162,13 @@ struct FeatMinMaxRecord 0; } - inline void get_min_max (const BaseCoord **min, const BaseCoord **max) const + void get_min_max (const BaseCoord **min, const BaseCoord **max) const { if (likely (min)) *min = &(this+minCoord); if (likely (max)) *max = &(this+maxCoord); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -194,7 +194,7 @@ struct FeatMinMaxRecord struct MinMax { - inline void get_min_max (hb_tag_t feature_tag, + void get_min_max (hb_tag_t feature_tag, const BaseCoord **min, const BaseCoord **max) const { @@ -213,7 +213,7 @@ struct MinMax } } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -241,13 +241,13 @@ struct MinMax struct BaseValues { - inline const BaseCoord &get_base_coord (int baseline_tag_index) const + const BaseCoord &get_base_coord (int baseline_tag_index) const { if (baseline_tag_index == -1) baseline_tag_index = defaultIndex; return this+baseCoords[baseline_tag_index]; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -280,10 +280,10 @@ struct BaseLangSysRecord 0; } - inline const MinMax &get_min_max (void) const + const MinMax &get_min_max (void) const { return this+minMax; } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -301,7 +301,7 @@ struct BaseLangSysRecord struct BaseScript { - inline const MinMax &get_min_max (hb_tag_t language_tag) const + const MinMax &get_min_max (hb_tag_t language_tag) const { /* TODO Replace hb_bsearch() with .bsearch(). */ const BaseLangSysRecord* record = (const BaseLangSysRecord *) @@ -312,12 +312,12 @@ struct BaseScript return record ? record->get_min_max () : this+defaultMinMax; } - inline const BaseCoord &get_base_coord (int baseline_tag_index) const + const BaseCoord &get_base_coord (int baseline_tag_index) const { return (this+baseValues).get_base_coord (baseline_tag_index); } - inline bool is_empty (void) const { return !baseValues; } + bool is_empty (void) const { return !baseValues; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -354,10 +354,10 @@ struct BaseScriptRecord 0; } - inline const BaseScript &get_base_script (const BaseScriptList *list) const + const BaseScript &get_base_script (const BaseScriptList *list) const { return list+baseScript; } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -376,7 +376,7 @@ struct BaseScriptRecord struct BaseScriptList { - inline const BaseScriptRecord *find_record (hb_tag_t script) const + const BaseScriptRecord *find_record (hb_tag_t script) const { /* TODO Replace hb_bsearch() with .bsearch(). */ return (const BaseScriptRecord *) hb_bsearch (&script, baseScriptRecords.arrayZ, @@ -386,7 +386,7 @@ struct BaseScriptList } /* TODO: Or client should handle fallback? */ - inline const BaseScript &get_base_script (hb_tag_t script) const + const BaseScript &get_base_script (hb_tag_t script) const { const BaseScriptRecord *record = find_record (script); if (!record) record = find_record ((hb_script_t) HB_TAG ('D','F','L','T')); @@ -394,7 +394,7 @@ struct BaseScriptList return record ? record->get_base_script (this) : Null (BaseScript); } - 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) && @@ -411,7 +411,7 @@ struct BaseScriptList struct Axis { - inline bool get_baseline (hb_ot_layout_baseline_t baseline, + bool get_baseline (hb_ot_layout_baseline_t baseline, hb_tag_t script_tag, hb_tag_t language_tag, const BaseCoord **coord) const @@ -424,11 +424,11 @@ struct Axis return true; } - inline bool get_min_max (hb_tag_t script_tag, - hb_tag_t language_tag, - hb_tag_t feature_tag, - const BaseCoord **min_coord, - const BaseCoord **max_coord) const + bool get_min_max (hb_tag_t script_tag, + hb_tag_t language_tag, + hb_tag_t feature_tag, + const BaseCoord **min_coord, + const BaseCoord **max_coord) const { const BaseScript &base_script = (this+baseScriptList).get_base_script (script_tag); if (base_script.is_empty ()) return false; @@ -438,7 +438,7 @@ struct Axis return true; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && @@ -466,18 +466,18 @@ struct BASE { enum { tableTag = HB_OT_TAG_BASE }; - inline const Axis &get_axis (hb_direction_t direction) const + const Axis &get_axis (hb_direction_t direction) const { return HB_DIRECTION_IS_VERTICAL (direction) ? this+vAxis : this+hAxis; } - inline const VariationStore &get_var_store (void) const + const VariationStore &get_var_store (void) const { return version.to_int () < 0x00010001u ? Null (VariationStore) : this+varStore; } - inline bool get_baseline (hb_font_t *font, - hb_ot_layout_baseline_t baseline, - hb_direction_t direction, - hb_tag_t script_tag, - hb_tag_t language_tag, - hb_position_t *base) const + bool get_baseline (hb_font_t *font, + hb_ot_layout_baseline_t baseline, + hb_direction_t direction, + hb_tag_t script_tag, + hb_tag_t language_tag, + hb_position_t *base) const { const BaseCoord *base_coord; if (!get_axis (direction).get_baseline (baseline, script_tag, language_tag, &base_coord)) @@ -490,13 +490,13 @@ struct BASE } /* TODO: Expose this separately sometime? */ - inline bool get_min_max (hb_font_t *font, - hb_direction_t direction, - hb_tag_t script_tag, - hb_tag_t language_tag, - hb_tag_t feature_tag, - hb_position_t *min, - hb_position_t *max) + bool get_min_max (hb_font_t *font, + hb_direction_t direction, + hb_tag_t script_tag, + hb_tag_t language_tag, + hb_tag_t feature_tag, + hb_position_t *min, + hb_position_t *max) { const BaseCoord *min_coord, *max_coord; if (!get_axis (direction).get_min_max (script_tag, language_tag, feature_tag, @@ -509,7 +509,7 @@ struct BASE return true; } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (likely (c->check_struct (this) && diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index b519fdea1..d96e34cd3 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -86,11 +86,9 @@ struct Record_sanitize_closure_t { template struct Record { - inline int cmp (hb_tag_t a) const { - return tag.cmp (a); - } + int cmp (hb_tag_t a) const { return tag.cmp (a); } - inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + bool sanitize (hb_sanitize_context_t *c, const void *base) const { TRACE_SANITIZE (this); const Record_sanitize_closure_t closure = {tag, base}; @@ -108,15 +106,15 @@ struct Record template struct RecordArrayOf : SortedArrayOf > { - inline const OffsetTo& get_offset (unsigned int i) const + const OffsetTo& get_offset (unsigned int i) const { return (*this)[i].offset; } - inline OffsetTo& get_offset (unsigned int i) + OffsetTo& get_offset (unsigned int i) { return (*this)[i].offset; } - inline const Tag& get_tag (unsigned int i) const + const Tag& get_tag (unsigned int i) const { return (*this)[i].tag; } - inline unsigned int get_tags (unsigned int start_offset, - unsigned int *record_count /* IN/OUT */, - hb_tag_t *record_tags /* OUT */) const + unsigned int get_tags (unsigned int start_offset, + unsigned int *record_count /* IN/OUT */, + hb_tag_t *record_tags /* OUT */) const { if (record_count) { const Record *arr = this->sub_array (start_offset, record_count); @@ -126,7 +124,7 @@ struct RecordArrayOf : SortedArrayOf > } return this->len; } - inline bool find_index (hb_tag_t tag, unsigned int *index) const + bool find_index (hb_tag_t tag, unsigned int *index) const { return this->bfind (tag, index, HB_BFIND_NOT_FOUND_STORE, Index::NOT_FOUND_INDEX); } @@ -135,10 +133,10 @@ struct RecordArrayOf : SortedArrayOf > template struct RecordListOf : RecordArrayOf { - inline const Type& operator [] (unsigned int i) const + const Type& operator [] (unsigned int i) const { return this+this->get_offset (i); } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); struct RecordListOf *out = c->serializer->embed (*this); @@ -149,7 +147,7 @@ struct RecordListOf : RecordArrayOf return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c) const + bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); return_trace (RecordArrayOf::sanitize (c, this)); @@ -159,23 +157,21 @@ struct RecordListOf : RecordArrayOf struct RangeRecord { - inline int cmp (hb_codepoint_t g) const { - return g < start ? -1 : g <= end ? 0 : +1 ; - } + int cmp (hb_codepoint_t g) const + { return g < start ? -1 : g <= end ? 0 : +1; } - 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)); } - inline bool intersects (const hb_set_t *glyphs) const + bool intersects (const hb_set_t *glyphs) const { return glyphs->intersects (start, end); } template - inline bool add_coverage (set_t *glyphs) const { - return glyphs->add_range (start, end); - } + bool add_coverage (set_t *glyphs) const + { return glyphs->add_range (start, end); } GlyphID start; /* First GlyphID in the range */ GlyphID end; /* Last GlyphID in the range */ @@ -188,9 +184,9 @@ DECLARE_NULL_NAMESPACE_BYTES (OT, RangeRecord); struct IndexArray : ArrayOf { - inline unsigned int get_indexes (unsigned int start_offset, - unsigned int *_count /* IN/OUT */, - unsigned int *_indexes /* OUT */) const + unsigned int get_indexes (unsigned int start_offset, + unsigned int *_count /* IN/OUT */, + unsigned int *_indexes /* OUT */) const { if (_count) { const HBUINT16 *arr = this->sub_array (start_offset, _count); @@ -201,7 +197,7 @@ struct IndexArray : ArrayOf return this->len; } - inline void add_indexes_to (hb_set_t* output /* OUT */) const + void add_indexes_to (hb_set_t* output /* OUT */) const { output->add_array (arrayZ, len); } @@ -215,33 +211,33 @@ struct Feature; struct LangSys { - inline unsigned int get_feature_count (void) const + unsigned int get_feature_count (void) const { return featureIndex.len; } - inline hb_tag_t get_feature_index (unsigned int i) const + hb_tag_t get_feature_index (unsigned int i) const { return featureIndex[i]; } - inline unsigned int get_feature_indexes (unsigned int start_offset, - unsigned int *feature_count /* IN/OUT */, - unsigned int *feature_indexes /* OUT */) const + unsigned int get_feature_indexes (unsigned int start_offset, + unsigned int *feature_count /* IN/OUT */, + unsigned int *feature_indexes /* OUT */) const { return featureIndex.get_indexes (start_offset, feature_count, feature_indexes); } - inline void add_feature_indexes_to (hb_set_t *feature_indexes) const + void add_feature_indexes_to (hb_set_t *feature_indexes) const { featureIndex.add_indexes_to (feature_indexes); } - inline bool has_required_feature (void) const { return reqFeatureIndex != 0xFFFFu; } - inline unsigned int get_required_feature_index (void) const + bool has_required_feature (void) const { return reqFeatureIndex != 0xFFFFu; } + unsigned int get_required_feature_index (void) const { if (reqFeatureIndex == 0xFFFFu) return Index::NOT_FOUND_INDEX; return reqFeatureIndex;; } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); return_trace (c->serializer->embed (*this)); } - inline bool sanitize (hb_sanitize_context_t *c, - const Record_sanitize_closure_t * = nullptr) const + bool sanitize (hb_sanitize_context_t *c, + const Record_sanitize_closure_t * = nullptr) const { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && featureIndex.sanitize (c)); @@ -260,26 +256,26 @@ DECLARE_NULL_NAMESPACE_BYTES (OT, LangSys); struct Script { - inline unsigned int get_lang_sys_count (void) const + unsigned int get_lang_sys_count (void) const { return langSys.len; } - inline const Tag& get_lang_sys_tag (unsigned int i) const + const Tag& get_lang_sys_tag (unsigned int i) const { return langSys.get_tag (i); } - inline unsigned int get_lang_sys_tags (unsigned int start_offset, - unsigned int *lang_sys_count /* IN/OUT */, - hb_tag_t *lang_sys_tags /* OUT */) const + unsigned int get_lang_sys_tags (unsigned int start_offset, + unsigned int *lang_sys_count /* IN/OUT */, + hb_tag_t *lang_sys_tags /* OUT */) const { return langSys.get_tags (start_offset, lang_sys_count, lang_sys_tags); } - inline const LangSys& get_lang_sys (unsigned int i) const + const LangSys& get_lang_sys (unsigned int i) const { if (i == Index::NOT_FOUND_INDEX) return get_default_lang_sys (); return this+langSys[i].offset; } - inline bool find_lang_sys_index (hb_tag_t tag, unsigned int *index) const + bool find_lang_sys_index (hb_tag_t tag, unsigned int *index) const { return langSys.find_index (tag, index); } - inline bool has_default_lang_sys (void) const { return defaultLangSys != 0; } - inline const LangSys& get_default_lang_sys (void) const { return this+defaultLangSys; } + bool has_default_lang_sys (void) const { return defaultLangSys != 0; } + const LangSys& get_default_lang_sys (void) const { return this+defaultLangSys; } - inline bool subset (hb_subset_context_t *c) const + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); struct Script *out = c->serializer->embed (*this); @@ -291,8 +287,8 @@ struct Script return_trace (true); } - inline bool sanitize (hb_sanitize_context_t *c, - const Record_sanitize_closure_t * = nullptr) const + bool sanitize (hb_sanitize_context_t *c, + const Record_sanitize_closure_t * = nullptr) const { TRACE_SANITIZE (this); return_trace (defaultLangSys.sanitize (c, this) && langSys.sanitize (c, this)); @@ -315,7 +311,7 @@ typedef RecordListOf