summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-09-17 23:51:41 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-09-17 23:51:41 +0000
commitab114aaba8d923acc36f2689e7c67add6131a2a4 (patch)
tree95314ae3b2e6c944dd011621f988e1718f16129d
parent9de21d49c79b39b12a98571de40b4ccec9e30ad4 (diff)
parent1f6bd846b6b2cf242e1af263963544bf4e4a5054 (diff)
downloadpango-ab114aaba8d923acc36f2689e7c67add6131a2a4.tar.gz
Merge branch 'matthiasc/for-main' into 'main'
renderer: Fix static analysis warnings See merge request GNOME/pango!475
-rw-r--r--pango/pango-layout.c8
-rw-r--r--pango/pango-renderer.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 21e2c9c6..74799ddc 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -2387,8 +2387,8 @@ pango_layout_index_to_pos (PangoLayout *layout,
int index,
PangoRectangle *pos)
{
- PangoRectangle line_logical_rect;
- PangoRectangle run_logical_rect;
+ PangoRectangle line_logical_rect = { 0, };
+ PangoRectangle run_logical_rect = { 0, };
PangoLayoutIter iter;
PangoLayoutLine *layout_line = NULL;
int x_pos;
@@ -4480,8 +4480,8 @@ pango_layout_check_lines (PangoLayout *layout)
state.line_height = -1;
if (layout->height >= 0)
{
- PangoRectangle logical;
- int height;
+ PangoRectangle logical = { 0, };
+ int height = 0;
pango_layout_get_empty_extents_and_height_at_index (layout, 0, &logical, &height);
state.line_height = layout->line_spacing == 0.0 ? logical.height : layout->line_spacing * height;
}
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c
index d47ba13a..b3b70549 100644
--- a/pango/pango-renderer.c
+++ b/pango/pango-renderer.c
@@ -575,7 +575,7 @@ pango_renderer_draw_layout_line (PangoRenderer *renderer,
{
int x_off = 0;
int glyph_string_width;
- LineState state;
+ LineState state = { 0, };
GSList *l;
gboolean got_overall = FALSE;
PangoRectangle overall_rect;