From 9c2a63ae5be02205714a84bbf8a5645ff926ab90 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 24 Jun 2020 19:24:30 +0800 Subject: pango-attributes.c: Fix on older compilers Avoid declaring a variables in a for loop initialization, so that we won't accidentally break building on older compilers. --- pango/pango-attributes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c index 218ffade..5f844639 100644 --- a/pango/pango-attributes.c +++ b/pango/pango-attributes.c @@ -1868,6 +1868,7 @@ pango_attr_list_equal (PangoAttrList *list, { GPtrArray *attrs, *other_attrs; guint64 skip_bitmask = 0; + guint i; if (list == other_list) return TRUE; @@ -1884,12 +1885,13 @@ pango_attr_list_equal (PangoAttrList *list, if (attrs->len != other_attrs->len) return FALSE; - for (guint i = 0; i < attrs->len; i++) + for (i = 0; i < attrs->len; i++) { PangoAttribute *attr = g_ptr_array_index (attrs, i); gboolean attr_equal = FALSE; + guint other_attr_index; - for (guint other_attr_index = 0; other_attr_index < other_attrs->len; other_attr_index++) + for (other_attr_index = 0; other_attr_index < other_attrs->len; other_attr_index++) { PangoAttribute *other_attr = g_ptr_array_index (other_attrs, other_attr_index); guint64 other_attr_bitmask = other_attr_index < 64 ? 1 << other_attr_index : 0; -- cgit v1.2.1