Use g_pattern_spec_match() instead of g_pattern_match() which is deprecated since...
authorTim-Philipp Müller <tim@centricular.com>
Fri, 29 Oct 2021 23:34:35 +0000 (00:34 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 29 Oct 2021 23:34:35 +0000 (00:34 +0100)
Fixes compiler warnings with glib 2.70

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1279>

subprojects/gst-devtools/validate/gst/validate/gst-validate-runner.c
subprojects/gst-plugins-base/tests/examples/playback/playback-test.c
subprojects/gst-plugins-base/tests/examples/seek/jsseek.c
subprojects/gstreamer/gst/gstinfo.c

index 13c132e..84ef0c7 100644 (file)
@@ -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;
index c3aa3c1..323a002 100644 (file)
@@ -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);
     }
index 76e8780..ddb36a6 100644 (file)
@@ -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);
     }
index 913fe42..d11c558 100644 (file)
@@ -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 ())