mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
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:
parent
dcf043842e
commit
8872c238ba
41 changed files with 112 additions and 308 deletions
|
|
@ -22,6 +22,8 @@
|
|||
USA.
|
||||
***/
|
||||
|
||||
#include <pulse/def.h>
|
||||
|
||||
#include <pulsecore/idxset.h>
|
||||
|
||||
/* Simple Implementation of a hash table. Memory management is the
|
||||
|
|
@ -35,7 +37,7 @@ typedef struct pa_hashmap pa_hashmap;
|
|||
pa_hashmap *pa_hashmap_new(pa_hash_func_t hash_func, pa_compare_func_t compare_func);
|
||||
|
||||
/* Free the hash table. Calls the specified function for every value in the table. The function may be NULL */
|
||||
void pa_hashmap_free(pa_hashmap*, pa_free2_cb_t free_cb, void *userdata);
|
||||
void pa_hashmap_free(pa_hashmap*, pa_free_cb_t free_cb);
|
||||
|
||||
/* Add an entry to the hashmap. Returns non-zero when the entry already exists */
|
||||
int pa_hashmap_put(pa_hashmap *h, const void *key, void *value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue