taglist, plugins: fix compiler warnings with GLib >= 2.76

Fix compiler warnings about not using the return value when
freeing the GString segment with g_string_free(.., FALSE):

    ignoring return value of ‘g_string_free_and_steal’ declared with attribute ‘warn_unused_result’

which we get with newer GLib versions. These were all harmless.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4273>
This commit is contained in:
Tim-Philipp Müller 2023-03-26 16:40:28 +01:00 committed by GStreamer Marge Bot
parent 94abeb1888
commit 330836db8e
6 changed files with 9 additions and 16 deletions

View file

@ -874,9 +874,8 @@ gst_teletextdec_export_text_page (GstTeletextDec * teletext, vbi_page * page,
if (!g_strcmp0 (subs->str, ""))
g_string_append (subs, "\n");
text = subs->str;
size = subs->len + 1;
g_string_free (subs, FALSE);
text = g_string_free (subs, FALSE);
g_strfreev (lines);
} else {
size = page->columns * page->rows;
@ -935,6 +934,7 @@ gst_teletextdec_export_pango_page (GstTeletextDec * teletext, vbi_page * page,
gchar **lines;
GString *subs;
guint start, stop, k;
gsize len;
gint i, j;
colors = (gchar **) g_malloc (sizeof (gchar *) * (rows + 1));
@ -965,11 +965,11 @@ gst_teletextdec_export_pango_page (GstTeletextDec * teletext, vbi_page * page,
}
/* Allocate new buffer */
*buf = gst_buffer_new_wrapped (subs->str, subs->len + 1);
len = subs->len + 1;
*buf = gst_buffer_new_wrapped (g_string_free (subs, FALSE), len);
g_strfreev (lines);
g_strfreev (colors);
g_string_free (subs, FALSE);
return GST_FLOW_OK;
}

View file

@ -237,8 +237,7 @@ gst_ks_video_device_parse_win32_error (const gchar * func_name,
: "failed to retrieve system error message");
}
*ret_error_str = message->str;
g_string_free (message, FALSE);
*ret_error_str = g_string_free (message, FALSE);
}
}

View file

@ -383,7 +383,6 @@ ks_state_to_string (KSSTATE state)
gchar *
ks_options_flags_to_string (gulong flags)
{
gchar *ret;
GString *str;
str = g_string_sized_new (128);
@ -404,10 +403,7 @@ ks_options_flags_to_string (gulong flags)
if (flags != 0)
g_string_append_printf (str, "|0x%08x", (guint) flags);
ret = str->str;
g_string_free (str, FALSE);
return ret;
return g_string_free (str, FALSE);
}
typedef struct

View file

@ -261,7 +261,7 @@ gst_replace_create_pipeline (GstReplace *replace)
if (verbose) g_print ("pipeline: %s\n", pipe_desc->str);
pipeline = (GstElement *) gst_parse_launch (pipe_desc->str, &error);
g_string_free (pipe_desc, FALSE);
g_string_free (pipe_desc, TRUE);
if (error) {
g_print("pipeline parsing error: %s\n", error->message);

View file

@ -608,8 +608,7 @@ parse_mdvdsub (ParserState * state, const gchar * line)
break;
}
}
ret = markup->str;
g_string_free (markup, FALSE);
ret = g_string_free (markup, FALSE);
GST_DEBUG ("parse_mdvdsub returning (%f+%f): %s",
state->start_time / (double) GST_SECOND,
state->duration / (double) GST_SECOND, ret);

View file

@ -455,8 +455,7 @@ gst_tag_merge_strings_with_comma (GValue * dest, const GValue * src)
}
g_value_init (dest, G_TYPE_STRING);
g_value_take_string (dest, str->str);
g_string_free (str, FALSE);
g_value_take_string (dest, g_string_free (str, FALSE));
}
static GstTagInfo *