mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-09 05:34:03 -04:00
Fix some badly-behaved macros
Some macros evaluated their arguments more than once when it was not needed, or were missing parentheses.
This commit is contained in:
parent
bb4f274ae0
commit
671a7102ff
46 changed files with 162 additions and 156 deletions
|
|
@ -48,7 +48,7 @@ struct spa_dict_item {
|
|||
const char *value;
|
||||
};
|
||||
|
||||
#define SPA_DICT_ITEM_INIT(key,value) (struct spa_dict_item) { key, value }
|
||||
#define SPA_DICT_ITEM_INIT(key,value) ((struct spa_dict_item) { (key), (value) })
|
||||
|
||||
struct spa_dict {
|
||||
#define SPA_DICT_FLAG_SORTED (1<<0) /**< items are sorted */
|
||||
|
|
@ -57,8 +57,8 @@ struct spa_dict {
|
|||
const struct spa_dict_item *items;
|
||||
};
|
||||
|
||||
#define SPA_DICT_INIT(items,n_items) (struct spa_dict) { 0, n_items, items }
|
||||
#define SPA_DICT_INIT_ARRAY(items) (struct spa_dict) { 0, SPA_N_ELEMENTS(items), items }
|
||||
#define SPA_DICT_INIT(items,n_items) ((struct spa_dict) { 0, (n_items), (items) })
|
||||
#define SPA_DICT_INIT_ARRAY(items) ((struct spa_dict) { 0, SPA_N_ELEMENTS(items), (items) })
|
||||
|
||||
#define spa_dict_for_each(item, dict) \
|
||||
for ((item) = (dict)->items; \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue