diff --git a/src/OT/Layout/GPOS/MarkBasePosFormat1.hh b/src/OT/Layout/GPOS/MarkBasePosFormat1.hh index 033299786..f44774661 100644 --- a/src/OT/Layout/GPOS/MarkBasePosFormat1.hh +++ b/src/OT/Layout/GPOS/MarkBasePosFormat1.hh @@ -72,7 +72,7 @@ struct MarkBasePosFormat1_2 const Coverage &get_coverage () const { return this+markCoverage; } - static inline bool accept (hb_buffer_t *buffer, unsigned idx) + static bool accept (hb_buffer_t *buffer, unsigned idx) { /* We only want to attach to the first of a MultipleSubst sequence. * https://github.com/harfbuzz/harfbuzz/issues/740 diff --git a/src/OT/Layout/GPOS/MarkLigPosFormat1.hh b/src/OT/Layout/GPOS/MarkLigPosFormat1.hh index b1c3252c0..a15cd611d 100644 --- a/src/OT/Layout/GPOS/MarkLigPosFormat1.hh +++ b/src/OT/Layout/GPOS/MarkLigPosFormat1.hh @@ -70,7 +70,7 @@ struct MarkLigPosFormat1_2 const Coverage &get_coverage () const { return this+markCoverage; } - static inline bool accept (hb_buffer_t *buffer, unsigned idx) + static bool accept (hb_buffer_t *buffer, unsigned idx) { /* We only want to attach to the first of a MultipleSubst sequence, * which might have been ligated into a preceding ligature, and in that diff --git a/src/OT/Layout/GPOS/ValueFormat.hh b/src/OT/Layout/GPOS/ValueFormat.hh index 1357afb49..1ef0b202a 100644 --- a/src/OT/Layout/GPOS/ValueFormat.hh +++ b/src/OT/Layout/GPOS/ValueFormat.hh @@ -322,18 +322,14 @@ struct ValueFormat : HBUINT16 return true; } - static inline Offset16To& get_device (Value* value) - { - return *static_cast *> (value); - } - static inline const Offset16To& get_device (const Value* value) - { - return *static_cast *> (value); - } - static inline const Device& get_device (const Value* value, - bool *worked, - const ValueBase *base, - hb_sanitize_context_t &c) + static Offset16To& get_device (Value* value) + { return *static_cast *> (value); } + static const Offset16To& get_device (const Value* value) + { return *static_cast *> (value); } + static const Device& get_device (const Value* value, + bool *worked, + const ValueBase *base, + hb_sanitize_context_t &c) { if (worked) *worked |= bool (*value); auto &offset = *static_cast *> (value); @@ -386,7 +382,7 @@ struct ValueFormat : HBUINT16 } } - static inline const HBINT16& get_short (const Value* value, bool *worked=nullptr) + static const HBINT16& get_short (const Value* value, bool *worked=nullptr) { if (worked) *worked |= bool (*value); return *reinterpret_cast (value); diff --git a/src/OT/Layout/GSUB/SubstLookup.hh b/src/OT/Layout/GSUB/SubstLookup.hh index cb91b4ab2..e36308598 100644 --- a/src/OT/Layout/GSUB/SubstLookup.hh +++ b/src/OT/Layout/GSUB/SubstLookup.hh @@ -18,7 +18,7 @@ struct SubstLookup : Lookup const SubTable& get_subtable (unsigned int i) const { return Lookup::get_subtable (i); } - static inline bool lookup_type_is_reverse (unsigned int lookup_type) + static bool lookup_type_is_reverse (unsigned int lookup_type) { return lookup_type == SubTable::ReverseChainSingle; } bool is_reverse () const @@ -199,7 +199,7 @@ struct SubstLookup : Lookup static inline typename hb_closure_context_t::return_t closure_glyphs_recurse_func (hb_closure_context_t *c, unsigned lookup_index, hb_set_t *covered_seq_indices, unsigned seq_index, unsigned end_index); - static inline hb_closure_context_t::return_t dispatch_closure_recurse_func (hb_closure_context_t *c, unsigned lookup_index, hb_set_t *covered_seq_indices, unsigned seq_index, unsigned end_index) + static hb_closure_context_t::return_t dispatch_closure_recurse_func (hb_closure_context_t *c, unsigned lookup_index, hb_set_t *covered_seq_indices, unsigned seq_index, unsigned end_index) { if (!c->should_visit_lookup (lookup_index)) return hb_empty_t (); @@ -216,7 +216,7 @@ struct SubstLookup : Lookup static inline hb_depend_context_t::return_t depend_glyphs_recurse_func (hb_depend_context_t *c, unsigned lookup_index, hb_bit_page_t *covered_seq_indices, unsigned seq_index, unsigned end_index); - static inline hb_depend_context_t::return_t dispatch_depend_recurse_func (hb_depend_context_t *c, unsigned lookup_index, hb_bit_page_t *covered_seq_indices, unsigned seq_index, unsigned end_index) + static hb_depend_context_t::return_t dispatch_depend_recurse_func (hb_depend_context_t *c, unsigned lookup_index, hb_bit_page_t *covered_seq_indices, unsigned seq_index, unsigned end_index) { return depend_glyphs_recurse_func (c, lookup_index, covered_seq_indices, seq_index, end_index); } diff --git a/src/hb-bit-page.hh b/src/hb-bit-page.hh index 3392ae940..7b03059aa 100644 --- a/src/hb-bit-page.hh +++ b/src/hb-bit-page.hh @@ -42,8 +42,7 @@ struct hb_vector_size_t elt_t& operator [] (unsigned int i) { return v[i]; } const elt_t& operator [] (unsigned int i) const { return v[i]; } - static inline constexpr unsigned len () - { return byte_size / sizeof (elt_t); } + static constexpr unsigned len () { return byte_size / sizeof (elt_t); } void init0 () { @@ -121,8 +120,7 @@ struct hb_bit_page_t void dirty () { population = UINT_MAX; } - static inline constexpr unsigned len () - { return vector_t::len (); } + static constexpr unsigned len () { return vector_t::len (); } operator bool () const { return !is_empty (); } bool is_empty () const diff --git a/src/hb-bit-set.hh b/src/hb-bit-set.hh index 4957a0cf0..62dc24825 100644 --- a/src/hb-bit-set.hh +++ b/src/hb-bit-set.hh @@ -199,7 +199,7 @@ struct hb_bit_set_t /* Duplicated here from hb-machinery.hh to avoid including it. */ template - static inline const Type& StructAtOffsetUnaligned(const void *P, unsigned int offset) + static const Type& StructAtOffsetUnaligned(const void *P, unsigned int offset) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" diff --git a/src/hb-blob.hh b/src/hb-blob.hh index cd5254dca..ed2bfab2a 100644 --- a/src/hb-blob.hh +++ b/src/hb-blob.hh @@ -103,7 +103,7 @@ struct hb_blob_t unsigned capacity; }; - static inline void recycle_data_destroy (void *user_data) + static void recycle_data_destroy (void *user_data) { auto *bd = (recycle_data_t *) user_data; hb_free (bd->buf); @@ -117,7 +117,7 @@ struct hb_blob_t * fails and a fresh buffer was allocated instead -- the caller * must hb_free() that buf after recycle_finalize() runs. Returns * nullptr on allocation failure. */ - static inline char * + static char * recycle_acquire (hb_blob_t *recycled, unsigned needed, unsigned *out_capacity, @@ -162,7 +162,7 @@ struct hb_blob_t * If @recycled is one of our blobs, update and return it (cheap); * otherwise create a new blob. Pass @replaced_recycled_buf from * recycle_acquire(). */ - static inline hb_blob_t * + static hb_blob_t * recycle_finalize (char *buf, unsigned capacity, unsigned length, @@ -200,7 +200,7 @@ struct hb_blob_t /* Discard @buf returned by recycle_acquire without committing to * a blob. Frees @buf if it was a fresh allocation; leaves any * recycled buffer untouched. */ - static inline void + static void recycle_abort (char *buf, hb_blob_t *recycled) { if (!buf) return; @@ -216,7 +216,7 @@ struct hb_blob_t * encode. Destroys any previously stashed blob. Safe to call * with @blob = nullptr or the empty-singleton blob (treated as * "drop"). */ - static inline void + static void recycle_stash (hb_blob_t **slot, hb_blob_t *blob) { hb_blob_destroy (*slot); diff --git a/src/hb-cff-specializer.hh b/src/hb-cff-specializer.hh index d1d18a797..12bf3dc56 100644 --- a/src/hb-cff-specializer.hh +++ b/src/hb-cff-specializer.hh @@ -33,7 +33,7 @@ is_zero (const number_t &n) * * Based on fontTools.cffLib.specializer.generalizeCommands */ -static void +static inline void generalize_commands (hb_vector_t &commands) { hb_vector_t result; @@ -149,7 +149,7 @@ generalize_commands (hb_vector_t &commands) * * This ensures we never exceed stack depth while optimizing bytecode. */ -static void +static inline void specialize_commands (hb_vector_t &commands, unsigned maxstack = 48) { @@ -242,7 +242,7 @@ specialize_commands (hb_vector_t &commands, } /* Encode commands back to binary CharString */ -static bool +static inline bool encode_commands (const hb_vector_t &commands, str_buff_t &output) { diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 19866863c..242058cbf 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -748,7 +748,7 @@ struct hb_range_iter_t : { return v != o.v; } private: - static inline T end_for (T start, T end_, S step) + static T end_for (T start, T end_, S step) { if (!step) return end_; diff --git a/src/hb-map.hh b/src/hb-map.hh index 6b73ac29a..d56ba8d0a 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -126,10 +126,10 @@ struct hb_hashmap_t template - static inline const V& default_value () { return Null(V); }; + static const V& default_value () { return Null(V); }; template - static inline const V& default_value () + static const V& default_value () { static_assert (hb_is_same (V, hb_codepoint_t), ""); return minus_1; diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 7b4754aca..19e0f4e43 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2490,7 +2490,7 @@ struct delta_row_encoding_t bool in_error () const { return chars.in_error () || items.in_error (); } - static inline unsigned get_chars_overhead (unsigned num_columns) + static unsigned get_chars_overhead (unsigned num_columns) { unsigned c = 4 + 6; // 4 bytes for LOffset, 6 bytes for VarData header return c + num_columns * 2; diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 341d78b63..d1b94ca91 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -1131,9 +1131,9 @@ struct hb_ot_apply_context_t : typedef return_t (*recurse_func_t) (hb_ot_apply_context_t *c, unsigned int lookup_index); template - static inline auto apply_ (const T &obj, hb_ot_apply_context_t *c, hb_priority<1>) HB_RETURN (return_t, obj.apply (c, nullptr) ) + static auto apply_ (const T &obj, hb_ot_apply_context_t *c, hb_priority<1>) HB_RETURN (return_t, obj.apply (c, nullptr) ) template - static inline auto apply_ (const T &obj, hb_ot_apply_context_t *c, hb_priority<0>) HB_RETURN (return_t, obj.apply (c) ) + static auto apply_ (const T &obj, hb_ot_apply_context_t *c, hb_priority<0>) HB_RETURN (return_t, obj.apply (c) ) template return_t dispatch (const T &obj) { return apply_(obj, this, hb_prioritize); } @@ -1420,21 +1420,21 @@ struct hb_accelerate_subtables_context_t : hb_dispatch_context_t { template - static inline auto collect_second_glyphs_ (const T &obj, - hb_set_digest_t *digest, - hb_priority<1>) HB_RETURN (void, obj.collect_second_glyphs (digest) ) + static auto collect_second_glyphs_ (const T &obj, + hb_set_digest_t *digest, + hb_priority<1>) HB_RETURN (void, obj.collect_second_glyphs (digest) ) template - static inline void collect_second_glyphs_ (const T &obj HB_UNUSED, - hb_set_digest_t *digest, - hb_priority<0>) + static void collect_second_glyphs_ (const T &obj HB_UNUSED, + hb_set_digest_t *digest, + hb_priority<0>) { *digest = hb_set_digest_t::full (); } template - static inline auto apply_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<1>) HB_RETURN (bool, obj->apply (c, external_cache) ) + static auto apply_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<1>) HB_RETURN (bool, obj->apply (c, external_cache) ) template - static inline auto apply_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<0>) HB_RETURN (bool, obj->apply (c) ) + static auto apply_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<0>) HB_RETURN (bool, obj->apply (c) ) template - static inline bool apply_to (const void *obj, hb_ot_apply_context_t *c, void *external_cache) + static bool apply_to (const void *obj, hb_ot_apply_context_t *c, void *external_cache) { const T *typed_obj = (const T *) obj; return apply_ (typed_obj, c, external_cache, hb_prioritize); @@ -1442,32 +1442,30 @@ struct hb_accelerate_subtables_context_t : #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE template - static inline auto apply_cached_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<2>) HB_RETURN (bool, obj->apply_cached (c, external_cache) ) + static auto apply_cached_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<2>) HB_RETURN (bool, obj->apply_cached (c, external_cache) ) template - static inline auto apply_cached_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<1>) HB_RETURN (bool, obj->apply (c, external_cache) ) + static auto apply_cached_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<1>) HB_RETURN (bool, obj->apply (c, external_cache) ) template - static inline auto apply_cached_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<0>) HB_RETURN (bool, obj->apply (c) ) + static auto apply_cached_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<0>) HB_RETURN (bool, obj->apply (c) ) template - static inline bool apply_cached_to (const void *obj, hb_ot_apply_context_t *c, void *external_cache) + static bool apply_cached_to (const void *obj, hb_ot_apply_context_t *c, void *external_cache) { const T *typed_obj = (const T *) obj; return apply_cached_ (typed_obj, c, external_cache, hb_prioritize); } template - static inline auto cache_func_ (hb_ot_apply_context_t *c, - hb_ot_subtable_cache_op_t op, - hb_priority<1>) HB_RETURN (bool, T::cache_func (c, op) ) + static auto cache_func_ (hb_ot_apply_context_t *c, + hb_ot_subtable_cache_op_t op, + hb_priority<1>) HB_RETURN (bool, T::cache_func (c, op) ) template - static inline bool cache_func_ (hb_ot_apply_context_t *c, - hb_ot_subtable_cache_op_t op HB_UNUSED, - hb_priority<0>) { return false; } + static bool cache_func_ (hb_ot_apply_context_t *c, + hb_ot_subtable_cache_op_t op HB_UNUSED, + hb_priority<0>) { return false; } template - static inline bool cache_func_to (hb_ot_apply_context_t *c, - hb_ot_subtable_cache_op_t op) - { - return cache_func_ (c, op, hb_prioritize); - } + static bool cache_func_to (hb_ot_apply_context_t *c, + hb_ot_subtable_cache_op_t op) + { return cache_func_ (c, op, hb_prioritize); } #endif typedef bool (*hb_apply_func_t) (const void *obj, hb_ot_apply_context_t *c, void *external_cache); diff --git a/src/hb-utf.hh b/src/hb-utf.hh index 59531313b..9f0c95d37 100644 --- a/src/hb-utf.hh +++ b/src/hb-utf.hh @@ -37,7 +37,7 @@ struct hb_utf8_t typedef uint8_t codepoint_t; static constexpr unsigned max_len = 4; - static inline const codepoint_t * + static const codepoint_t * next (const codepoint_t *text, const codepoint_t *end, hb_codepoint_t *unicode, @@ -106,7 +106,7 @@ struct hb_utf8_t return text; } - static inline const codepoint_t * + static const codepoint_t * prev (const codepoint_t *text, const codepoint_t *start, hb_codepoint_t *unicode, @@ -185,7 +185,7 @@ struct hb_utf16_xe_t typedef TCodepoint codepoint_t; static constexpr unsigned max_len = 2; - static inline const codepoint_t * + static const codepoint_t * next (const codepoint_t *text, const codepoint_t *end, hb_codepoint_t *unicode, @@ -217,7 +217,7 @@ struct hb_utf16_xe_t return text; } - static inline const codepoint_t * + static const codepoint_t * prev (const codepoint_t *text, const codepoint_t *start, hb_codepoint_t *unicode, @@ -294,7 +294,7 @@ struct hb_utf32_xe_t typedef TCodepoint codepoint_t; static constexpr unsigned max_len = 1; - static inline const TCodepoint * + static const TCodepoint * next (const TCodepoint *text, const TCodepoint *end HB_UNUSED, hb_codepoint_t *unicode, @@ -306,7 +306,7 @@ struct hb_utf32_xe_t return text; } - static inline const TCodepoint * + static const TCodepoint * prev (const TCodepoint *text, const TCodepoint *start HB_UNUSED, hb_codepoint_t *unicode, @@ -353,7 +353,7 @@ struct hb_latin1_t typedef uint8_t codepoint_t; static constexpr unsigned max_len = 1; - static inline const codepoint_t * + static const codepoint_t * next (const codepoint_t *text, const codepoint_t *end HB_UNUSED, hb_codepoint_t *unicode, @@ -363,7 +363,7 @@ struct hb_latin1_t return text; } - static inline const codepoint_t * + static const codepoint_t * prev (const codepoint_t *text, const codepoint_t *start HB_UNUSED, hb_codepoint_t *unicode, @@ -405,7 +405,7 @@ struct hb_ascii_t typedef uint8_t codepoint_t; static constexpr unsigned max_len = 1; - static inline const codepoint_t * + static const codepoint_t * next (const codepoint_t *text, const codepoint_t *end HB_UNUSED, hb_codepoint_t *unicode, @@ -417,7 +417,7 @@ struct hb_ascii_t return text; } - static inline const codepoint_t * + static const codepoint_t * prev (const codepoint_t *text, const codepoint_t *start HB_UNUSED, hb_codepoint_t *unicode,