diff --git a/src/hb-common.cc b/src/hb-common.cc index bc54db67b4205147d184566cd356256fd40e95d4..f38ebb043a9ea6cf5042fdf8f376b45bf2f513a6 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -225,7 +225,7 @@ struct hb_language_item_t { inline 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 finish() below. + badly with a call to the custom free() in fini() below. Therefore don't call strdup(), implement its behavior. */ size_t len = strlen(s) + 1; @@ -240,7 +240,7 @@ struct hb_language_item_t { return *this; } - void finish (void) { free ((void *) lang); } + void fini (void) { free ((void *) lang); } }; @@ -259,7 +259,7 @@ retry: while (first_lang) { hb_language_item_t *next = first_lang->next; - first_lang->finish (); + first_lang->fini (); free (first_lang); first_lang = next; } @@ -289,7 +289,7 @@ retry: } if (!hb_atomic_ptr_cmpexch (&langs, first_lang, lang)) { - lang->finish (); + lang->fini (); free (lang); goto retry; } diff --git a/src/hb-mutex-private.hh b/src/hb-mutex-private.hh index 49ed10e08a6949b3dc88713be79f984da825caa5..14bde3103e12ae688c73be1daa1586e5c14ded05 100644 --- a/src/hb-mutex-private.hh +++ b/src/hb-mutex-private.hh @@ -134,7 +134,7 @@ struct hb_mutex_t 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 finish (void) { hb_mutex_impl_finish (&m); } + inline void fini (void) { hb_mutex_impl_finish (&m); } }; diff --git a/src/hb-object-private.hh b/src/hb-object-private.hh index f23f90acc77fd1e728b101f338ff8748efbc6806..75a72f4bb6b8aa6771c0fdc220dd5c93100e3284 100644 --- a/src/hb-object-private.hh +++ b/src/hb-object-private.hh @@ -53,7 +53,7 @@ struct hb_reference_count_t inline int get_unsafe (void) const { return ref_count.get_unsafe (); } inline int inc (void) { return ref_count.inc (); } inline int dec (void) { return ref_count.dec (); } - inline void finish (void) { ref_count.set_unsafe (HB_REFERENCE_COUNT_POISON_VALUE); } + inline void fini (void) { ref_count.set_unsafe (HB_REFERENCE_COUNT_POISON_VALUE); } inline bool is_inert (void) const { return ref_count.get_unsafe () == HB_REFERENCE_COUNT_INERT_VALUE; } inline bool is_valid (void) const { return ref_count.get_unsafe () > 0; } @@ -73,7 +73,7 @@ struct hb_user_data_array_t 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; } - void finish (void) { if (destroy) destroy (data); } + void fini (void) { if (destroy) destroy (data); } }; hb_mutex_t lock; @@ -88,7 +88,7 @@ struct hb_user_data_array_t HB_INTERNAL void *get (hb_user_data_key_t *key); - inline void finish (void) { items.finish (lock); lock.finish (); } + inline void fini (void) { items.fini (lock); lock.fini (); } }; @@ -171,8 +171,8 @@ static inline bool hb_object_destroy (Type *obj) template static inline void hb_object_fini (Type *obj) { - obj->header.ref_count.finish (); /* Do this before user_data */ - obj->header.user_data.finish (); + obj->header.ref_count.fini (); /* Do this before user_data */ + obj->header.user_data.fini (); } template static inline bool hb_object_set_user_data (Type *obj, diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index 9bcbf1cbc9beaaaa332d5362f4d721af8ae2fd99..2454920cd60f487a385985a8872e56a0610262ae 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -105,12 +105,12 @@ HB_INTERNAL void hb_ot_layout_position_start (hb_font_t *font, hb_buffer_t *buffer); -/* Should be called after all the position_lookup's are done, to finish advances. */ +/* Should be called after all the position_lookup's are done, to fini advances. */ HB_INTERNAL void hb_ot_layout_position_finish_advances (hb_font_t *font, hb_buffer_t *buffer); -/* Should be called after hb_ot_layout_position_finish_advances, to finish offsets. */ +/* Should be called after hb_ot_layout_position_finish_advances, to fini offsets. */ HB_INTERNAL void hb_ot_layout_position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer); diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh index e6bd8ea5ef34aa671902a7b6069c7cef944a41f1..9cfe366809121143fce48fe2542d919c64363e90 100644 --- a/src/hb-ot-map-private.hh +++ b/src/hb-ot-map-private.hh @@ -130,12 +130,12 @@ struct hb_ot_map_t HB_INTERNAL void substitute (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const; HB_INTERNAL void position (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const; - inline void finish (void) { - features.finish (); + inline void fini (void) { + features.fini (); for (unsigned int table_index = 0; table_index < 2; table_index++) { - lookups[table_index].finish (); - stages[table_index].finish (); + lookups[table_index].fini (); + stages[table_index].fini (); } } @@ -187,11 +187,11 @@ struct hb_ot_map_builder_t const int *coords, unsigned int num_coords); - inline void finish (void) { - feature_infos.finish (); + inline void fini (void) { + feature_infos.fini (); for (unsigned int table_index = 0; table_index < 2; table_index++) { - stages[table_index].finish (); + stages[table_index].fini (); } } diff --git a/src/hb-ot-post-table.hh b/src/hb-ot-post-table.hh index 1441e2cbbba9deca561bbe2b9481ecb40a999fdc..f3605242378711ed62d63b15f6d03185eff368f3 100644 --- a/src/hb-ot-post-table.hh +++ b/src/hb-ot-post-table.hh @@ -134,7 +134,7 @@ struct post } inline void fini (void) { - index_to_offset.finish (); + index_to_offset.fini (); free (gids_sorted_by_name); } diff --git a/src/hb-ot-shape-private.hh b/src/hb-ot-shape-private.hh index fe5d2b7f33331b3e9674cc555ebb654a2038b651..fddb757c5277b1dcfc47a7b7495fcd49ef64242d 100644 --- a/src/hb-ot-shape-private.hh +++ b/src/hb-ot-shape-private.hh @@ -59,7 +59,7 @@ struct hb_ot_shape_plan_t inline void substitute (hb_font_t *font, hb_buffer_t *buffer) const { map.substitute (this, font, buffer); } inline void position (hb_font_t *font, hb_buffer_t *buffer) const { map.position (this, font, buffer); } - void finish (void) { map.finish (); } + void fini (void) { map.fini (); } }; struct hb_ot_shape_planner_t @@ -75,7 +75,7 @@ struct hb_ot_shape_planner_t props (master_plan->props), shaper (nullptr), map (face, &props) {} - ~hb_ot_shape_planner_t (void) { map.finish (); } + ~hb_ot_shape_planner_t (void) { map.fini (); } inline void compile (hb_ot_shape_plan_t &plan, const int *coords, diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 263d65c0ccb466fdf9dc94fee21ab837fb32f039..dd10e346e3744e7627fe33d791122a02e71e3773 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -204,7 +204,7 @@ _hb_ot_shaper_shape_plan_data_destroy (hb_ot_shaper_shape_plan_data_t *plan) if (plan->shaper->data_destroy) plan->shaper->data_destroy (const_cast (plan->data)); - plan->finish (); + plan->fini (); free (plan); } diff --git a/src/hb-private.hh b/src/hb-private.hh index 7e6d8e510bb3b46cc67020b063407ad96ae49891..d27d5805100662ded434a3ad4562f6baeeb539cc 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -691,7 +691,7 @@ struct hb_prealloced_array_t return false; } - inline void finish (void) + inline void fini (void) { if (array != static_array) free (array); @@ -704,7 +704,7 @@ template struct hb_auto_array_t : hb_prealloced_array_t { hb_auto_array_t (void) { hb_prealloced_array_t::init (); } - ~hb_auto_array_t (void) { hb_prealloced_array_t::finish (); } + ~hb_auto_array_t (void) { hb_prealloced_array_t::fini (); } }; @@ -726,7 +726,7 @@ struct hb_lockable_set_t item_t old = *item; *item = v; l.unlock (); - old.finish (); + old.fini (); } else { item = nullptr; @@ -751,7 +751,7 @@ struct hb_lockable_set_t *item = items[items.len - 1]; items.pop (); l.unlock (); - old.finish (); + old.fini (); } else { l.unlock (); } @@ -782,11 +782,11 @@ struct hb_lockable_set_t return item; } - inline void finish (lock_t &l) + inline void fini (lock_t &l) { if (!items.len) { /* No need for locking. */ - items.finish (); + items.fini (); return; } l.lock (); @@ -794,10 +794,10 @@ struct hb_lockable_set_t item_t old = items[items.len - 1]; items.pop (); l.unlock (); - old.finish (); + old.fini (); l.lock (); } - items.finish (); + items.fini (); l.unlock (); } diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh index 5ccefc899cb0c4cc5e71d285acb86c7c46f9ef07..df3326b34d8b4b51ef6c590d0f5f4de45067a6ed 100644 --- a/src/hb-set-private.hh +++ b/src/hb-set-private.hh @@ -200,10 +200,10 @@ struct hb_set_t page_map.init (); pages.init (); } - inline void finish (void) + inline void fini (void) { - page_map.finish (); - pages.finish (); + page_map.fini (); + pages.fini (); } inline bool resize (unsigned int count) diff --git a/src/hb-set.cc b/src/hb-set.cc index deb8d29af8180cb7b757e87a027113d65871fdf3..d5163c7840e4447ea0fc61e288baa948e1bf017c 100644 --- a/src/hb-set.cc +++ b/src/hb-set.cc @@ -96,7 +96,7 @@ hb_set_destroy (hb_set_t *set) { if (!hb_object_destroy (set)) return; - set->finish (); + set->fini (); free (set); } diff --git a/src/hb-subset-glyf.cc b/src/hb-subset-glyf.cc index b9e6355c35f9026b85e89b4e18909b58df0b3c82..372832f1418548b44177ce4d28d383abbb67dc23 100644 --- a/src/hb-subset-glyf.cc +++ b/src/hb-subset-glyf.cc @@ -248,7 +248,7 @@ _hb_subset_glyf_and_loca (const OT::glyf::accelerator_t &glyf, &glyf_prime_size, &loca_prime_size, &instruction_ranges))) { - instruction_ranges.finish(); + instruction_ranges.fini(); return false; } @@ -261,10 +261,10 @@ _hb_subset_glyf_and_loca (const OT::glyf::accelerator_t &glyf, loca_prime_size, loca_prime_data))) { free (glyf_prime_data); free (loca_prime_data); - instruction_ranges.finish(); + instruction_ranges.fini(); return false; } - instruction_ranges.finish(); + instruction_ranges.fini(); *glyf_prime = hb_blob_create (glyf_prime_data, glyf_prime_size, diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index f8a09efe4d116999fbd08eceec3d5bc25659e41f..1784aefbd2c420893d35bbb9ceee6664f48fe529 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -216,9 +216,9 @@ hb_subset_plan_destroy (hb_subset_plan_t *plan) { if (!hb_object_destroy (plan)) return; - plan->codepoints.finish (); - plan->gids_to_retain.finish (); - plan->gids_to_retain_sorted.finish (); + plan->codepoints.fini (); + plan->gids_to_retain.fini (); + plan->gids_to_retain_sorted.fini (); hb_face_destroy (plan->source); hb_face_destroy (plan->dest); diff --git a/src/hb-subset.cc b/src/hb-subset.cc index 5da46c7978400c4fb19392063a87b62d9ecd99f9..41f4453376ac5d5d704bd351926854afd2fee768 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -144,7 +144,7 @@ _hb_subset_face_data_destroy (void *user_data) for (unsigned int i = 0; i < data->tables.len; i++) hb_blob_destroy (data->tables[i].blob); - data->tables.finish (); + data->tables.fini (); free (data); }