From 5aa4865a86fd97e76e857823dd4b32c65d2fa0ad Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Wed, 20 Sep 2023 14:52:58 -0700 Subject: [PATCH] [instancer] fix compile warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In constructor ‘OT::delta_row_encoding_t::delta_row_encoding_t(OT::delta_row_encoding_t&&)’, inlined from ‘Type* hb_vector_t::push(Args&& ...) [with Args = {OT::delta_row_encoding_t}; Type = OT::delta_row_encoding_t; bool sorted = false]’ at ../src/hb-vector.hh:221:12, inlined from ‘bool OT::item_variations_t::as_item_varstore(bool, bool)’ at ../src/hb-ot-var-common.hh:1985:24: ../src/hb-ot-layout-common.hh:2304:8: warning: ‘obj.OT::delta_row_encoding_t::width’ may be used uninitialized [-Wmaybe-uninitialized] 2304 | struct delta_row_encoding_t | ^~~~~~~~~~~~~~~~~~~~ ../src/hb-ot-var-common.hh: In member function ‘bool OT::item_variations_t::as_item_varstore(bool, bool)’: ../src/hb-ot-var-common.hh:1981:30: note: ‘obj.OT::delta_row_encoding_t::width’ was declared here 1981 | delta_row_encoding_t obj; | ^~~ In constructor ‘OT::delta_row_encoding_t::delta_row_encoding_t(OT::delta_row_encoding_t&&)’, inlined from ‘Type* hb_vector_t::push(Args&& ...) [with Args = {OT::delta_row_encoding_t}; Type = OT::delta_row_encoding_t; bool sorted = false]’ at ../src/hb-vector.hh:221:12, inlined from ‘bool OT::item_variations_t::as_item_varstore(bool, bool)’ at ../src/hb-ot-var-common.hh:1985:24: ../src/hb-ot-layout-common.hh:2304:8: warning: ‘obj.OT::delta_row_encoding_t::overhead’ may be used uninitialized [-Wmaybe-uninitialized] 2304 | struct delta_row_encoding_t | ^~~~~~~~~~~~~~~~~~~~ ../src/hb-ot-var-common.hh: In member function ‘bool OT::item_variations_t::as_item_varstore(bool, bool)’: ../src/hb-ot-var-common.hh:1981:30: note: ‘obj.OT::delta_row_encoding_t::overhead’ was declared here 1981 | delta_row_encoding_t obj; --- src/hb-ot-layout-common.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 8d003a2b3..4c235ff44 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -2306,9 +2306,9 @@ struct delta_row_encoding_t /* each byte represents a region, value is one of 0/1/2/4, which means bytes * needed for this region */ hb_vector_t chars; - unsigned width; + unsigned width = 0; hb_vector_t columns; - unsigned overhead; + unsigned overhead = 0; hb_vector_t*> items; delta_row_encoding_t () = default;