From eaf649450a29115ca0b2aac2921cc40c17aa55ac Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 23 Apr 2018 18:39:40 +0430 Subject: [PATCH] Resolve clang's conditional-uninitialize warnings --- src/hb-ot-layout-gpos-table.hh | 2 +- src/hb-ot-shape-normalize.cc | 4 ++-- util/view-cairo.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 6251707..bc8a5fd 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -262,7 +262,7 @@ struct AnchorFormat2 hb_font_t *font = c->font; unsigned int x_ppem = font->x_ppem; unsigned int y_ppem = font->y_ppem; - hb_position_t cx, cy; + hb_position_t cx = 0, cy = 0; hb_bool_t ret; ret = (x_ppem || y_ppem) && diff --git a/src/hb-ot-shape-normalize.cc b/src/hb-ot-shape-normalize.cc index 62cbb9d..eceea9e 100644 --- a/src/hb-ot-shape-normalize.cc +++ b/src/hb-ot-shape-normalize.cc @@ -119,7 +119,7 @@ skip_char (hb_buffer_t *buffer) static inline unsigned int decompose (const hb_ot_shape_normalize_context_t *c, bool shortest, hb_codepoint_t ab) { - hb_codepoint_t a, b, a_glyph, b_glyph; + hb_codepoint_t a = 0, b = 0, a_glyph = 0, b_glyph = 0; hb_buffer_t * const buffer = c->buffer; hb_font_t * const font = c->font; @@ -164,7 +164,7 @@ decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shor { hb_buffer_t * const buffer = c->buffer; hb_codepoint_t u = buffer->cur().codepoint; - hb_codepoint_t glyph; + hb_codepoint_t glyph = 0; if (shortest && c->font->get_nominal_glyph (u, &glyph)) { diff --git a/util/view-cairo.cc b/util/view-cairo.cc index f4f2bc5..e8e334b 100644 --- a/util/view-cairo.cc +++ b/util/view-cairo.cc @@ -49,7 +49,7 @@ view_cairo_t::render (const font_options_t *font_opts) double leading = font_height + view_options.line_space; /* Calculate surface size. */ - double w, h; + double w = 0, h = 0; (vertical ? w : h) = (int) lines->len * leading - view_options.line_space; (vertical ? h : w) = 0; for (unsigned int i = 0; i < lines->len; i++) { -- 2.7.4