mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04: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
|
|
@ -271,10 +271,9 @@ static const struct dither_method_info {
|
|||
|
||||
static inline uint32_t dither_method_from_label(const char *label)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < SPA_N_ELEMENTS(dither_method_info); i++) {
|
||||
if (spa_streq(dither_method_info[i].label, label))
|
||||
return dither_method_info[i].method;
|
||||
SPA_FOR_EACH_ELEMENT_VAR(dither_method_info, i) {
|
||||
if (spa_streq(i->label, label))
|
||||
return i->method;
|
||||
}
|
||||
return DITHER_METHOD_NONE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue