Minor, fix warnings raised when built with -std=c++2a

Follow up to c184180,

It was raising,

  src/hb-ot-layout-common.hh:1067:63: warning: implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture]
      | hb_filter ([=] (const OffsetTo<TSubTable> &_) { return (this+_).intersects (glyphset, lookup_type); })
                                                                ^
  src/hb-ot-layout-common.hh:1067:19: note: add an explicit capture of 'this' to capture '*this' by reference
      | hb_filter ([=] (const OffsetTo<TSubTable> &_) { return (this+_).intersects (glyphset, lookup_type); })
                    ^
                     , this

and

  src/hb-ot-layout-common.hh:2626:38: warning: implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture]
                  { r.collect_lookups (this, lookup_indexes); })
                                       ^
  src/hb-ot-layout-common.hh:2625:18: note: add an explicit capture of 'this' to capture '*this' by reference
      | hb_apply ([=] (const FeatureTableSubstitutionRecord& r)
                   ^
                    , this

and

  src/hb-ot-hdmx-table.hh:141:44: error: implicit capture of 'this' with a capture default of '=' is deprecated [-Werror,-Wdeprecated-this-capture]
                          return device_record->widthsZ.as_array (get_num_glyphs ()) [_];
                                                                  ^
  src/hb-ot-hdmx-table.hh:137:17: note: add an explicit capture of 'this' to capture '*this' by reference
              | hb_map ([=] (hb_codepoint_t _)
                         ^
                          , this
This commit is contained in:
Ebrahim Byagowi 2020-02-06 12:12:41 +03:30
parent b4d3bf1d8a
commit 4dc3db7344
3 changed files with 13 additions and 13 deletions

View File

@ -111,7 +111,9 @@ jobs:
- run: LD_LIBRARY_PATH="$PWD/freetype-2.9/objs/.libs" make check || .ci/fail.sh
- run: make clean
- run: make -Csrc CPPFLAGS="-DHB_TINY -DHB_NO_OT_FONT" libharfbuzz-subset.la && make clean
- run: clang -c src/hb-*.cc -DHB_NO_MT
- run: clang -c src/harfbuzz.cc -DHB_NO_MT
# -Werror -Werror=deprecated-this-capture can be added but it will confuse contributors so let's skip for now
- run: clang -c src/hb-*.cc -DHB_NO_MT -std=c++2a -fno-exceptions
gcc-valgrind:
docker:

View File

@ -134,10 +134,10 @@ struct hdmx
auto row =
+ hb_range (c->plan->num_output_glyphs ())
| hb_map (c->plan->reverse_glyph_map)
| hb_map ([=] (hb_codepoint_t _)
| hb_map ([this, c, device_record] (hb_codepoint_t _)
{
if (c->plan->is_empty_glyph (_))
return Null(HBUINT8);
return Null (HBUINT8);
return device_record->widthsZ.as_array (get_num_glyphs ()) [_];
})
;

View File

@ -382,7 +382,7 @@ struct RecordListOfFeature : RecordListOf<Feature>
TRACE_SUBSET (this);
auto *out = c->serializer->start_embed (*this);
if (unlikely (!out || !c->serializer->extend_min (out))) return_trace (false);
unsigned count = this->len;
+ hb_zip (*this, hb_range (count))
| hb_filter (l->feature_index_map, hb_second)
@ -497,7 +497,7 @@ struct LangSys
for (const auto _ : + hb_zip (featureIndex, o.featureIndex))
if (_.first != _.second) return false;
return true;
}
@ -886,9 +886,9 @@ struct Feature
TRACE_SUBSET (this);
auto *out = c->serializer->start_embed (*this);
if (unlikely (!out || !c->serializer->extend_min (out))) return_trace (false);
out->featureParams = 0; /* TODO(subset) FeatureParams. */
auto it =
+ hb_iter (lookupIndex)
| hb_filter (l->lookup_index_map)
@ -1064,7 +1064,7 @@ struct Lookup
const hb_set_t *glyphset = c->plan->glyphset ();
unsigned int lookup_type = get_type ();
+ hb_iter (get_subtables <TSubTable> ())
| hb_filter ([=] (const OffsetTo<TSubTable> &_) { return (this+_).intersects (glyphset, lookup_type); })
| hb_filter ([this, glyphset, lookup_type] (const OffsetTo<TSubTable> &_) { return (this+_).intersects (glyphset, lookup_type); })
| hb_apply (subset_offset_array (c, out->get_subtables<TSubTable> (), this, out, lookup_type))
;
@ -1129,7 +1129,7 @@ struct LookupOffsetList : OffsetListOf<TLookup>
TRACE_SUBSET (this);
auto *out = c->serializer->start_embed (this);
if (unlikely (!out || !c->serializer->extend_min (out))) return_trace (false);
unsigned count = this->len;
+ hb_zip (*this, hb_range (count))
| hb_filter (l->lookup_index_map, hb_second)
@ -2622,10 +2622,8 @@ struct FeatureTableSubstitution
{
+ hb_iter (substitutions)
| hb_filter (feature_indexes, &FeatureTableSubstitutionRecord::featureIndex)
| hb_apply ([=] (const FeatureTableSubstitutionRecord& r)
{
r.collect_lookups (this, lookup_indexes);
})
| hb_apply ([this, lookup_indexes] (const FeatureTableSubstitutionRecord& r)
{ r.collect_lookups (this, lookup_indexes); })
;
}