mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
cleanup
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@18 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
78f386ad45
commit
b24546bede
19 changed files with 261 additions and 277 deletions
21
src/idxset.c
21
src/idxset.c
|
|
@ -291,9 +291,7 @@ void* idxset_rrobin(struct idxset *s, uint32_t *index) {
|
|||
if (!e)
|
||||
return NULL;
|
||||
|
||||
if (index)
|
||||
*index = e->index;
|
||||
|
||||
*index = e->index;
|
||||
return e->data;
|
||||
}
|
||||
|
||||
|
|
@ -308,6 +306,22 @@ void* idxset_first(struct idxset *s, uint32_t *index) {
|
|||
return s->iterate_list_head->data;
|
||||
}
|
||||
|
||||
void *idxset_next(struct idxset *s, uint32_t *index) {
|
||||
struct idxset_entry **a, *e = NULL;
|
||||
assert(s && index);
|
||||
|
||||
if ((a = array_index(s, *index)) && *a)
|
||||
e = (*a)->iterate_next;
|
||||
|
||||
if (e) {
|
||||
*index = e->index;
|
||||
return e->data;
|
||||
} else {
|
||||
*index = IDXSET_INVALID;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int idxset_foreach(struct idxset*s, int (*func)(void *p, uint32_t index, int *del, void*userdata), void *userdata) {
|
||||
struct idxset_entry *e;
|
||||
|
|
@ -341,3 +355,4 @@ int idxset_isempty(struct idxset *s) {
|
|||
assert(s);
|
||||
return s->n_entries == 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue