mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-22 06:59:59 -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
|
|
@ -68,7 +68,7 @@ struct spa_audio_info_dsd {
|
|||
uint32_t position[SPA_AUDIO_MAX_CHANNELS]; /*< channel position from enum spa_audio_channel */
|
||||
};
|
||||
|
||||
#define SPA_AUDIO_INFO_DSD_INIT(...) (struct spa_audio_info_dsd) { __VA_ARGS__ }
|
||||
#define SPA_AUDIO_INFO_DSD_INIT(...) ((struct spa_audio_info_dsd) { __VA_ARGS__ })
|
||||
|
||||
/**
|
||||
* \}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ struct spa_audio_info_iec958 {
|
|||
uint32_t rate; /*< sample rate */
|
||||
};
|
||||
|
||||
#define SPA_AUDIO_INFO_IEC958_INIT(...) (struct spa_audio_info_iec958) { __VA_ARGS__ }
|
||||
#define SPA_AUDIO_INFO_IEC958_INIT(...) ((struct spa_audio_info_iec958) { __VA_ARGS__ })
|
||||
|
||||
/**
|
||||
* \}
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ struct spa_audio_info_raw {
|
|||
uint32_t position[SPA_AUDIO_MAX_CHANNELS]; /*< channel position from enum spa_audio_channel */
|
||||
};
|
||||
|
||||
#define SPA_AUDIO_INFO_RAW_INIT(...) (struct spa_audio_info_raw) { __VA_ARGS__ }
|
||||
#define SPA_AUDIO_INFO_RAW_INIT(...) ((struct spa_audio_info_raw) { __VA_ARGS__ })
|
||||
|
||||
#define SPA_KEY_AUDIO_FORMAT "audio.format" /**< an audio format as string,
|
||||
* Ex. "S16LE" */
|
||||
|
|
@ -311,7 +311,7 @@ struct spa_audio_info_dsp {
|
|||
enum spa_audio_format format; /*< format, one of the DSP formats in enum spa_audio_format_dsp */
|
||||
};
|
||||
|
||||
#define SPA_AUDIO_INFO_DSP_INIT(...) (struct spa_audio_info_dsp) { __VA_ARGS__ }
|
||||
#define SPA_AUDIO_INFO_DSP_INIT(...) ((struct spa_audio_info_dsp) { __VA_ARGS__ })
|
||||
|
||||
/**
|
||||
* \}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ struct spa_latency_info {
|
|||
uint64_t max_ns;
|
||||
};
|
||||
|
||||
#define SPA_LATENCY_INFO(dir,...) (struct spa_latency_info) { .direction = (dir), ## __VA_ARGS__ }
|
||||
#define SPA_LATENCY_INFO(dir,...) ((struct spa_latency_info) { .direction = (dir), ## __VA_ARGS__ })
|
||||
|
||||
static inline int
|
||||
spa_latency_info_compare(const struct spa_latency_info *a, struct spa_latency_info *b)
|
||||
|
|
@ -146,7 +146,7 @@ struct spa_process_latency_info {
|
|||
uint64_t ns;
|
||||
};
|
||||
|
||||
#define SPA_PROCESS_LATENCY_INFO_INIT(...) (struct spa_process_latency_info) { __VA_ARGS__ }
|
||||
#define SPA_PROCESS_LATENCY_INFO_INIT(...) ((struct spa_process_latency_info) { __VA_ARGS__ })
|
||||
|
||||
static inline int
|
||||
spa_process_latency_parse(const struct spa_pod *latency, struct spa_process_latency_info *info)
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ struct spa_param_info {
|
|||
uint32_t padding[5];
|
||||
};
|
||||
|
||||
#define SPA_PARAM_INFO(id,flags) (struct spa_param_info){ (id), (flags) }
|
||||
#define SPA_PARAM_INFO(id,flags) ((struct spa_param_info){ (id), (flags) })
|
||||
|
||||
/** properties for SPA_TYPE_OBJECT_ParamBuffers */
|
||||
enum spa_param_buffers {
|
||||
|
|
|
|||
|
|
@ -206,14 +206,14 @@ struct spa_video_info_raw {
|
|||
enum spa_video_color_primaries color_primaries; /**< color primaries. used to convert between R'G'B' and CIE XYZ */
|
||||
};
|
||||
|
||||
#define SPA_VIDEO_INFO_RAW_INIT(...) (struct spa_video_info_raw) { __VA_ARGS__ }
|
||||
#define SPA_VIDEO_INFO_RAW_INIT(...) ((struct spa_video_info_raw) { __VA_ARGS__ })
|
||||
|
||||
struct spa_video_info_dsp {
|
||||
enum spa_video_format format;
|
||||
int64_t modifier;
|
||||
};
|
||||
|
||||
#define SPA_VIDEO_INFO_DSP_INIT(...) (struct spa_video_info_dsp) { __VA_ARGS__ }
|
||||
#define SPA_VIDEO_INFO_DSP_INIT(...) ((struct spa_video_info_dsp) { __VA_ARGS__ })
|
||||
|
||||
/**
|
||||
* \}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue