mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-25 06:59:57 -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
|
|
@ -71,7 +71,7 @@ struct spa_device_info {
|
|||
uint32_t n_params; /**< number of elements in params */
|
||||
};
|
||||
|
||||
#define SPA_DEVICE_INFO_INIT() (struct spa_device_info){ SPA_VERSION_DEVICE_INFO, }
|
||||
#define SPA_DEVICE_INFO_INIT() ((struct spa_device_info){ SPA_VERSION_DEVICE_INFO, })
|
||||
|
||||
/**
|
||||
* Information about a device object
|
||||
|
|
@ -92,7 +92,7 @@ struct spa_device_object_info {
|
|||
const struct spa_dict *props; /**< extra object properties */
|
||||
};
|
||||
|
||||
#define SPA_DEVICE_OBJECT_INFO_INIT() (struct spa_device_object_info){ SPA_VERSION_DEVICE_OBJECT_INFO, }
|
||||
#define SPA_DEVICE_OBJECT_INFO_INIT() ((struct spa_device_object_info){ SPA_VERSION_DEVICE_OBJECT_INFO, })
|
||||
|
||||
/** the result of spa_device_enum_params() */
|
||||
#define SPA_RESULT_TYPE_DEVICE_PARAMS 1
|
||||
|
|
@ -243,10 +243,10 @@ struct spa_device_methods {
|
|||
#define spa_device_method(o,method,version,...) \
|
||||
({ \
|
||||
int _res = -ENOTSUP; \
|
||||
struct spa_device *_o = o; \
|
||||
struct spa_device *_o = (o); \
|
||||
spa_interface_call_res(&_o->iface, \
|
||||
struct spa_device_methods, _res, \
|
||||
method, version, ##__VA_ARGS__); \
|
||||
method, (version), ##__VA_ARGS__); \
|
||||
_res; \
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue