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
|
|
@ -58,20 +58,20 @@ struct spa_json {
|
|||
uint32_t depth;
|
||||
};
|
||||
|
||||
#define SPA_JSON_INIT(data,size) (struct spa_json) { (data), (data)+(size), }
|
||||
#define SPA_JSON_INIT(data,size) ((struct spa_json) { (data), (data)+(size), })
|
||||
|
||||
static inline void spa_json_init(struct spa_json * iter, const char *data, size_t size)
|
||||
{
|
||||
*iter = SPA_JSON_INIT(data, size);
|
||||
}
|
||||
#define SPA_JSON_ENTER(iter) (struct spa_json) { (iter)->cur, (iter)->end, (iter), }
|
||||
#define SPA_JSON_ENTER(iter) ((struct spa_json) { (iter)->cur, (iter)->end, (iter), })
|
||||
|
||||
static inline void spa_json_enter(struct spa_json * iter, struct spa_json * sub)
|
||||
{
|
||||
*sub = SPA_JSON_ENTER(iter);
|
||||
}
|
||||
|
||||
#define SPA_JSON_SAVE(iter) (struct spa_json) { (iter)->cur, (iter)->end, }
|
||||
#define SPA_JSON_SAVE(iter) ((struct spa_json) { (iter)->cur, (iter)->end, })
|
||||
|
||||
/** Get the next token. \a value points to the token and the return value
|
||||
* is the length. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue