From c3dd21f11087f1e4cda82dcd6667cae508ca4543 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 09:11:08 -0700 Subject: [PATCH 01/13] [cff] Remove unneeded init/fini --- src/hb-subset-cff1.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index b4e24122c..40ab224cb 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -377,7 +377,6 @@ struct cff_subset_plan { subset_localsubrs.init (); fontdicts_mod.init (); subset_enc_code_ranges.init (); - subset_enc_supp_codes.init (); subset_charset_ranges.init (); sidmap.init (); for (unsigned int i = 0; i < name_dict_values_t::ValCount; i++) @@ -394,7 +393,6 @@ struct cff_subset_plan { subset_localsubrs.fini_deep (); fontdicts_mod.fini (); subset_enc_code_ranges.fini (); - subset_enc_supp_codes.fini (); subset_charset_ranges.fini (); sidmap.fini (); } From de2cef42b4b6fba68d5b7baa53019af257ba2110 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 09:21:31 -0700 Subject: [PATCH 02/13] [bimap] Remove init/fini --- src/hb-bimap.hh | 14 -------------- src/hb-ot-layout-common.hh | 9 --------- src/hb-ot-var-hvar-table.hh | 7 ++----- src/hb-subset-cff-common.hh | 19 +------------------ src/hb-subset-cff1.cc | 8 -------- src/hb-subset-cff2.cc | 2 -- 6 files changed, 3 insertions(+), 56 deletions(-) diff --git a/src/hb-bimap.hh b/src/hb-bimap.hh index d466af8b6..a9e1278de 100644 --- a/src/hb-bimap.hh +++ b/src/hb-bimap.hh @@ -33,20 +33,6 @@ /* Bi-directional map */ struct hb_bimap_t { - /* XXX(remove) */ - void init () - { - forw_map.init (); - back_map.init (); - } - - /* XXX(remove) */ - void fini () - { - forw_map.fini (); - back_map.fini (); - } - void reset () { forw_map.reset (); diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 930edde12..60a190615 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2930,8 +2930,6 @@ struct VariationStore hb_vector_t inner_maps; inner_maps.resize ((unsigned) dataSets.len); - for (unsigned i = 0; i < inner_maps.length; i++) - inner_maps[i].init (); for (unsigned idx : c->plan->layout_variation_indices->iter ()) { @@ -2939,18 +2937,11 @@ struct VariationStore uint16_t minor = idx & 0xFFFF; if (major >= inner_maps.length) - { - for (unsigned i = 0; i < inner_maps.length; i++) - inner_maps[i].fini (); return_trace (false); - } inner_maps[major].add (minor); } varstore_prime->serialize (c->serializer, this, inner_maps.as_array ()); - for (unsigned i = 0; i < inner_maps.length; i++) - inner_maps[i].fini (); - return_trace ( !c->serializer->in_error() && varstore_prime->dataSets); diff --git a/src/hb-ot-var-hvar-table.hh b/src/hb-ot-var-hvar-table.hh index 074b6a378..e9d90352f 100644 --- a/src/hb-ot-var-hvar-table.hh +++ b/src/hb-ot-var-hvar-table.hh @@ -177,9 +177,6 @@ struct hvarvvar_subset_plan_t inner_maps.resize (var_store->get_sub_table_count ()); - for (unsigned int i = 0; i < inner_maps.length; i++) - inner_maps[i].init (); - if (unlikely (!index_map_plans.length || !inner_sets.length || !inner_maps.length)) return; bool retain_adv_map = false; @@ -229,8 +226,8 @@ struct hvarvvar_subset_plan_t for (unsigned int i = 0; i < inner_sets.length; i++) hb_set_destroy (inner_sets[i]); hb_set_destroy (adv_set); - inner_maps.fini_deep (); - index_map_plans.fini_deep (); + inner_maps.fini (); + index_map_plans.fini (); } hb_inc_bimap_t outer_map; diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index 7fd96ca86..f02d57599 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -526,19 +526,9 @@ struct subr_remap_t : hb_inc_bimap_t struct subr_remaps_t { - subr_remaps_t () - { - global_remap.init (); - local_remaps.init (); - } - - ~subr_remaps_t () { fini (); } - void init (unsigned int fdCount) { - if (unlikely (!local_remaps.resize (fdCount))) return; - for (unsigned int i = 0; i < fdCount; i++) - local_remaps[i].init (); + local_remaps.resize (fdCount); } bool in_error() @@ -553,12 +543,6 @@ struct subr_remaps_t local_remaps[i].create (closures.local_closures[i]); } - void fini () - { - global_remap.fini (); - local_remaps.fini_deep (); - } - subr_remap_t global_remap; hb_vector_t local_remaps; }; @@ -577,7 +561,6 @@ struct subr_subsetter_t ~subr_subsetter_t () { closures.fini (); - remaps.fini (); parsed_charstrings.fini_deep (); parsed_global_subrs.fini_deep (); parsed_local_subrs.fini_deep (); diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index 40ab224cb..3bdef6080 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -371,14 +371,10 @@ struct cff_subset_plan { { topdict_mod.init (); subset_fdselect_ranges.init (); - fdmap.init (); subset_charstrings.init (); subset_globalsubrs.init (); - subset_localsubrs.init (); - fontdicts_mod.init (); subset_enc_code_ranges.init (); subset_charset_ranges.init (); - sidmap.init (); for (unsigned int i = 0; i < name_dict_values_t::ValCount; i++) topDictModSIDs[i] = CFF_UNDEF_SID; } @@ -387,14 +383,10 @@ struct cff_subset_plan { { topdict_mod.fini (); subset_fdselect_ranges.fini (); - fdmap.fini (); subset_charstrings.fini_deep (); subset_globalsubrs.fini_deep (); - subset_localsubrs.fini_deep (); - fontdicts_mod.fini (); subset_enc_code_ranges.fini (); subset_charset_ranges.fini (); - sidmap.fini (); } void plan_subset_encoding (const OT::cff1::accelerator_subset_t &acc, hb_subset_plan_t *plan) diff --git a/src/hb-subset-cff2.cc b/src/hb-subset-cff2.cc index 896ae6401..abad2d99c 100644 --- a/src/hb-subset-cff2.cc +++ b/src/hb-subset-cff2.cc @@ -242,7 +242,6 @@ struct cff2_subset_plan { desubroutinize (false) { subset_fdselect_ranges.init (); - fdmap.init (); subset_charstrings.init (); subset_globalsubrs.init (); subset_localsubrs.init (); @@ -251,7 +250,6 @@ struct cff2_subset_plan { ~cff2_subset_plan () { subset_fdselect_ranges.fini (); - fdmap.fini (); subset_charstrings.fini_deep (); subset_globalsubrs.fini_deep (); subset_localsubrs.fini_deep (); From 035f03346ddc673a3617822e45103d67a11cd62c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 09:26:30 -0700 Subject: [PATCH 03/13] [str_buff_vec_t] Remove unused fini method --- src/hb-ot-cff-common.hh | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index 180c87cb8..c102c1517 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -68,8 +68,6 @@ struct code_pair_t typedef hb_vector_t str_buff_t; struct str_buff_vec_t : hb_vector_t { - void fini () { SUPER::fini_deep (); } - unsigned int total_size () const { unsigned int size = 0; From a1e9a276eb2dee1c1b0503072a0e6bbefc1dd62f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 09:27:32 -0700 Subject: [PATCH 04/13] [subset-cff2] Drop an constructor/destructor pair --- src/hb-subset-cff2.cc | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/src/hb-subset-cff2.cc b/src/hb-subset-cff2.cc index abad2d99c..294267617 100644 --- a/src/hb-subset-cff2.cc +++ b/src/hb-subset-cff2.cc @@ -233,27 +233,6 @@ struct cff2_subr_subsetter_t : subr_subsetter_t subset_fdselect_ranges; hb_inc_bimap_t fdmap; @@ -330,8 +309,8 @@ struct cff2_subset_plan { str_buff_vec_t subset_globalsubrs; hb_vector_t subset_localsubrs; - bool drop_hints; - bool desubroutinize; + bool drop_hints = false; + bool desubroutinize = false; }; static bool _serialize_cff2 (hb_serialize_context_t *c, From 07474aa8c6f8a4d4bff92501e2e19143cfe8e91f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 09:29:43 -0700 Subject: [PATCH 05/13] [subset-cff1] Remove a constructor/destructor pair --- src/hb-subset-cff1.cc | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index 3bdef6080..35fecd67b 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -362,33 +362,11 @@ struct cff1_subr_subsetter_t : subr_subsetter_t subset_fdselect_ranges; /* font dict index remap table from fullset FDArray to subset FDArray. @@ -676,7 +654,7 @@ struct cff_subset_plan { hb_vector_t subset_localsubrs; hb_vector_t fontdicts_mod; - bool drop_hints; + bool drop_hints = false; bool gid_renum; bool subset_encoding; @@ -692,7 +670,7 @@ struct cff_subset_plan { remap_sid_t sidmap; unsigned int topDictModSIDs[name_dict_values_t::ValCount]; - bool desubroutinize; + bool desubroutinize = false; }; static bool _serialize_cff1 (hb_serialize_context_t *c, From a48aa9850acf89a1ba36fa812195d6428f80b9a6 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 09:32:58 -0700 Subject: [PATCH 06/13] [subset-cff] Remove another set of fini_deep --- src/hb-subset-cff-common.hh | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index f02d57599..268e288b0 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -416,16 +416,6 @@ struct parsed_cs_str_t : parsed_values_t struct parsed_cs_str_vec_t : hb_vector_t { - void init (unsigned int len_ = 0) - { - SUPER::init (); - if (unlikely (!resize (len_))) - return; - for (unsigned int i = 0; i < length; i++) - (*this)[i].init (); - } - void fini () { SUPER::fini_deep (); } - private: typedef hb_vector_t SUPER; }; @@ -552,19 +542,7 @@ struct subr_subsetter_t { subr_subsetter_t (ACC &acc_, const hb_subset_plan_t *plan_) : acc (acc_), plan (plan_) - { - parsed_charstrings.init (); - parsed_global_subrs.init (); - parsed_local_subrs.init (); - } - - ~subr_subsetter_t () - { - closures.fini (); - parsed_charstrings.fini_deep (); - parsed_global_subrs.fini_deep (); - parsed_local_subrs.fini_deep (); - } + {} /* Subroutine subsetting with --no-desubroutinize runs in phases: * @@ -585,8 +563,8 @@ struct subr_subsetter_t closures.init (acc.fdCount); remaps.init (acc.fdCount); - parsed_charstrings.init (plan->num_output_glyphs ()); - parsed_global_subrs.init (acc.globalSubrs->count); + parsed_charstrings.resize (plan->num_output_glyphs ()); + parsed_global_subrs.resize (acc.globalSubrs->count); if (unlikely (remaps.in_error() || parsed_charstrings.in_error () @@ -598,7 +576,7 @@ struct subr_subsetter_t for (unsigned int i = 0; i < acc.fdCount; i++) { - parsed_local_subrs[i].init (acc.privateDicts[i].localSubrs->count); + parsed_local_subrs[i].resize (acc.privateDicts[i].localSubrs->count); if (unlikely (parsed_local_subrs[i].in_error ())) return false; } if (unlikely (!closures.valid)) From f1dc8b087cf08970c6c96b0052ec46a10892cc66 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Tue, 18 Jan 2022 10:29:04 -0800 Subject: [PATCH 07/13] [subset-cff] Convert subr_closures_t to constructor/destructor instead of init/fini. --- src/hb-subset-cff-common.hh | 50 ++++++++++--------------------------- 1 file changed, 13 insertions(+), 37 deletions(-) diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index 268e288b0..039b1c5a5 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -275,45 +275,24 @@ struct subr_flattener_t struct subr_closures_t { - subr_closures_t () : valid (false), global_closure (nullptr) - { local_closures.init (); } - - void init (unsigned int fd_count) + subr_closures_t (unsigned int fd_count) : valid (false), global_closure (), local_closures () { valid = true; - global_closure = hb_set_create (); - if (global_closure == hb_set_get_empty ()) - valid = false; if (!local_closures.resize (fd_count)) valid = false; - - for (unsigned int i = 0; i < local_closures.length; i++) - { - local_closures[i] = hb_set_create (); - if (local_closures[i] == hb_set_get_empty ()) - valid = false; - } - } - - void fini () - { - hb_set_destroy (global_closure); - for (unsigned int i = 0; i < local_closures.length; i++) - hb_set_destroy (local_closures[i]); - local_closures.fini (); } void reset () { - hb_set_clear (global_closure); + global_closure.clear(); for (unsigned int i = 0; i < local_closures.length; i++) - hb_set_clear (local_closures[i]); + local_closures[i].clear(); } bool is_valid () const { return valid; } bool valid; - hb_set_t *global_closure; - hb_vector_t local_closures; + hb_set_t global_closure; + hb_vector_t local_closures; }; struct parsed_cs_op_t : op_str_t @@ -486,7 +465,7 @@ struct subr_subset_param_t struct subr_remap_t : hb_inc_bimap_t { - void create (hb_set_t *closure) + void create (const hb_set_t *closure) { /* create a remapping of subroutine numbers from old to new. * no optimization based on usage counts. fonttools doesn't appear doing that either. @@ -516,7 +495,7 @@ struct subr_remap_t : hb_inc_bimap_t struct subr_remaps_t { - void init (unsigned int fdCount) + subr_remaps_t (unsigned int fdCount) { local_remaps.resize (fdCount); } @@ -528,9 +507,9 @@ struct subr_remaps_t void create (subr_closures_t& closures) { - global_remap.create (closures.global_closure); + global_remap.create (&closures.global_closure); for (unsigned int i = 0; i < local_remaps.length; i++) - local_remaps[i].create (closures.local_closures[i]); + local_remaps[i].create (&closures.local_closures[i]); } subr_remap_t global_remap; @@ -541,7 +520,7 @@ template num_output_glyphs ()); parsed_global_subrs.resize (acc.globalSubrs->count); @@ -599,7 +575,7 @@ struct subr_subsetter_t subr_subset_param_t param; param.init (&parsed_charstrings[i], &parsed_global_subrs, &parsed_local_subrs[fd], - closures.global_closure, closures.local_closures[fd], + &closures.global_closure, &closures.local_closures[fd], plan->flags & HB_SUBSET_FLAGS_NO_HINTING); if (unlikely (!interp.interpret (param))) @@ -623,7 +599,7 @@ struct subr_subsetter_t subr_subset_param_t param; param.init (&parsed_charstrings[i], &parsed_global_subrs, &parsed_local_subrs[fd], - closures.global_closure, closures.local_closures[fd], + &closures.global_closure, &closures.local_closures[fd], plan->flags & HB_SUBSET_FLAGS_NO_HINTING); drop_hints_param_t drop; @@ -648,7 +624,7 @@ struct subr_subsetter_t subr_subset_param_t param; param.init (&parsed_charstrings[i], &parsed_global_subrs, &parsed_local_subrs[fd], - closures.global_closure, closures.local_closures[fd], + &closures.global_closure, &closures.local_closures[fd], plan->flags & HB_SUBSET_FLAGS_NO_HINTING); collect_subr_refs_in_str (parsed_charstrings[i], param); } From 213e3f09b11cd6fb67295ad758beffd490d62ed6 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 09:39:46 -0700 Subject: [PATCH 08/13] [vector] Add TODO Emplace? --- src/hb-vector.hh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hb-vector.hh b/src/hb-vector.hh index f5df8364f..c0b75539b 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -193,6 +193,7 @@ struct hb_vector_t template Type *push (T&& v) { + /* TODO Emplace? */ Type *p = push (); if (p == &Crap (Type)) // If push failed to allocate then don't copy v, since this may cause From 29f60d1eaad663b8519930145e7f4c4d88429dce Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 11:58:16 -0700 Subject: [PATCH 09/13] [cff] Remove init/fini from blend_arg_t --- src/hb-cff2-interp-cs.hh | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/hb-cff2-interp-cs.hh b/src/hb-cff2-interp-cs.hh index 8e6dede88..766183760 100644 --- a/src/hb-cff2-interp-cs.hh +++ b/src/hb-cff2-interp-cs.hh @@ -35,18 +35,6 @@ using namespace OT; struct blend_arg_t : number_t { - void init () - { - number_t::init (); - deltas.init (); - } - - void fini () - { - number_t::fini (); - deltas.fini_deep (); - } - void set_int (int v) { reset_blends (); number_t::set_int (v); } void set_fixed (int32_t v) { reset_blends (); number_t::set_fixed (v); } void set_real (double v) { reset_blends (); number_t::set_real (v); } From 4eb6e6ea16e0b4f6ac7271929849c3e8f52c8cc6 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 12:07:05 -0700 Subject: [PATCH 10/13] [cff] Remove some more fini_deep() --- src/hb-ot-cff1-table.hh | 4 ++-- src/hb-ot-cff2-table.hh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index 5dd183e3a..a8c0434fc 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -1144,8 +1144,8 @@ struct cff1 { sc.end_processing (); topDict.fini (); - fontDicts.fini_deep (); - privateDicts.fini_deep (); + fontDicts.fini (); + privateDicts.fini (); hb_blob_destroy (blob); blob = nullptr; } diff --git a/src/hb-ot-cff2-table.hh b/src/hb-ot-cff2-table.hh index 829217fea..667ff87d0 100644 --- a/src/hb-ot-cff2-table.hh +++ b/src/hb-ot-cff2-table.hh @@ -475,8 +475,8 @@ struct cff2 { sc.end_processing (); topDict.fini (); - fontDicts.fini_deep (); - privateDicts.fini_deep (); + fontDicts.fini (); + privateDicts.fini (); hb_blob_destroy (blob); blob = nullptr; } From 6ef83c2c31b4355f2eeee7d241e2c6bb52f6d6b3 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 13:08:34 -0700 Subject: [PATCH 11/13] [vector] Remove .fini_deep() --- src/hb-cff-interp-common.hh | 4 ++-- src/hb-vector.hh | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/hb-cff-interp-common.hh b/src/hb-cff-interp-common.hh index c251e2d0e..b5e63f4fe 100644 --- a/src/hb-cff-interp-common.hh +++ b/src/hb-cff-interp-common.hh @@ -383,7 +383,7 @@ struct cff_stack_t for (unsigned int i = 0; i < elements.length; i++) elements[i].init (); } - void fini () { elements.fini_deep (); } + void fini () { elements.fini (); } ELEM& operator [] (unsigned int i) { @@ -553,7 +553,7 @@ struct parsed_values_t opStart = 0; values.init (); } - void fini () { values.fini_deep (); } + void fini () { values.fini (); } void add_op (op_code_t op, const byte_str_ref_t& str_ref = byte_str_ref_t ()) { diff --git a/src/hb-vector.hh b/src/hb-vector.hh index c0b75539b..97311a29d 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -86,13 +86,6 @@ struct hb_vector_t hb_free (arrayZ); init (); } - void fini_deep () - { - unsigned int count = length; - for (unsigned int i = 0; i < count; i++) - arrayZ[i].fini (); - fini (); - } void reset () { From 8d24ac26623f5645783b8e36e39c9f5c635e0191 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 13:14:42 -0700 Subject: [PATCH 12/13] [cff] Remove init/fini from number_t --- src/hb-cff-interp-common.hh | 7 +------ src/hb-cff-interp-cs-common.hh | 9 +-------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/hb-cff-interp-common.hh b/src/hb-cff-interp-common.hh index b5e63f4fe..53c29f7e8 100644 --- a/src/hb-cff-interp-common.hh +++ b/src/hb-cff-interp-common.hh @@ -217,9 +217,6 @@ inline unsigned int OpCode_Size (op_code_t op) { return Is_OpCode_ESC (op) ? 2: struct number_t { - void init () { set_real (0.0); } - void fini () {} - void set_int (int v) { value = v; } int to_int () const { return value; } @@ -245,7 +242,7 @@ struct number_t } protected: - double value; + double value = 0.; }; /* byte string */ @@ -380,8 +377,6 @@ struct cff_stack_t count = 0; elements.init (); elements.resize (kSizeLimit); - for (unsigned int i = 0; i < elements.length; i++) - elements[i].init (); } void fini () { elements.fini (); } diff --git a/src/hb-cff-interp-cs-common.hh b/src/hb-cff-interp-cs-common.hh index 52d778ffe..ef299369b 100644 --- a/src/hb-cff-interp-cs-common.hh +++ b/src/hb-cff-interp-cs-common.hh @@ -94,12 +94,6 @@ struct biased_subrs_t struct point_t { - void init () - { - x.init (); - y.init (); - } - void set_int (int _x, int _y) { x.set_int (_x); @@ -128,7 +122,7 @@ struct cs_interp_env_t : interp_env_t hstem_count = 0; vstem_count = 0; hintmask_size = 0; - pt.init (); + pt.set_int (0, 0); callStack.init (); globalSubrs.init (globalSubrs_); localSubrs.init (localSubrs_); @@ -841,7 +835,6 @@ struct path_procs_t if (likely (env.argStack.get_count () == 11)) { point_t d; - d.init (); for (unsigned int i = 0; i < 10; i += 2) d.move (env.eval_arg (i), env.eval_arg (i+1)); From fe783ac091b94ff6d0c9060fde229594b4e635e1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Jan 2022 13:38:28 -0700 Subject: [PATCH 13/13] [cff] Remove op_str_t nop init/fini --- src/hb-cff-interp-common.hh | 3 --- src/hb-subset-cff-common.hh | 3 --- 2 files changed, 6 deletions(-) diff --git a/src/hb-cff-interp-common.hh b/src/hb-cff-interp-common.hh index 53c29f7e8..641de0eff 100644 --- a/src/hb-cff-interp-common.hh +++ b/src/hb-cff-interp-common.hh @@ -518,9 +518,6 @@ struct arg_stack_t : cff_stack_t /* an operator prefixed by its operands in a byte string */ struct op_str_t { - void init () {} - void fini () {} - op_code_t op; byte_str_t str; }; diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index 039b1c5a5..18657705f 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -299,15 +299,12 @@ struct parsed_cs_op_t : op_str_t { void init (unsigned int subr_num_ = 0) { - op_str_t::init (); subr_num = subr_num_; drop_flag = false; keep_flag = false; skip_flag = false; } - void fini () { op_str_t::fini (); } - bool for_drop () const { return drop_flag; } void set_drop () { if (!for_keep ()) drop_flag = true; }