[pulseaudio-discuss] [PATCH 05/13] idxset: Use pa_free_cb_t instead of pa_free2_cb_t

Tanu Kaskinen tanuk at iki.fi
Tue Feb 12 11:36:55 PST 2013


There were no users for the userdata pointer.
---
 src/modules/alsa/alsa-mixer.c           |    6 +++---
 src/modules/alsa/alsa-sink.c            |    4 ++--
 src/modules/alsa/alsa-ucm.c             |    8 ++++----
 src/modules/dbus/module-dbus-protocol.c |    9 ++-------
 src/modules/module-combine-sink.c       |   11 ++++-------
 src/modules/module-device-manager.c     |    2 +-
 src/modules/module-device-restore.c     |    6 +++---
 src/modules/module-role-cork.c          |   16 +++++-----------
 src/modules/module-role-ducking.c       |   19 +++++++------------
 src/modules/module-stream-restore.c     |    2 +-
 src/pulse/format.c                      |    4 ----
 src/pulse/internal.h                    |    2 --
 src/pulsecore/card.c                    |    4 ++--
 src/pulsecore/client.c                  |    4 ++--
 src/pulsecore/core.c                    |   16 ++++++++--------
 src/pulsecore/idxset.c                  |    4 ++--
 src/pulsecore/idxset.h                  |    7 +++----
 src/pulsecore/protocol-cli.c            |    2 +-
 src/pulsecore/protocol-dbus.c           |   18 +++---------------
 src/pulsecore/protocol-esound.c         |    2 +-
 src/pulsecore/protocol-http.c           |    2 +-
 src/pulsecore/protocol-native.c         |   16 ++++++++--------
 src/pulsecore/protocol-simple.c         |    2 +-
 src/pulsecore/sink-input.c              |   12 ++++++------
 src/pulsecore/sink.c                    |    6 +++---
 src/pulsecore/source-output.c           |   10 +++++-----
 src/pulsecore/source.c                  |    6 +++---
 27 files changed, 81 insertions(+), 119 deletions(-)

diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index 395ee2c..881d13d 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -449,7 +449,7 @@ static void setting_free(pa_alsa_setting *s) {
     pa_assert(s);
 
     if (s->options)
-        pa_idxset_free(s->options, NULL, NULL);
+        pa_idxset_free(s->options, NULL);
 
     pa_xfree(s->name);
     pa_xfree(s->description);
@@ -3289,10 +3289,10 @@ static void profile_free(pa_alsa_profile *p) {
     pa_xstrfreev(p->output_mapping_names);
 
     if (p->input_mappings)
-        pa_idxset_free(p->input_mappings, NULL, NULL);
+        pa_idxset_free(p->input_mappings, NULL);
 
     if (p->output_mappings)
-        pa_idxset_free(p->output_mappings, NULL, NULL);
+        pa_idxset_free(p->output_mappings, NULL);
 
     pa_xfree(p);
 }
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 03434f9..69d006e 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1547,7 +1547,7 @@ static pa_bool_t sink_set_formats(pa_sink *s, pa_idxset *formats) {
             return FALSE;
     }
 
-    pa_idxset_free(u->formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+    pa_idxset_free(u->formats, (pa_free_cb_t) pa_format_info_free);
     u->formats = pa_idxset_new(NULL, NULL);
 
     /* Note: the logic below won't apply if we're using software encoding.
@@ -2455,7 +2455,7 @@ static void userdata_free(struct userdata *u) {
         pa_smoother_free(u->smoother);
 
     if (u->formats)
-        pa_idxset_free(u->formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(u->formats, (pa_free_cb_t) pa_format_info_free);
 
     if (u->rates)
         pa_xfree(u->rates);
diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
index 9e62dcb..e01721f 100644
--- a/src/modules/alsa/alsa-ucm.c
+++ b/src/modules/alsa/alsa-ucm.c
@@ -1498,9 +1498,9 @@ static void free_verb(pa_alsa_ucm_verb *verb) {
         PA_LLIST_REMOVE(pa_alsa_ucm_device, verb->devices, di);
         pa_proplist_free(di->proplist);
         if (di->conflicting_devices)
-            pa_idxset_free(di->conflicting_devices, NULL, NULL);
+            pa_idxset_free(di->conflicting_devices, NULL);
         if (di->supported_devices)
-            pa_idxset_free(di->supported_devices, NULL, NULL);
+            pa_idxset_free(di->supported_devices, NULL);
         pa_xfree(di);
     }
 
@@ -1552,7 +1552,7 @@ void pa_alsa_ucm_mapping_context_free(pa_alsa_ucm_mapping_context *context) {
                 dev->capture_mapping = NULL;
         }
 
-        pa_idxset_free(context->ucm_devices, NULL, NULL);
+        pa_idxset_free(context->ucm_devices, NULL);
     }
 
     if (context->ucm_modifiers) {
@@ -1563,7 +1563,7 @@ void pa_alsa_ucm_mapping_context_free(pa_alsa_ucm_mapping_context *context) {
                 mod->capture_mapping = NULL;
         }
 
-        pa_idxset_free(context->ucm_modifiers, NULL, NULL);
+        pa_idxset_free(context->ucm_modifiers, NULL);
     }
 }
 
diff --git a/src/modules/dbus/module-dbus-protocol.c b/src/modules/dbus/module-dbus-protocol.c
index e77f13b..7e49d93 100644
--- a/src/modules/dbus/module-dbus-protocol.c
+++ b/src/modules/dbus/module-dbus-protocol.c
@@ -585,7 +585,6 @@ fail:
 
 void pa__done(pa_module *m) {
     struct userdata *u;
-    struct connection *c;
 
     pa_assert(m);
 
@@ -595,12 +594,8 @@ void pa__done(pa_module *m) {
     if (u->core_iface)
         pa_dbusiface_core_free(u->core_iface);
 
-    if (u->connections) {
-        while ((c = pa_idxset_steal_first(u->connections, NULL)))
-            connection_free(c);
-
-        pa_idxset_free(u->connections, NULL, NULL);
-    }
+    if (u->connections)
+        pa_idxset_free(u->connections, (pa_free_cb_t) connection_free);
 
     /* This must not be called before the connections are freed, because if
      * there are any connections left, they will emit the
diff --git a/src/modules/module-combine-sink.c b/src/modules/module-combine-sink.c
index dd38009..7d660f0 100644
--- a/src/modules/module-combine-sink.c
+++ b/src/modules/module-combine-sink.c
@@ -550,6 +550,7 @@ static void sink_input_kill_cb(pa_sink_input *i) {
     pa_assert_se(o = i->userdata);
 
     pa_module_unload_request(o->userdata->module, TRUE);
+    pa_idxset_remove_by_data(o->userdata->outputs, o, NULL);
     output_free(o);
 }
 
@@ -1107,6 +1108,7 @@ static pa_hook_result_t sink_unlink_hook_cb(pa_core *c, pa_sink *s, struct userd
     if (!u->automatic)
         u->unlinked_slaves = pa_strlist_prepend(u->unlinked_slaves, s->name);
 
+    pa_idxset_remove_by_data(u->outputs, o, NULL);
     output_free(o);
 
     return PA_HOOK_OK;
@@ -1368,7 +1370,6 @@ fail:
 
 void pa__done(pa_module*m) {
     struct userdata *u;
-    struct output *o;
 
     pa_assert(m);
 
@@ -1386,12 +1387,8 @@ void pa__done(pa_module*m) {
     if (u->sink_state_changed_slot)
         pa_hook_slot_free(u->sink_state_changed_slot);
 
-    if (u->outputs) {
-        while ((o = pa_idxset_first(u->outputs, NULL)))
-            output_free(o);
-
-        pa_idxset_free(u->outputs, NULL, NULL);
-    }
+    if (u->outputs)
+        pa_idxset_free(u->outputs, (pa_free_cb_t) output_free);
 
     if (u->sink)
         pa_sink_unlink(u->sink);
diff --git a/src/modules/module-device-manager.c b/src/modules/module-device-manager.c
index 1207824..207870d 100644
--- a/src/modules/module-device-manager.c
+++ b/src/modules/module-device-manager.c
@@ -1699,7 +1699,7 @@ void pa__done(pa_module*m) {
     }
 
     if (u->subscribed)
-        pa_idxset_free(u->subscribed, NULL, NULL);
+        pa_idxset_free(u->subscribed, NULL);
 
     pa_xfree(u);
 }
diff --git a/src/modules/module-device-restore.c b/src/modules/module-device-restore.c
index 2a666ac..8360a05 100644
--- a/src/modules/module-device-restore.c
+++ b/src/modules/module-device-restore.c
@@ -351,7 +351,7 @@ static struct perportentry* perportentry_new(pa_bool_t add_pcm_format) {
 static void perportentry_free(struct perportentry* e) {
     pa_assert(e);
 
-    pa_idxset_free(e->formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+    pa_idxset_free(e->formats, (pa_free_cb_t) pa_format_info_free);
     pa_xfree(e);
 }
 
@@ -1151,7 +1151,7 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
                 e = perportentry_new(FALSE);
             else {
                 /* Clean out any saved formats */
-                pa_idxset_free(e->formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+                pa_idxset_free(e->formats, (pa_free_cb_t) pa_format_info_free);
                 e->formats = pa_idxset_new(NULL, NULL);
             }
 
@@ -1338,7 +1338,7 @@ void pa__done(pa_module*m) {
     }
 
     if (u->subscribed)
-        pa_idxset_free(u->subscribed, NULL, NULL);
+        pa_idxset_free(u->subscribed, NULL);
 
     pa_xfree(u);
 }
diff --git a/src/modules/module-role-cork.c b/src/modules/module-role-cork.c
index 77bac1e..6e6ea72 100644
--- a/src/modules/module-role-cork.c
+++ b/src/modules/module-role-cork.c
@@ -283,23 +283,17 @@ fail:
 
 void pa__done(pa_module *m) {
     struct userdata* u;
-    char *role;
 
     pa_assert(m);
 
     if (!(u = m->userdata))
         return;
 
-    if (u->trigger_roles) {
-        while ((role = pa_idxset_steal_first(u->trigger_roles, NULL)))
-            pa_xfree(role);
-        pa_idxset_free(u->trigger_roles, NULL, NULL);
-    }
-    if (u->cork_roles) {
-        while ((role = pa_idxset_steal_first(u->cork_roles, NULL)))
-            pa_xfree(role);
-        pa_idxset_free(u->cork_roles, NULL, NULL);
-    }
+    if (u->trigger_roles)
+        pa_idxset_free(u->trigger_roles, pa_xfree);
+
+    if (u->cork_roles)
+        pa_idxset_free(u->cork_roles, pa_xfree);
 
     if (u->sink_input_put_slot)
         pa_hook_slot_free(u->sink_input_put_slot);
diff --git a/src/modules/module-role-ducking.c b/src/modules/module-role-ducking.c
index 8ea43ad..9947871 100644
--- a/src/modules/module-role-ducking.c
+++ b/src/modules/module-role-ducking.c
@@ -286,28 +286,23 @@ fail:
 void pa__done(pa_module *m) {
     struct userdata* u;
     pa_sink_input *i;
-    char *role;
 
     pa_assert(m);
 
     if (!(u = m->userdata))
         return;
 
-    if (u->trigger_roles) {
-        while ((role = pa_idxset_steal_first(u->trigger_roles, NULL)))
-            pa_xfree(role);
-        pa_idxset_free(u->trigger_roles, NULL, NULL);
-    }
-    if (u->ducking_roles) {
-        while ((role = pa_idxset_steal_first(u->ducking_roles, NULL)))
-            pa_xfree(role);
-        pa_idxset_free(u->ducking_roles, NULL, NULL);
-    }
+    if (u->trigger_roles)
+        pa_idxset_free(u->trigger_roles, pa_xfree);
+
+    if (u->ducking_roles)
+        pa_idxset_free(u->ducking_roles, pa_xfree);
+
     if (u->ducked_inputs) {
         while ((i = pa_idxset_steal_first(u->ducked_inputs, NULL)))
             pa_sink_input_remove_volume_factor(i, u->name);
 
-        pa_idxset_free(u->ducked_inputs, NULL, NULL);
+        pa_idxset_free(u->ducked_inputs, NULL);
     }
 
     if (u->sink_input_put_slot)
diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index 64bb241..23f4780 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -2549,7 +2549,7 @@ void pa__done(pa_module*m) {
     }
 
     if (u->subscribed)
-        pa_idxset_free(u->subscribed, NULL, NULL);
+        pa_idxset_free(u->subscribed, NULL);
 
     pa_xfree(u);
 }
diff --git a/src/pulse/format.c b/src/pulse/format.c
index 542d119..b909eea 100644
--- a/src/pulse/format.c
+++ b/src/pulse/format.c
@@ -100,10 +100,6 @@ void pa_format_info_free(pa_format_info *f) {
     pa_xfree(f);
 }
 
-void pa_format_info_free2(pa_format_info *f, void *userdata) {
-    pa_format_info_free(f);
-}
-
 int pa_format_info_valid(const pa_format_info *f) {
     return (f->encoding >= 0 && f->encoding < PA_ENCODING_MAX && f->plist != NULL);
 }
diff --git a/src/pulse/internal.h b/src/pulse/internal.h
index 833653d..e72e285 100644
--- a/src/pulse/internal.h
+++ b/src/pulse/internal.h
@@ -305,8 +305,6 @@ void pa_ext_device_manager_command(pa_context *c, uint32_t tag, pa_tagstruct *t)
 void pa_ext_device_restore_command(pa_context *c, uint32_t tag, pa_tagstruct *t);
 void pa_ext_stream_restore_command(pa_context *c, uint32_t tag, pa_tagstruct *t);
 
-void pa_format_info_free2(pa_format_info *f, void *userdata);
-
 pa_bool_t pa_mainloop_is_our_api(pa_mainloop_api*m);
 
 #endif
diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
index c3bb7eb..c05fc7a 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/card.c
@@ -233,9 +233,9 @@ void pa_card_free(pa_card *c) {
     pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_REMOVE, c->index);
 
     pa_assert(pa_idxset_isempty(c->sinks));
-    pa_idxset_free(c->sinks, NULL, NULL);
+    pa_idxset_free(c->sinks, NULL);
     pa_assert(pa_idxset_isempty(c->sources));
-    pa_idxset_free(c->sources, NULL, NULL);
+    pa_idxset_free(c->sources, NULL);
 
     pa_hashmap_free(c->ports, (pa_free_cb_t) pa_device_port_unref);
 
diff --git a/src/pulsecore/client.c b/src/pulsecore/client.c
index c956b10..a8fde9f 100644
--- a/src/pulsecore/client.c
+++ b/src/pulsecore/client.c
@@ -103,9 +103,9 @@ void pa_client_free(pa_client *c) {
     pa_subscription_post(c->core, PA_SUBSCRIPTION_EVENT_CLIENT|PA_SUBSCRIPTION_EVENT_REMOVE, c->index);
 
     pa_assert(pa_idxset_isempty(c->sink_inputs));
-    pa_idxset_free(c->sink_inputs, NULL, NULL);
+    pa_idxset_free(c->sink_inputs, NULL);
     pa_assert(pa_idxset_isempty(c->source_outputs));
-    pa_idxset_free(c->source_outputs, NULL, NULL);
+    pa_idxset_free(c->source_outputs, NULL);
 
     pa_proplist_free(c->proplist);
     pa_xfree(c->driver);
diff --git a/src/pulsecore/core.c b/src/pulsecore/core.c
index 37f3fae..98ad16e 100644
--- a/src/pulsecore/core.c
+++ b/src/pulsecore/core.c
@@ -170,28 +170,28 @@ static void core_free(pa_object *o) {
      * we get here */
 
     pa_assert(pa_idxset_isempty(c->scache));
-    pa_idxset_free(c->scache, NULL, NULL);
+    pa_idxset_free(c->scache, NULL);
 
     pa_assert(pa_idxset_isempty(c->modules));
-    pa_idxset_free(c->modules, NULL, NULL);
+    pa_idxset_free(c->modules, NULL);
 
     pa_assert(pa_idxset_isempty(c->clients));
-    pa_idxset_free(c->clients, NULL, NULL);
+    pa_idxset_free(c->clients, NULL);
 
     pa_assert(pa_idxset_isempty(c->cards));
-    pa_idxset_free(c->cards, NULL, NULL);
+    pa_idxset_free(c->cards, NULL);
 
     pa_assert(pa_idxset_isempty(c->sinks));
-    pa_idxset_free(c->sinks, NULL, NULL);
+    pa_idxset_free(c->sinks, NULL);
 
     pa_assert(pa_idxset_isempty(c->sources));
-    pa_idxset_free(c->sources, NULL, NULL);
+    pa_idxset_free(c->sources, NULL);
 
     pa_assert(pa_idxset_isempty(c->source_outputs));
-    pa_idxset_free(c->source_outputs, NULL, NULL);
+    pa_idxset_free(c->source_outputs, NULL);
 
     pa_assert(pa_idxset_isempty(c->sink_inputs));
-    pa_idxset_free(c->sink_inputs, NULL, NULL);
+    pa_idxset_free(c->sink_inputs, NULL);
 
     pa_assert(pa_hashmap_isempty(c->namereg));
     pa_hashmap_free(c->namereg, NULL);
diff --git a/src/pulsecore/idxset.c b/src/pulsecore/idxset.c
index 2b6af90..fc3ea58 100644
--- a/src/pulsecore/idxset.c
+++ b/src/pulsecore/idxset.c
@@ -139,7 +139,7 @@ static void remove_entry(pa_idxset *s, struct idxset_entry *e) {
     s->n_entries--;
 }
 
-void pa_idxset_free(pa_idxset *s, pa_free2_cb_t free_cb, void *userdata) {
+void pa_idxset_free(pa_idxset *s, pa_free_cb_t free_cb) {
     pa_assert(s);
 
     while (s->iterate_list_head) {
@@ -148,7 +148,7 @@ void pa_idxset_free(pa_idxset *s, pa_free2_cb_t free_cb, void *userdata) {
         remove_entry(s, s->iterate_list_head);
 
         if (free_cb)
-            free_cb(data, userdata);
+            free_cb(data);
     }
 
     pa_xfree(s);
diff --git a/src/pulsecore/idxset.h b/src/pulsecore/idxset.h
index 2d01fb4..0b12ac1 100644
--- a/src/pulsecore/idxset.h
+++ b/src/pulsecore/idxset.h
@@ -25,6 +25,8 @@
 
 #include <inttypes.h>
 
+#include <pulse/def.h>
+
 #include <pulsecore/macro.h>
 
 /* A combination of a set and a dynamic array. Entries are indexable
@@ -35,9 +37,6 @@
 /* A special index value denoting the invalid index. */
 #define PA_IDXSET_INVALID ((uint32_t) -1)
 
-/* Similar to pa_free_cb_t, but takes a userdata argument */
-typedef void (*pa_free2_cb_t)(void *p, void *userdata);
-
 /* Generic implementations for hash and comparison functions. Just
  * compares the pointer or calculates the hash value directly from the
  * pointer value. */
@@ -57,7 +56,7 @@ typedef struct pa_idxset pa_idxset;
 pa_idxset* pa_idxset_new(pa_hash_func_t hash_func, pa_compare_func_t compare_func);
 
 /* Free the idxset. When the idxset is not empty the specified function is called for every entry contained */
-void pa_idxset_free(pa_idxset *s, pa_free2_cb_t free_cb, void *userdata);
+void pa_idxset_free(pa_idxset *s, pa_free_cb_t free_cb);
 
 /* Store a new item in the idxset. The index of the item is returned in *idx */
 int pa_idxset_put(pa_idxset*s, void *p, uint32_t *idx);
diff --git a/src/pulsecore/protocol-cli.c b/src/pulsecore/protocol-cli.c
index da64874..cc6eeee 100644
--- a/src/pulsecore/protocol-cli.c
+++ b/src/pulsecore/protocol-cli.c
@@ -134,7 +134,7 @@ void pa_cli_protocol_unref(pa_cli_protocol *p) {
     while ((c = pa_idxset_first(p->connections, NULL)))
         cli_unlink(p, c);
 
-    pa_idxset_free(p->connections, NULL, NULL);
+    pa_idxset_free(p->connections, NULL);
 
     pa_assert_se(pa_shared_remove(p->core, "cli-protocol") >= 0);
 
diff --git a/src/pulsecore/protocol-dbus.c b/src/pulsecore/protocol-dbus.c
index dab4678..ffd8ea2 100644
--- a/src/pulsecore/protocol-dbus.c
+++ b/src/pulsecore/protocol-dbus.c
@@ -171,7 +171,7 @@ void pa_dbus_protocol_unref(pa_dbus_protocol *p) {
 
     pa_hashmap_free(p->objects, NULL);
     pa_hashmap_free(p->connections, NULL);
-    pa_idxset_free(p->extensions, NULL, NULL);
+    pa_idxset_free(p->extensions, NULL);
 
     for (i = 0; i < PA_DBUS_PROTOCOL_HOOK_MAX; ++i)
         pa_hook_done(&p->hooks[i]);
@@ -928,22 +928,15 @@ static struct signal_paths_entry *signal_paths_entry_new(const char *signal_name
 }
 
 static void signal_paths_entry_free(struct signal_paths_entry *e) {
-    char *path = NULL;
-
     pa_assert(e);
 
     pa_xfree(e->signal);
-
-    while ((path = pa_idxset_steal_first(e->paths, NULL)))
-        pa_xfree(path);
-
-    pa_idxset_free(e->paths, NULL, NULL);
+    pa_idxset_free(e->paths, pa_xfree);
     pa_xfree(e);
 }
 
 int pa_dbus_protocol_unregister_connection(pa_dbus_protocol *p, DBusConnection *conn) {
     struct connection_entry *conn_entry = NULL;
-    char *object_path = NULL;
 
     pa_assert(p);
     pa_assert(conn);
@@ -954,12 +947,7 @@ int pa_dbus_protocol_unregister_connection(pa_dbus_protocol *p, DBusConnection *
     unregister_all_objects(p, conn);
 
     dbus_connection_unref(conn_entry->connection);
-
-    while ((object_path = pa_idxset_steal_first(conn_entry->all_signals_objects, NULL)))
-        pa_xfree(object_path);
-
-    pa_idxset_free(conn_entry->all_signals_objects, NULL, NULL);
-
+    pa_idxset_free(conn_entry->all_signals_objects, pa_xfree);
     pa_hashmap_free(conn_entry->listening_signals, (pa_free_cb_t) signal_paths_entry_free);
     pa_xfree(conn_entry);
 
diff --git a/src/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c
index ce50084..52aa2c5 100644
--- a/src/pulsecore/protocol-esound.c
+++ b/src/pulsecore/protocol-esound.c
@@ -1627,7 +1627,7 @@ void pa_esound_protocol_unref(pa_esound_protocol *p) {
     while ((c = pa_idxset_first(p->connections, NULL)))
         connection_unlink(c);
 
-    pa_idxset_free(p->connections, NULL, NULL);
+    pa_idxset_free(p->connections, NULL);
 
     pa_assert_se(pa_shared_remove(p->core, "esound-protocol") >= 0);
 
diff --git a/src/pulsecore/protocol-http.c b/src/pulsecore/protocol-http.c
index d745634..400150f 100644
--- a/src/pulsecore/protocol-http.c
+++ b/src/pulsecore/protocol-http.c
@@ -786,7 +786,7 @@ void pa_http_protocol_unref(pa_http_protocol *p) {
     while ((c = pa_idxset_first(p->connections, NULL)))
         connection_unlink(c);
 
-    pa_idxset_free(p->connections, NULL, NULL);
+    pa_idxset_free(p->connections, NULL);
 
     pa_strlist_free(p->servers);
 
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 6a9379e..a4ee920 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1222,7 +1222,7 @@ static playback_stream* playback_stream_new(
 
 out:
     if (formats)
-        pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
 
     return s;
 }
@@ -1340,8 +1340,8 @@ static void native_connection_free(pa_object *o) {
 
     native_connection_unlink(c);
 
-    pa_idxset_free(c->record_streams, NULL, NULL);
-    pa_idxset_free(c->output_streams, NULL, NULL);
+    pa_idxset_free(c->record_streams, NULL);
+    pa_idxset_free(c->output_streams, NULL);
 
     pa_pdispatch_unref(c->pdispatch);
     pa_pstream_unref(c->pstream);
@@ -2193,7 +2193,7 @@ finish:
     if (p)
         pa_proplist_free(p);
     if (formats)
-        pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
 }
 
 static void command_delete_stream(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
@@ -2508,7 +2508,7 @@ finish:
     if (p)
         pa_proplist_free(p);
     if (formats)
-        pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
 }
 
 static void command_exit(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
@@ -3143,7 +3143,7 @@ static void sink_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_sin
             pa_tagstruct_put_format_info(t, f);
         }
 
-        pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
     }
 }
 
@@ -3213,7 +3213,7 @@ static void source_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_s
             pa_tagstruct_put_format_info(t, f);
         }
 
-        pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
     }
 }
 
@@ -5093,7 +5093,7 @@ void pa_native_protocol_unref(pa_native_protocol *p) {
     while ((c = pa_idxset_first(p->connections, NULL)))
         native_connection_unlink(c);
 
-    pa_idxset_free(p->connections, NULL, NULL);
+    pa_idxset_free(p->connections, NULL);
 
     pa_strlist_free(p->servers);
 
diff --git a/src/pulsecore/protocol-simple.c b/src/pulsecore/protocol-simple.c
index 8d8f5b8..9242e68 100644
--- a/src/pulsecore/protocol-simple.c
+++ b/src/pulsecore/protocol-simple.c
@@ -690,7 +690,7 @@ void pa_simple_protocol_unref(pa_simple_protocol *p) {
     while ((c = pa_idxset_first(p->connections, NULL)))
         connection_unlink(c);
 
-    pa_idxset_free(p->connections, NULL, NULL);
+    pa_idxset_free(p->connections, NULL);
 
     pa_assert_se(pa_shared_remove(p->core, "simple-protocol") >= 0);
 
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 7e6efe0..2e6a271 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -198,12 +198,12 @@ pa_bool_t pa_sink_input_new_data_set_sink(pa_sink_input_new_data *data, pa_sink
             data->sink = s;
             data->save_sink = save;
             if (data->nego_formats)
-                pa_idxset_free(data->nego_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+                pa_idxset_free(data->nego_formats, (pa_free_cb_t) pa_format_info_free);
             data->nego_formats = formats;
         } else {
             /* Sink doesn't support any of the formats requested by the client */
             if (formats)
-                pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+                pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
             ret = FALSE;
         }
     }
@@ -216,7 +216,7 @@ pa_bool_t pa_sink_input_new_data_set_formats(pa_sink_input_new_data *data, pa_id
     pa_assert(formats);
 
     if (data->req_formats)
-        pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
 
     data->req_formats = formats;
 
@@ -232,10 +232,10 @@ void pa_sink_input_new_data_done(pa_sink_input_new_data *data) {
     pa_assert(data);
 
     if (data->req_formats)
-        pa_idxset_free(data->req_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(data->req_formats, (pa_free_cb_t) pa_format_info_free);
 
     if (data->nego_formats)
-        pa_idxset_free(data->nego_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(data->nego_formats, (pa_free_cb_t) pa_format_info_free);
 
     if (data->format)
         pa_format_info_free(data->format);
@@ -738,7 +738,7 @@ static void sink_input_free(pa_object *o) {
         pa_proplist_free(i->proplist);
 
     if (i->direct_outputs)
-        pa_idxset_free(i->direct_outputs, NULL, NULL);
+        pa_idxset_free(i->direct_outputs, NULL);
 
     if (i->thread_info.direct_outputs)
         pa_hashmap_free(i->thread_info.direct_outputs, NULL);
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 5f625d6..e0039fa 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -729,7 +729,7 @@ static void sink_free(pa_object *o) {
         s->monitor_source = NULL;
     }
 
-    pa_idxset_free(s->inputs, NULL, NULL);
+    pa_idxset_free(s->inputs, NULL);
     pa_hashmap_free(s->thread_info.inputs, (pa_free_cb_t) pa_sink_input_unref);
 
     if (s->silence.memblock)
@@ -3733,7 +3733,7 @@ pa_bool_t pa_sink_check_format(pa_sink *s, pa_format_info *f)
             }
         }
 
-        pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
     }
 
     return ret;
@@ -3763,7 +3763,7 @@ pa_idxset* pa_sink_check_formats(pa_sink *s, pa_idxset *in_formats) {
 
 done:
     if (sink_formats)
-        pa_idxset_free(sink_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(sink_formats, (pa_free_cb_t) pa_format_info_free);
 
     return out_formats;
 }
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 8775c1e..b5e62aa 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -143,12 +143,12 @@ pa_bool_t pa_source_output_new_data_set_source(pa_source_output_new_data *data,
             data->source = s;
             data->save_source = save;
             if (data->nego_formats)
-                pa_idxset_free(data->nego_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+                pa_idxset_free(data->nego_formats, (pa_free_cb_t) pa_format_info_free);
             data->nego_formats = formats;
         } else {
             /* Source doesn't support any of the formats requested by the client */
             if (formats)
-                pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+                pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
             ret = FALSE;
         }
     }
@@ -161,7 +161,7 @@ pa_bool_t pa_source_output_new_data_set_formats(pa_source_output_new_data *data,
     pa_assert(formats);
 
     if (data->req_formats)
-        pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
 
     data->req_formats = formats;
 
@@ -177,10 +177,10 @@ void pa_source_output_new_data_done(pa_source_output_new_data *data) {
     pa_assert(data);
 
     if (data->req_formats)
-        pa_idxset_free(data->req_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(data->req_formats, (pa_free_cb_t) pa_format_info_free);
 
     if (data->nego_formats)
-        pa_idxset_free(data->nego_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(data->nego_formats, (pa_free_cb_t) pa_format_info_free);
 
     if (data->format)
         pa_format_info_free(data->format);
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 960581c..972113d 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -659,7 +659,7 @@ static void source_free(pa_object *o) {
 
     pa_log_info("Freeing source %u \"%s\"", s->index, s->name);
 
-    pa_idxset_free(s->outputs, NULL, NULL);
+    pa_idxset_free(s->outputs, NULL);
     pa_hashmap_free(s->thread_info.outputs, (pa_free_cb_t) pa_source_output_unref);
 
     if (s->silence.memblock)
@@ -2801,7 +2801,7 @@ pa_bool_t pa_source_check_format(pa_source *s, pa_format_info *f)
             }
         }
 
-        pa_idxset_free(formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(formats, (pa_free_cb_t) pa_format_info_free);
     }
 
     return ret;
@@ -2831,7 +2831,7 @@ pa_idxset* pa_source_check_formats(pa_source *s, pa_idxset *in_formats) {
 
 done:
     if (source_formats)
-        pa_idxset_free(source_formats, (pa_free2_cb_t) pa_format_info_free2, NULL);
+        pa_idxset_free(source_formats, (pa_free_cb_t) pa_format_info_free);
 
     return out_formats;
 }
-- 
1.7.10.4



More information about the pulseaudio-discuss mailing list