summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-10 10:28:32 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-07-10 10:36:05 -0400
commit4bb98c7f97c0f39ecee1f1bce24e4cb284ceb1eb (patch)
tree5781a0d7aa18d4380e876a2419cd10cae73bb640
parentad1262d9a22ac2d35bc1075748b8b47aaf144711 (diff)
downloadpango-4bb98c7f97c0f39ecee1f1bce24e4cb284ceb1eb.tar.gz
Quiet a compiler warning
Another case where using a GPtrArray instead of a GArray of pointers is nicer.
-rw-r--r--pango/pangofc-fontmap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 92a2f64a..62f2cd4b 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -2538,9 +2538,9 @@ _pango_fc_font_map_fc_to_languages (FcLangSet *langset)
FcStrSet *strset;
FcStrList *list;
FcChar8 *s;
- GArray *langs;
+ GPtrArray *langs;
- langs = g_array_new (TRUE, FALSE, sizeof (PangoLanguage *));
+ langs = g_ptr_array_new ();
strset = FcLangSetGetLangs (langset);
list = FcStrListCreate (strset);
@@ -2549,13 +2549,15 @@ _pango_fc_font_map_fc_to_languages (FcLangSet *langset)
while ((s = FcStrListNext (list)))
{
PangoLanguage *l = pango_language_from_string ((const char *)s);
- g_array_append_val (langs, l);
+ g_ptr_array_add (langs, l);
}
FcStrListDone (list);
FcStrSetDestroy (strset);
- return (PangoLanguage **) g_array_free (langs, FALSE);
+ g_ptr_array_add (langs, NULL);
+
+ return (PangoLanguage **) g_ptr_array_free (langs, FALSE);
}
PangoLanguage **