From 4bb98c7f97c0f39ecee1f1bce24e4cb284ceb1eb Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 10 Jul 2021 10:28:32 -0400 Subject: Quiet a compiler warning Another case where using a GPtrArray instead of a GArray of pointers is nicer. --- pango/pangofc-fontmap.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'pango/pangofc-fontmap.c') 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 ** -- cgit v1.2.1