From a60ba7964ea196a3a02c48e813f2d9505d0cded2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 1 May 2018 19:01:25 -0400 Subject: [PATCH] s/finish/fini For consistency. --- src/hb-common.cc | 8 ++++---- src/hb-mutex-private.hh | 2 +- src/hb-object-private.hh | 10 +++++----- src/hb-ot-layout-private.hh | 4 ++-- src/hb-ot-map-private.hh | 14 +++++++------- src/hb-ot-post-table.hh | 2 +- src/hb-ot-shape-private.hh | 4 ++-- src/hb-ot-shape.cc | 2 +- src/hb-private.hh | 16 ++++++++-------- src/hb-set-private.hh | 6 +++--- src/hb-set.cc | 2 +- src/hb-subset-glyf.cc | 6 +++--- src/hb-subset-plan.cc | 6 +++--- src/hb-subset.cc | 2 +- 14 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/hb-common.cc b/src/hb-common.cc index bc54db67..f38ebb04 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 49ed10e0..14bde310 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 f23f90ac..75a72f4b 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 9bcbf1cb..2454920c 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 e6bd8ea5..9cfe3668 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 1441e2cb..f3605242 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 fe5d2b7f..fddb757c 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 263d65c0..dd10e346 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 7e6d8e51..d27d5805 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 5ccefc89..df3326b3 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 deb8d29a..d5163c78 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 b9e6355c..372832f1 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 f8a09efe..1784aefb 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 5da46c79..41f44533 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); } -- GitLab