mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-23 01:40:24 -05: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
|
|
@ -47,12 +47,12 @@ struct spa_command {
|
|||
};
|
||||
|
||||
#define SPA_COMMAND_TYPE(cmd) ((cmd)->body.body.type)
|
||||
#define SPA_COMMAND_ID(cmd,type) (SPA_COMMAND_TYPE(cmd) == type ? \
|
||||
#define SPA_COMMAND_ID(cmd,type) (SPA_COMMAND_TYPE(cmd) == (type) ? \
|
||||
(cmd)->body.body.id : SPA_ID_INVALID)
|
||||
|
||||
#define SPA_COMMAND_INIT_FULL(t,size,type,id,...) (t) \
|
||||
{ { size, SPA_TYPE_Object }, \
|
||||
{ { type, id }, ##__VA_ARGS__ } } \
|
||||
#define SPA_COMMAND_INIT_FULL(t,size,type,id,...) ((t) \
|
||||
{ { (size), SPA_TYPE_Object }, \
|
||||
{ { (type), (id) }, ##__VA_ARGS__ } })
|
||||
|
||||
#define SPA_COMMAND_INIT(type,id) \
|
||||
SPA_COMMAND_INIT_FULL(struct spa_command, \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue