From d96e44922e34d0e365713e6ac75246dc0041dfab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 30 Oct 2021 00:34:35 +0100 Subject: [PATCH] Use g_pattern_spec_match() instead of g_pattern_match() which is deprecated since glib 2.70 Fixes compiler warnings with glib 2.70 Part-of: --- .../gst-devtools/validate/gst/validate/gst-validate-runner.c | 6 +++++- .../gst-plugins-base/tests/examples/playback/playback-test.c | 6 +++++- subprojects/gst-plugins-base/tests/examples/seek/jsseek.c | 6 +++++- subprojects/gstreamer/gst/gstinfo.c | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-runner.c b/subprojects/gst-devtools/validate/gst/validate/gst-validate-runner.c index 13c132e..84ef0c7 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-runner.c +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-runner.c @@ -516,6 +516,10 @@ gst_validate_runner_get_default_reporting_level (GstValidateRunner * runner) return runner->priv->default_level; } +#if !GLIB_CHECK_VERSION(2,70,0) +#define g_pattern_spec_match_string g_pattern_match_string +#endif + /* * gst_validate_runner_get_reporting_level_for_name: * @@ -538,7 +542,7 @@ gst_validate_runner_get_reporting_level_for_name (GstValidateRunner * runner, _replace_double_colons (fixed_name); for (tmp = runner->priv->report_pattern_levels; tmp; tmp = tmp->next) { PatternLevel *pattern_level = (PatternLevel *) tmp->data; - if (g_pattern_match_string (pattern_level->pattern, fixed_name)) { + if (g_pattern_spec_match_string (pattern_level->pattern, fixed_name)) { g_free (fixed_name); return pattern_level->level; diff --git a/subprojects/gst-plugins-base/tests/examples/playback/playback-test.c b/subprojects/gst-plugins-base/tests/examples/playback/playback-test.c index c3aa3c1..323a002 100644 --- a/subprojects/gst-plugins-base/tests/examples/playback/playback-test.c +++ b/subprojects/gst-plugins-base/tests/examples/playback/playback-test.c @@ -2483,6 +2483,10 @@ connect_bus_signals (PlaybackApp * app) gst_object_unref (bus); } +#if !GLIB_CHECK_VERSION(2,70,0) +#define g_pattern_spec_match_string g_pattern_match_string +#endif + /* Return GList of paths described in location string */ static GList * handle_wildcards (const gchar * location) @@ -2502,7 +2506,7 @@ handle_wildcards (const gchar * location) } while ((name = g_dir_read_name (dir)) != NULL) { - if (g_pattern_match_string (pspec, name)) { + if (g_pattern_spec_match_string (pspec, name)) { res = g_list_append (res, g_strjoin ("/", path, name, NULL)); g_print (" found clip %s\n", name); } diff --git a/subprojects/gst-plugins-base/tests/examples/seek/jsseek.c b/subprojects/gst-plugins-base/tests/examples/seek/jsseek.c index 76e8780..ddb36a6 100644 --- a/subprojects/gst-plugins-base/tests/examples/seek/jsseek.c +++ b/subprojects/gst-plugins-base/tests/examples/seek/jsseek.c @@ -2552,6 +2552,10 @@ connect_bus_signals (GstElement * pipeline) gst_object_unref (bus); } +#if !GLIB_CHECK_VERSION(2,70,0) +#define g_pattern_spec_match_string g_pattern_match_string +#endif + /* Return GList of paths described in location string */ static GList * handle_wildcards (const gchar * location) @@ -2571,7 +2575,7 @@ handle_wildcards (const gchar * location) } while ((name = g_dir_read_name (dir)) != NULL) { - if (g_pattern_match_string (pspec, name)) { + if (g_pattern_spec_match_string (pspec, name)) { res = g_list_append (res, g_strjoin ("/", path, name, NULL)); g_print (" found clip %s\n", name); } diff --git a/subprojects/gstreamer/gst/gstinfo.c b/subprojects/gstreamer/gst/gstinfo.c index 913fe42..d11c558 100644 --- a/subprojects/gstreamer/gst/gstinfo.c +++ b/subprojects/gstreamer/gst/gstinfo.c @@ -1705,10 +1705,14 @@ gst_debug_get_default_threshold (void) return (GstDebugLevel) g_atomic_int_get (&__default_level); } +#if !GLIB_CHECK_VERSION(2,70,0) +#define g_pattern_spec_match_string g_pattern_match_string +#endif + static gboolean gst_debug_apply_entry (GstDebugCategory * cat, LevelNameEntry * entry) { - if (!g_pattern_match_string (entry->pat, cat->name)) + if (!g_pattern_spec_match_string (entry->pat, cat->name)) return FALSE; if (gst_is_initialized ()) -- 2.7.4