From 83b66bfb665bb82fd03ae97c6f0e3eba01c0cba4 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 23 Feb 2021 13:04:25 -0700 Subject: [PATCH] Another try to fix narrowing error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../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 >, const hb_map_t*&, (hb_function_sortedness_t)0, 0>; typename hb_enable_if::value>::type* = 0; OT::HBUINT16 = OT::IntType]’: ../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 --- src/hb-ot-layout-gsubgpos.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 3a9656596..0f55a10a6 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/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,