mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
spa: add macro to simplify array iterations some more
uint32_t i; for (i = 0; i < SPA_N_ELEMENTS(some_array); i++) .. stuff with some_array[i].foo ... becomes: SPA_FOR_EACH_ELEMENT_VAR(some_array, p) .. stuff with p->foo ..
This commit is contained in:
parent
365ebcda9b
commit
d22feab92a
21 changed files with 113 additions and 150 deletions
|
|
@ -867,10 +867,9 @@ static const struct chmap_info chmap_info[] = {
|
|||
|
||||
static enum snd_pcm_chmap_position channel_to_chmap(enum spa_audio_channel channel)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < SPA_N_ELEMENTS(chmap_info); i++)
|
||||
if (chmap_info[i].channel == channel)
|
||||
return chmap_info[i].pos;
|
||||
SPA_FOR_EACH_ELEMENT_VAR(chmap_info, info)
|
||||
if (info->channel == channel)
|
||||
return info->pos;
|
||||
return SND_CHMAP_UNKNOWN;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue