summaryrefslogtreecommitdiffstats
path: root/polyp/idxset.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-09-01 12:21:06 +0000
committerLennart Poettering <lennart@poettering.net>2004-09-01 12:21:06 +0000
commitfa19d6ab7e2df69902d94a38cc03a183f6d97670 (patch)
tree84f2124168b752143fa9430e0684b1244936d7b8 /polyp/idxset.c
parent36550f4a66ae28e1b81b9b818c38cd0fcd1302a1 (diff)
implement missing scache_get_id_by_name
add some more consts to idxset add module-sine, a sine generating sink_input module git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@165 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/idxset.c')
-rw-r--r--polyp/idxset.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/polyp/idxset.c b/polyp/idxset.c
index 83565193..92cde13f 100644
--- a/polyp/idxset.c
+++ b/polyp/idxset.c
@@ -107,7 +107,7 @@ void pa_idxset_free(struct pa_idxset *s, void (*free_func) (void *p, void *userd
pa_xfree(s);
}
-static struct idxset_entry* hash_scan(struct pa_idxset *s, struct idxset_entry* e, void *p) {
+static struct idxset_entry* hash_scan(struct pa_idxset *s, struct idxset_entry* e, const void *p) {
assert(p);
assert(s->compare_func);
@@ -221,7 +221,7 @@ void* pa_idxset_get_by_index(struct pa_idxset*s, uint32_t index) {
return (*a)->data;
}
-void* pa_idxset_get_by_data(struct pa_idxset*s, void *p, uint32_t *index) {
+void* pa_idxset_get_by_data(struct pa_idxset*s, const void *p, uint32_t *index) {
unsigned h;
struct idxset_entry *e;
assert(s && p);
@@ -289,9 +289,10 @@ void* pa_idxset_remove_by_index(struct pa_idxset*s, uint32_t index) {
return data;
}
-void* pa_idxset_remove_by_data(struct pa_idxset*s, void *data, uint32_t *index) {
+void* pa_idxset_remove_by_data(struct pa_idxset*s, const void *data, uint32_t *index) {
struct idxset_entry *e;
unsigned h;
+ void *r;
assert(s->hash_func);
h = s->hash_func(data) % s->hash_table_size;
@@ -300,13 +301,13 @@ void* pa_idxset_remove_by_data(struct pa_idxset*s, void *data, uint32_t *index)
if (!(e = hash_scan(s, s->hash_table[h], data)))
return NULL;
- data = e->data;
+ r = e->data;
if (index)
*index = e->index;
remove_entry(s, e);
- return data;
+ return r;
}
void* pa_idxset_rrobin(struct pa_idxset *s, uint32_t *index) {