Resolve clang's conditional-uninitialize warnings

This commit is contained in:
Ebrahim Byagowi 2018-04-23 18:39:40 +04:30 committed by Behdad Esfahbod
parent 8b0d642e66
commit eaf649450a
3 changed files with 4 additions and 4 deletions

View File

@ -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) &&

View File

@ -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))
{

View File

@ -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++) {