[pango/fix-pre-c99] pango-attributes.c: Fix on older compilers
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/fix-pre-c99] pango-attributes.c: Fix on older compilers
- Date: Wed, 24 Jun 2020 11:27:08 +0000 (UTC)
commit 9c2a63ae5be02205714a84bbf8a5645ff926ab90
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Jun 24 19:24:30 2020 +0800
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]