mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
modules: Use PA_IDXSET_FOREACH wherever applicable.
Signed-off-by: Harsh Prateek Bora <harsh.bora@linaro.org>
This commit is contained in:
parent
0236977408
commit
f38c1e9bf9
6 changed files with 9 additions and 9 deletions
|
|
@ -67,7 +67,7 @@ static void load_null_sink_if_needed(pa_core *c, pa_sink *sink, struct userdata*
|
|||
|
||||
/* Loop through all sinks and check to see if we have *any*
|
||||
* sinks. Ignore the sink passed in (if it's not null) */
|
||||
for (target = pa_idxset_first(c->sinks, &idx); target; target = pa_idxset_next(c->sinks, &idx))
|
||||
PA_IDXSET_FOREACH(target, c->sinks, idx)
|
||||
if (!sink || target != sink)
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ int pa__init(pa_module*m) {
|
|||
pa_log_info("Successfully opened database file '%s'.", fname);
|
||||
pa_xfree(fname);
|
||||
|
||||
for (card = pa_idxset_first(m->core->cards, &idx); card; card = pa_idxset_next(m->core->cards, &idx))
|
||||
PA_IDXSET_FOREACH(card, m->core->cards, idx)
|
||||
subscribe_callback(m->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_NEW, card->index, u);
|
||||
|
||||
pa_modargs_free(ma);
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ static void notify_subscribers(struct userdata *u) {
|
|||
|
||||
pa_assert(u);
|
||||
|
||||
for (c = pa_idxset_first(u->subscribed, &idx); c; c = pa_idxset_next(u->subscribed, &idx)) {
|
||||
PA_IDXSET_FOREACH(c, u->subscribed, idx) {
|
||||
pa_tagstruct *t;
|
||||
|
||||
t = pa_tagstruct_new(NULL, 0);
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ static void trigger_save(struct userdata *u, pa_device_type_t type, uint32_t sin
|
|||
uint32_t idx;
|
||||
|
||||
if (sink_idx != PA_INVALID_INDEX) {
|
||||
for (c = pa_idxset_first(u->subscribed, &idx); c; c = pa_idxset_next(u->subscribed, &idx)) {
|
||||
PA_IDXSET_FOREACH(c, u->subscribed, idx) {
|
||||
pa_tagstruct *t;
|
||||
|
||||
t = pa_tagstruct_new(NULL, 0);
|
||||
|
|
@ -1275,10 +1275,10 @@ int pa__init(pa_module*m) {
|
|||
pa_log_info("Successfully opened database file '%s'.", fname);
|
||||
pa_xfree(fname);
|
||||
|
||||
for (sink = pa_idxset_first(m->core->sinks, &idx); sink; sink = pa_idxset_next(m->core->sinks, &idx))
|
||||
PA_IDXSET_FOREACH(sink, m->core->sinks, idx)
|
||||
subscribe_callback(m->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_NEW, sink->index, u);
|
||||
|
||||
for (source = pa_idxset_first(m->core->sources, &idx); source; source = pa_idxset_next(m->core->sources, &idx))
|
||||
PA_IDXSET_FOREACH(source, m->core->sources, idx)
|
||||
subscribe_callback(m->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_NEW, source->index, u);
|
||||
|
||||
pa_modargs_free(ma);
|
||||
|
|
|
|||
|
|
@ -1201,7 +1201,7 @@ static void trigger_save(struct userdata *u) {
|
|||
pa_native_connection *c;
|
||||
uint32_t idx;
|
||||
|
||||
for (c = pa_idxset_first(u->subscribed, &idx); c; c = pa_idxset_next(u->subscribed, &idx)) {
|
||||
PA_IDXSET_FOREACH(c, u->subscribed, idx) {
|
||||
pa_tagstruct *t;
|
||||
|
||||
t = pa_tagstruct_new(NULL, 0);
|
||||
|
|
|
|||
|
|
@ -439,10 +439,10 @@ int pa__init(pa_module*m) {
|
|||
u->timeout = timeout;
|
||||
u->device_infos = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
|
||||
|
||||
for (sink = pa_idxset_first(m->core->sinks, &idx); sink; sink = pa_idxset_next(m->core->sinks, &idx))
|
||||
PA_IDXSET_FOREACH(sink, m->core->sinks, idx)
|
||||
device_new_hook_cb(m->core, PA_OBJECT(sink), u);
|
||||
|
||||
for (source = pa_idxset_first(m->core->sources, &idx); source; source = pa_idxset_next(m->core->sources, &idx))
|
||||
PA_IDXSET_FOREACH(source, m->core->sources, idx)
|
||||
device_new_hook_cb(m->core, PA_OBJECT(source), u);
|
||||
|
||||
u->sink_new_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_PUT], PA_HOOK_NORMAL, (pa_hook_cb_t) device_new_hook_cb, u);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue