[dispatch] Fix debug builds

This commit is contained in:
Behdad Esfahbod 2020-06-19 08:30:59 -07:00
parent bb9a40da65
commit 1535440b48
7 changed files with 5 additions and 16 deletions

View File

@ -820,7 +820,6 @@ struct hb_aat_apply_context_t :
/* Unused. For debug tracing only. */
unsigned int lookup_index;
unsigned int debug_depth;
HB_INTERNAL hb_aat_apply_context_t (const hb_ot_shape_plan_t *plan_,
hb_font_t *font_,

View File

@ -56,8 +56,7 @@ AAT::hb_aat_apply_context_t::hb_aat_apply_context_t (const hb_ot_shape_plan_t *p
buffer (buffer_),
sanitizer (),
ankr_table (&Null (AAT::ankr)),
lookup_index (0),
debug_depth (0)
lookup_index (0)
{
sanitizer.init (blob);
sanitizer.set_num_glyphs (face->get_num_glyphs ());

View File

@ -38,13 +38,13 @@
template <typename Context, typename Return=hb_empty_t, unsigned int MaxDebugDepth=0>
struct hb_dispatch_context_t
{
hb_dispatch_context_t () : debug_depth (0) {}
private:
/* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
const Context* thiz () const { return static_cast<const Context *> (this); }
Context* thiz () { return static_cast< Context *> (this); }
public:
const char *get_name () { return "UNKNOWN"; }
static constexpr unsigned debug_depth = 0;
static constexpr unsigned max_debug_depth = MaxDebugDepth;
typedef Return return_t;
template <typename T, typename F>
@ -54,6 +54,7 @@ struct hb_dispatch_context_t
{ return obj.dispatch (thiz (), hb_forward<Ts> (ds)...); }
static return_t no_dispatch_return_value () { return Context::default_return_value (); }
static bool stop_sublookup_iteration (const return_t r HB_UNUSED) { return false; }
unsigned debug_depth;
};

View File

@ -126,7 +126,6 @@ struct hb_subset_layout_context_t :
const hb_tag_t table_tag;
const hb_map_t *lookup_index_map;
const hb_map_t *feature_index_map;
unsigned debug_depth;
hb_subset_layout_context_t (hb_subset_context_t *c_,
hb_tag_t tag_,
@ -136,7 +135,6 @@ struct hb_subset_layout_context_t :
table_tag (tag_),
lookup_index_map (lookup_map_),
feature_index_map (feature_map_),
debug_depth (0),
script_count (0),
langsys_count (0),
feature_index_count (0),

View File

@ -530,7 +530,6 @@ struct hb_ot_apply_context_t :
unsigned int lookup_index;
unsigned int lookup_props;
unsigned int nesting_level_left;
unsigned int debug_depth;
bool has_glyph_classes;
bool auto_zwnj;
@ -560,7 +559,6 @@ struct hb_ot_apply_context_t :
lookup_index ((unsigned int) -1),
lookup_props (0),
nesting_level_left (HB_MAX_NESTING_LEVEL),
debug_depth (0),
has_glyph_classes (gdef.has_glyph_classes ()),
auto_zwnj (true),
auto_zwj (true),
@ -728,11 +726,9 @@ struct hb_get_subtables_context_t :
static return_t default_return_value () { return hb_empty_t (); }
hb_get_subtables_context_t (array_t &array_) :
array (array_),
debug_depth (0) {}
array (array_) {}
array_t &array;
unsigned int debug_depth;
};

View File

@ -121,7 +121,6 @@ struct hb_sanitize_context_t :
hb_dispatch_context_t<hb_sanitize_context_t, bool, HB_DEBUG_SANITIZE>
{
hb_sanitize_context_t () :
debug_depth (0),
start (nullptr), end (nullptr),
max_ops (0), max_subtables (0),
writable (false), edit_count (0),
@ -387,7 +386,6 @@ struct hb_sanitize_context_t :
return sanitize_blob<Type> (hb_face_reference_table (face, tableTag));
}
mutable unsigned int debug_depth;
const char *start, *end;
mutable int max_ops, max_subtables;
private:

View File

@ -58,7 +58,6 @@ struct hb_subset_context_t :
hb_subset_plan_t *plan;
hb_serialize_context_t *serializer;
hb_tag_t table_tag;
unsigned int debug_depth;
hb_subset_context_t (hb_blob_t *source_blob_,
hb_subset_plan_t *plan_,
@ -67,8 +66,7 @@ struct hb_subset_context_t :
source_blob (source_blob_),
plan (plan_),
serializer (serializer_),
table_tag (table_tag_),
debug_depth (0) {}
table_tag (table_tag_) {}
};