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

@ -101,7 +101,7 @@ static void remove_entry(pa_hashmap *h, struct hashmap_entry *e) {
h->n_entries--;
}
void pa_hashmap_free(pa_hashmap*h, pa_free2_cb_t free_cb, void *userdata) {
void pa_hashmap_free(pa_hashmap *h, pa_free_cb_t free_cb) {
pa_assert(h);
while (h->iterate_list_head) {
@ -110,7 +110,7 @@ void pa_hashmap_free(pa_hashmap*h, pa_free2_cb_t free_cb, void *userdata) {
remove_entry(h, h->iterate_list_head);
if (free_cb)
free_cb(data, userdata);
free_cb(data);
}
pa_xfree(h);