hashmap: Use pa_free_cb_t instead of pa_free2_cb_t

The previous patch removed module-gconf's dependency on the userdata
pointer of the free callback, and that was the only place where the
userdata pointer of pa_free2_cb_t was used, so now there's no need for
pa_free2_cb_t in pa_hashmap_free(). Using pa_free_cb_t instead allows
removing a significant amount of repetitive code.
This commit is contained in:
Tanu Kaskinen 2013-02-12 21:36:53 +02:00
parent dcf043842e
commit 8872c238ba
41 changed files with 112 additions and 308 deletions

View file

@ -200,7 +200,7 @@ static void load_module(
m->items[i].index = mod->index;
}
static void module_info_free(void *p, void *userdata) {
static void module_info_free(void *p) {
struct module_info *m = p;
pa_assert(m);
@ -291,7 +291,7 @@ static int handle_event(struct userdata *u) {
if ((m = pa_hashmap_get(u->module_infos, name))) {
pa_hashmap_remove(u->module_infos, name);
module_info_free(m, u);
module_info_free(m);
}
pa_xfree(name);
@ -401,7 +401,7 @@ void pa__done(pa_module*m) {
pa_close(u->fd);
if (u->module_infos)
pa_hashmap_free(u->module_infos, module_info_free, NULL);
pa_hashmap_free(u->module_infos, (pa_free_cb_t) module_info_free);
pa_xfree(u);
}