[gupnp-av] Remove obsolete version check



commit 46c9055c25fb486dea4d0d4c0b96cdc13e31f512
Author: Jens Georg <mail jensge org>
Date:   Sun Jul 4 00:13:01 2021 +0200

    Remove obsolete version check

 libgupnp-av/fragment-util.c               | 105 ++++++++++++------------------
 tests/check-search.c                      |   4 --
 tests/fragments.c                         |   3 -
 tests/gtest/test-cds-last-change-parser.c |   3 -
 tests/gtest/test-didl-lite-object.c       |   3 -
 tests/gtest/test-last-change-parser.c     |   3 -
 tests/gtest/test-media-collection.c       |   3 -
 tests/gtest/test-regression.c             |   3 -
 8 files changed, 41 insertions(+), 86 deletions(-)
---
diff --git a/libgupnp-av/fragment-util.c b/libgupnp-av/fragment-util.c
index 68bcc16..f899fc4 100644
--- a/libgupnp-av/fragment-util.c
+++ b/libgupnp-av/fragment-util.c
@@ -90,29 +90,6 @@ get_toplevel_changes (xmlNodePtr current_node,
         return changes;
 }
 
-#if GLIB_CHECK_VERSION (2, 32, 0)
-
-#define hash_table_contains g_hash_table_contains
-#define hash_table_add g_hash_table_add
-
-#else
-
-static gboolean
-hash_table_contains (GHashTable *table,
-                     gpointer    key)
-{
-  return g_hash_table_lookup_extended (table, key, NULL, NULL);
-}
-
-static void
-hash_table_add (GHashTable *table,
-                gpointer    key)
-{
-  g_hash_table_replace (table, key, key);
-}
-
-#endif
-
 static gboolean
 is_read_only (const gchar *changed_element,
               const gchar *changed_attribute)
@@ -124,41 +101,41 @@ is_read_only (const gchar *changed_element,
                 readonly_props = g_hash_table_new (g_str_hash,
                                                    g_str_equal);
 
-                hash_table_add (readonly_props, (gpointer)  "@id");
-                hash_table_add (readonly_props, (gpointer)  "@parentID");
-                hash_table_add (readonly_props, (gpointer)  "@refID");
-                hash_table_add (readonly_props, (gpointer)  "@restricted");
-                hash_table_add (readonly_props, (gpointer)  "@searchable");
-                hash_table_add (readonly_props, (gpointer)  "@childCount");
-                hash_table_add (readonly_props, (gpointer)  "searchClass");
-                hash_table_add (readonly_props, (gpointer)  "searchClass@name");
-                hash_table_add (readonly_props, (gpointer)  "searchClass@includeDerived");
-                hash_table_add (readonly_props, (gpointer)  "createClass");
-                hash_table_add (readonly_props, (gpointer)  "createClass@name");
-                hash_table_add (readonly_props, (gpointer)  "createClass@includeDerived");
-                hash_table_add (readonly_props, (gpointer)  "writeStatus");
-                hash_table_add (readonly_props, (gpointer)  "res@importUri");
-                hash_table_add (readonly_props, (gpointer)  "storageTotal");
-                hash_table_add (readonly_props, (gpointer)  "storageUsed");
-                hash_table_add (readonly_props, (gpointer)  "storageFree");
-                hash_table_add (readonly_props, (gpointer)  "storageMaxPartition");
-                hash_table_add (readonly_props, (gpointer)  "storageMedium");
-                hash_table_add (readonly_props, (gpointer)  "playbackCount");
-                hash_table_add (readonly_props, (gpointer)  "srsRecordScheduleID");
-                hash_table_add (readonly_props, (gpointer)  "srsRecordTaskID");
-                hash_table_add (readonly_props, (gpointer)  "price");
-                hash_table_add (readonly_props, (gpointer)  "price@currency");
-                hash_table_add (readonly_props, (gpointer)  "payPerView");
-                hash_table_add (readonly_props, (gpointer)  "dateTimeRange");
-                hash_table_add (readonly_props, (gpointer)
+                g_hash_table_add (readonly_props, (gpointer)  "@id");
+                g_hash_table_add (readonly_props, (gpointer)  "@parentID");
+                g_hash_table_add (readonly_props, (gpointer)  "@refID");
+                g_hash_table_add (readonly_props, (gpointer)  "@restricted");
+                g_hash_table_add (readonly_props, (gpointer)  "@searchable");
+                g_hash_table_add (readonly_props, (gpointer)  "@childCount");
+                g_hash_table_add (readonly_props, (gpointer)  "searchClass");
+                g_hash_table_add (readonly_props, (gpointer)  "searchClass@name");
+                g_hash_table_add (readonly_props, (gpointer)  "searchClass@includeDerived");
+                g_hash_table_add (readonly_props, (gpointer)  "createClass");
+                g_hash_table_add (readonly_props, (gpointer)  "createClass@name");
+                g_hash_table_add (readonly_props, (gpointer)  "createClass@includeDerived");
+                g_hash_table_add (readonly_props, (gpointer)  "writeStatus");
+                g_hash_table_add (readonly_props, (gpointer)  "res@importUri");
+                g_hash_table_add (readonly_props, (gpointer)  "storageTotal");
+                g_hash_table_add (readonly_props, (gpointer)  "storageUsed");
+                g_hash_table_add (readonly_props, (gpointer)  "storageFree");
+                g_hash_table_add (readonly_props, (gpointer)  "storageMaxPartition");
+                g_hash_table_add (readonly_props, (gpointer)  "storageMedium");
+                g_hash_table_add (readonly_props, (gpointer)  "playbackCount");
+                g_hash_table_add (readonly_props, (gpointer)  "srsRecordScheduleID");
+                g_hash_table_add (readonly_props, (gpointer)  "srsRecordTaskID");
+                g_hash_table_add (readonly_props, (gpointer)  "price");
+                g_hash_table_add (readonly_props, (gpointer)  "price@currency");
+                g_hash_table_add (readonly_props, (gpointer)  "payPerView");
+                g_hash_table_add (readonly_props, (gpointer)  "dateTimeRange");
+                g_hash_table_add (readonly_props, (gpointer)
                                 "dateTimeRange@daylightSaving");
-                hash_table_add (readonly_props, (gpointer)  "signalStrength");
-                hash_table_add (readonly_props, (gpointer)  "signalLocked");
-                hash_table_add (readonly_props, (gpointer)  "tuned");
-                hash_table_add (readonly_props, (gpointer)  "containerUpdateID");
-                hash_table_add (readonly_props, (gpointer)  "objectUpdateID");
-                hash_table_add (readonly_props, (gpointer)  "totalDeletedChildCount");
-                hash_table_add (readonly_props, (gpointer)  "res@updateCount");
+                g_hash_table_add (readonly_props, (gpointer)  "signalStrength");
+                g_hash_table_add (readonly_props, (gpointer)  "signalLocked");
+                g_hash_table_add (readonly_props, (gpointer)  "tuned");
+                g_hash_table_add (readonly_props, (gpointer)  "containerUpdateID");
+                g_hash_table_add (readonly_props, (gpointer)  "objectUpdateID");
+                g_hash_table_add (readonly_props, (gpointer)  "totalDeletedChildCount");
+                g_hash_table_add (readonly_props, (gpointer)  "res@updateCount");
                 g_once_init_leave (&readonly_props_loaded, 1);
         }
         if (changed_element != NULL) {
@@ -166,21 +143,21 @@ is_read_only (const gchar *changed_element,
                         gchar *test_prop = g_strdup_printf ("%s@%s",
                                                             changed_element,
                                                             changed_attribute);
-                        gboolean result = hash_table_contains (readonly_props,
+                        gboolean result = g_hash_table_contains (readonly_props,
                                                                test_prop);
 
                         g_free (test_prop);
                         if (result)
                                 return TRUE;
                         test_prop = g_strdup_printf ("@%s", changed_attribute);
-                        result = hash_table_contains (readonly_props,
+                        result = g_hash_table_contains (readonly_props,
                                                       test_prop);
                         g_free (test_prop);
                         if (result)
                                 return TRUE;
                 }
 
-                return hash_table_contains (readonly_props, changed_element);
+                return g_hash_table_contains (readonly_props, changed_element);
         }
 
         return FALSE;
@@ -341,7 +318,7 @@ static void
 add_dep_prop (IndependentProperty *indep,
               const gchar         *name)
 {
-        hash_table_add (indep->required_dep_props, g_strdup (name));
+        g_hash_table_add (indep->required_dep_props, g_strdup (name));
 }
 
 static IndependentProperty *
@@ -505,15 +482,15 @@ is_required (const xmlChar *changed_element,
                                          (gpointer) changed_element);
 
                 if (changed_attribute != NULL) {
-                        if (hash_table_contains
+                        if (g_hash_table_contains
                                         (toplevel_prop->required_dep_props,
                                          changed_attribute))
                                 return TRUE;
-                        if (hash_table_contains (this_prop->required_dep_props,
+                        if (g_hash_table_contains (this_prop->required_dep_props,
                                                  changed_attribute))
                                 return TRUE;
                 }
-                if (hash_table_contains (toplevel_prop->required_indep_props,
+                if (g_hash_table_contains (toplevel_prop->required_indep_props,
                                          changed_element))
                                 return TRUE;
                 /* TODO: check if changed element is not a required
diff --git a/tests/check-search.c b/tests/check-search.c
index 2724f30..400ba45 100644
--- a/tests/check-search.c
+++ b/tests/check-search.c
@@ -24,10 +24,6 @@ main (G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv)
         GError *error;
         guint i;
 
-#if !GLIB_CHECK_VERSION (2, 35, 0)
-        g_type_init ();
-#endif
-
         parser = gupnp_search_criteria_parser_new ();
 
         for (i = 0; i < G_N_ELEMENTS (searches); i++) {
diff --git a/tests/fragments.c b/tests/fragments.c
index 164ae6b..9782e3d 100644
--- a/tests/fragments.c
+++ b/tests/fragments.c
@@ -119,9 +119,6 @@ int main (void)
         GList* artists;
         GUPnPDIDLLiteContributor *artist;
 
-#if !GLIB_CHECK_VERSION (2, 35, 0)
-        g_type_init ();
-#endif
         g_setenv ("GUPNP_AV_DATADIR", ABS_TOP_SRCDIR G_DIR_SEPARATOR_S "data", FALSE);
 
         writer = gupnp_didl_lite_writer_new (NULL);
diff --git a/tests/gtest/test-cds-last-change-parser.c b/tests/gtest/test-cds-last-change-parser.c
index b1fd489..52f9fc4 100644
--- a/tests/gtest/test-cds-last-change-parser.c
+++ b/tests/gtest/test-cds-last-change-parser.c
@@ -473,9 +473,6 @@ test_parse_spec_samples (void)
 int
 main (int argc, char *argv[])
 {
-#if !GLIB_CHECK_VERSION (2, 35, 0)
-        g_type_init ();
-#endif
         g_test_init (&argc, &argv, NULL);
 
         g_test_add_func ("/cds-last-change/parse-spec-samples",
diff --git a/tests/gtest/test-didl-lite-object.c b/tests/gtest/test-didl-lite-object.c
index 0a9b5ee..62b6cac 100644
--- a/tests/gtest/test-didl-lite-object.c
+++ b/tests/gtest/test-didl-lite-object.c
@@ -35,9 +35,6 @@ namespace_getters (void)
 int
 main (int argc, char **argv)
 {
-#if !GLIB_CHECK_VERSION (2, 35, 0)
-  g_type_init ();
-#endif
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/didl-lite-object/namespace-getters", namespace_getters);
diff --git a/tests/gtest/test-last-change-parser.c b/tests/gtest/test-last-change-parser.c
index d4875a2..22fbfa4 100644
--- a/tests/gtest/test-last-change-parser.c
+++ b/tests/gtest/test-last-change-parser.c
@@ -229,9 +229,6 @@ two_mutes (void)
 int
 main (int argc, char **argv)
 {
-#if !GLIB_CHECK_VERSION (2, 35, 0)
-  g_type_init ();
-#endif
   g_test_init (&argc, &argv, NULL);
 
   g_test_add_func ("/last-change-parser/general", general);
diff --git a/tests/gtest/test-media-collection.c b/tests/gtest/test-media-collection.c
index d4294fe..c4755b3 100644
--- a/tests/gtest/test-media-collection.c
+++ b/tests/gtest/test-media-collection.c
@@ -457,9 +457,6 @@ test_didl_collection_create_reparent (void)
 
 int main (int argc, char *argv[])
 {
-#if !GLIB_CHECK_VERSION (2, 35, 0)
-        g_type_init ();
-#endif
         g_test_init (&argc, &argv, NULL);
 
         g_test_add_func ("/didl/collection/construction",
diff --git a/tests/gtest/test-regression.c b/tests/gtest/test-regression.c
index 130296c..93736fb 100644
--- a/tests/gtest/test-regression.c
+++ b/tests/gtest/test-regression.c
@@ -195,9 +195,6 @@ test_bgo770174 (void)
 
 int main (int argc, char *argv[])
 {
-#if !GLIB_CHECK_VERSION (2, 35, 0)
-        g_type_init ();
-#endif
         g_test_init (&argc, &argv, NULL);
 
         g_test_add_func ("/bugs/gnome/674319", test_bgo674319);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]