Another try to fix narrowing error

../src/hb-ot-layout-gsubgpos.hh: In instantiation of ‘void OT::ChainRule::serialize_array(hb_serialize_context_t*, OT::HBUINT16, Iterator) const [with Iterator = hb_map_iter_t<hb_array_t<const OT::IntType<short unsigned int> >, const hb_map_t*&, (hb_function_sortedness_t)0, 0>; typename hb_enable_if<hb_is_iterator_of<Lhs, typename Lhs::item_t>::value>::type* <anonymous> = 0; OT::HBUINT16 = OT::IntType<short unsigned int>]’:
../src/hb-ot-layout-gsubgpos.hh:2341:30:   required from here
../src/hb-ot-layout-gsubgpos.hh:2326:15: error: narrowing conversion of ‘(unsigned int)g’ from ‘unsigned int’ to ‘short unsigned int’ inside { } [-Werror=narrowing]
       c->copy (HBUINT16 {g});
       ~~~~~~~~^~~~~~~~~~~~~~

https://github.com/harfbuzz/harfbuzz/pull/2875
pull/2875/head
Behdad Esfahbod 4 years ago
parent 6c4bb60829
commit 83b66bfb66
  1. 2
      src/hb-ot-layout-gsubgpos.hh

@ -2323,7 +2323,7 @@ struct ChainRule
{
c->copy (len);
for (const auto g : it)
c->copy (HBUINT16 {g});
c->copy ((HBUINT16) g);
}
ChainRule* copy (hb_serialize_context_t *c,

Loading…
Cancel
Save