[serialize] Remove unnecessary pointer indirection
diff --git a/src/hb-open-file.hh b/src/hb-open-file.hh index c2d65eb..54947b4 100644 --- a/src/hb-open-file.hh +++ b/src/hb-open-file.hh
@@ -126,7 +126,7 @@ { TRACE_SERIALIZE (this); /* Alloc 12 for the OTHeader. */ - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); /* Write sfntVersion (bytes 0..3). */ sfnt_version = sfnt_tag; /* Take space for numTables, searchRange, entrySelector, RangeShift @@ -496,7 +496,7 @@ { TRACE_SERIALIZE (this); assert (sfnt_tag != TTCTag); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); return_trace (u.fontFace.serialize (c, sfnt_tag, items)); }
diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index fa6ccbd..49653ce 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh
@@ -479,7 +479,7 @@ bool serialize (hb_serialize_context_t *c, unsigned int items_len) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend (*this, items_len))) return_trace (false); + if (unlikely (!c->extend (this, items_len))) return_trace (false); return_trace (true); } template <typename Iterator, @@ -652,9 +652,9 @@ HB_NODISCARD bool serialize (hb_serialize_context_t *c, unsigned items_len) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); c->check_assign (len, items_len, HB_SERIALIZE_ERROR_ARRAY_OVERFLOW); - if (unlikely (!c->extend (*this))) return_trace (false); + if (unlikely (!c->extend (this))) return_trace (false); return_trace (true); } template <typename Iterator, @@ -675,7 +675,7 @@ { TRACE_SERIALIZE (this); len++; - if (unlikely (!len || !c->extend (*this))) + if (unlikely (!len || !c->extend (this))) { len--; return_trace (nullptr); @@ -802,9 +802,9 @@ bool serialize (hb_serialize_context_t *c, unsigned int items_len) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); c->check_assign (lenP1, items_len + 1, HB_SERIALIZE_ERROR_ARRAY_OVERFLOW); - if (unlikely (!c->extend (*this))) return_trace (false); + if (unlikely (!c->extend (this))) return_trace (false); return_trace (true); } template <typename Iterator,
diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index 864a27f..eaaf5e1 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh
@@ -126,7 +126,7 @@ else { /* serialize CFFIndex header */ - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); this->count = byteArray.length; this->offSize = offSize_; if (unlikely (!c->allocate_size<HBUINT8> (offSize_ * (byteArray.length + 1)))) @@ -214,7 +214,7 @@ unsigned off_size = calcOffSize (total); /* serialize CFFIndex header */ - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); this->count = it.len (); this->offSize = off_size; if (unlikely (!c->allocate_size<HBUINT8> (off_size * (it.len () + 1)))) @@ -335,7 +335,7 @@ { TRACE_SERIALIZE (this); /* serialize CFFIndex header */ - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); this->count = dataArrayLen; this->offSize = offSize_; if (unlikely (!c->allocate_size<HBUINT8> (offSize_ * (dataArrayLen + 1))))
diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index 5903510..5dd183e 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh
@@ -187,7 +187,7 @@ const hb_vector_t<code_pair_t>& supp_codes) { TRACE_SERIALIZE (this); - Encoding *dest = c->extend_min (*this); + Encoding *dest = c->extend_min (this); if (unlikely (!dest)) return_trace (false); dest->format = format | ((supp_codes.length > 0) ? 0x80 : 0); switch (format) { @@ -457,7 +457,7 @@ const hb_vector_t<code_pair_t>& sid_ranges) { TRACE_SERIALIZE (this); - Charset *dest = c->extend_min (*this); + Charset *dest = c->extend_min (this); if (unlikely (!dest)) return_trace (false); dest->format = format; switch (format)
diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 2b03e1f..7c5d8d3 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh
@@ -253,7 +253,7 @@ if (format4_iter.len () == 0) return; unsigned table_initpos = c->length (); - if (unlikely (!c->extend_min (*this))) return; + if (unlikely (!c->extend_min (this))) return; this->format = 4; //serialize endCode[] @@ -693,7 +693,7 @@ { if (it.len () == 0) return; unsigned table_initpos = c->length (); - if (unlikely (!c->extend_min (*this))) return; + if (unlikely (!c->extend_min (this))) return; hb_codepoint_t startCharCode = 0xFFFF, endCharCode = 0xFFFF; hb_codepoint_t glyphID = 0; @@ -1077,7 +1077,7 @@ unsigned table_initpos = c->length (); const char* init_tail = c->tail; - if (unlikely (!c->extend_min (*this))) return; + if (unlikely (!c->extend_min (this))) return; this->format = 14; auto src_tbl = reinterpret_cast<const CmapSubtableFormat14*> (base);
diff --git a/src/hb-ot-color-sbix-table.hh b/src/hb-ot-color-sbix-table.hh index af1e4a5..d2911f1 100644 --- a/src/hb-ot-color-sbix-table.hh +++ b/src/hb-ot-color-sbix-table.hh
@@ -145,7 +145,7 @@ auto* out = c->serializer->start_embed<SBIXStrike> (); if (unlikely (!out)) return_trace (false); auto snap = c->serializer->snapshot (); - if (unlikely (!c->serializer->extend (*out, num_output_glyphs + 1))) return_trace (false); + if (unlikely (!c->serializer->extend (out, num_output_glyphs + 1))) return_trace (false); out->ppem = ppem; out->resolution = resolution; HBUINT32 head;
diff --git a/src/hb-ot-hdmx-table.hh b/src/hb-ot-hdmx-table.hh index 590fa15..dea2b7e 100644 --- a/src/hb-ot-hdmx-table.hh +++ b/src/hb-ot-hdmx-table.hh
@@ -52,7 +52,7 @@ unsigned length = it.len (); - if (unlikely (!c->extend (*this, length))) return_trace (false); + if (unlikely (!c->extend (this, length))) return_trace (false); this->pixelSize = pixelSize; this->maxWidth =
diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index ee2b3c5..61dbd3f 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh
@@ -1262,13 +1262,13 @@ unsigned int num_subtables) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); lookupType = lookup_type; lookupFlag = lookup_props & 0xFFFFu; if (unlikely (!subTable.serialize (c, num_subtables))) return_trace (false); if (lookupFlag & LookupFlag::UseMarkFilteringSet) { - if (unlikely (!c->extend (*this))) return_trace (false); + if (unlikely (!c->extend (this))) return_trace (false); HBUINT16 &markFilteringSet = StructAfter<HBUINT16> (subTable); markFilteringSet = lookup_props >> 16; } @@ -1478,7 +1478,7 @@ bool serialize (hb_serialize_context_t *c, Iterator glyphs) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); if (unlikely (!glyphs)) { @@ -1657,7 +1657,7 @@ bool serialize (hb_serialize_context_t *c, Iterator glyphs) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); unsigned count = 0; unsigned num_ranges = 0; @@ -1890,7 +1890,7 @@ Iterator it) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); if (unlikely (!it)) { @@ -2069,7 +2069,7 @@ Iterator it) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); if (unlikely (!it)) { @@ -2311,7 +2311,7 @@ bool serialize (hb_serialize_context_t *c, Iterator it_with_class_zero) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); auto it = + it_with_class_zero | hb_filter (hb_second); @@ -2522,7 +2522,7 @@ bool serialize (hb_serialize_context_t *c, const VarRegionList *src, const hb_bimap_t ®ion_map) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); axisCount = src->axisCount; regionCount = region_map.get_population (); if (unlikely (hb_unsigned_mul_overflows (axisCount * regionCount, @@ -2626,7 +2626,7 @@ const hb_bimap_t ®ion_map) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); itemCount = inner_map.get_next_value (); /* Optimize short count */ @@ -2778,7 +2778,7 @@ const hb_array_t <hb_inc_bimap_t> &inner_maps) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); unsigned int set_count = 0; for (unsigned int i = 0; i < inner_maps.length; i++)
diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 0c0b6b4..b5981bd 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh
@@ -805,7 +805,7 @@ ValueFormat newFormat, const hb_map_t *layout_variation_idx_map) { - if (unlikely (!c->extend_min (*this))) return; + if (unlikely (!c->extend_min (this))) return; if (unlikely (!c->check_assign (valueFormat, newFormat, HB_SERIALIZE_ERROR_INT_OVERFLOW))) return; @@ -925,7 +925,7 @@ ValueFormat newFormat, const hb_map_t *layout_variation_idx_map) { - auto out = c->extend_min (*this); + auto out = c->extend_min (this); if (unlikely (!out)) return; if (unlikely (!c->check_assign (valueFormat, newFormat, HB_SERIALIZE_ERROR_INT_OVERFLOW))) return; if (unlikely (!c->check_assign (valueCount, it.len (), HB_SERIALIZE_ERROR_ARRAY_OVERFLOW))) return;
diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 3b84fc3..393ada1 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh
@@ -100,7 +100,7 @@ unsigned delta) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); if (unlikely (!coverage.serialize_serialize (c, glyphs))) return_trace (false); c->check_assign (deltaGlyphID, delta, HB_SERIALIZE_ERROR_INT_OVERFLOW); return_trace (true); @@ -209,7 +209,7 @@ + it | hb_map_retains_sorting (hb_first) ; - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); if (unlikely (!substitute.serialize (c, substitutes))) return_trace (false); if (unlikely (!coverage.serialize_serialize (c, glyphs))) return_trace (false); return_trace (true); @@ -448,7 +448,7 @@ hb_array_t<const HBGlyphID> substitute_glyphs_list) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); if (unlikely (!sequence.serialize (c, glyphs.length))) return_trace (false); for (unsigned int i = 0; i < glyphs.length; i++) { @@ -691,7 +691,7 @@ hb_array_t<const HBGlyphID> alternate_glyphs_list) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); if (unlikely (!alternateSet.serialize (c, glyphs.length))) return_trace (false); for (unsigned int i = 0; i < glyphs.length; i++) { @@ -855,7 +855,7 @@ Iterator components /* Starting from second */) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); ligGlyph = ligature; if (unlikely (!component.serialize (c, components))) return_trace (false); return_trace (true); @@ -954,7 +954,7 @@ hb_array_t<const HBGlyphID> &component_list /* Starting from second for each ligature */) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); if (unlikely (!ligature.serialize (c, ligatures.length))) return_trace (false); for (unsigned int i = 0; i < ligatures.length; i++) { @@ -1066,7 +1066,7 @@ hb_array_t<const HBGlyphID> component_list /* Starting from second for each ligature */) { TRACE_SERIALIZE (this); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); if (unlikely (!ligatureSet.serialize (c, first_glyphs.length))) return_trace (false); for (unsigned int i = 0; i < first_glyphs.length; i++) {
diff --git a/src/hb-ot-var-hvar-table.hh b/src/hb-ot-var-hvar-table.hh index 4d7f2ed..928fcc7 100644 --- a/src/hb-ot-var-hvar-table.hh +++ b/src/hb-ot-var-hvar-table.hh
@@ -54,7 +54,7 @@ TRACE_SERIALIZE (this); if (unlikely (output_map.length && ((((inner_bit_count-1)&~0xF)!=0) || (((width-1)&~0x3)!=0)))) return_trace (false); - if (unlikely (!c->extend_min (*this))) return_trace (false); + if (unlikely (!c->extend_min (this))) return_trace (false); format = ((width-1)<<4)|(inner_bit_count-1); mapCount = output_map.length;