idxset: Use pa_free_cb_t instead of pa_free2_cb_t

There were no users for the userdata pointer.
This commit is contained in:
Tanu Kaskinen 2013-02-12 21:36:55 +02:00
parent 43e7868008
commit 061878b5a4
27 changed files with 81 additions and 119 deletions

View file

@ -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);
}

View file

@ -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);

View file

@ -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);
}
}

View file

@ -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

View file

@ -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);

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);

View file

@ -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)

View file

@ -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);
}