mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
pod: be more careful with bool
This commit is contained in:
parent
4169d9196d
commit
919656aba3
3 changed files with 3 additions and 3 deletions
|
|
@ -459,7 +459,7 @@ static inline uint32_t spa_choice_from_id(char id)
|
|||
do { \
|
||||
switch (type) { \
|
||||
case 'b': \
|
||||
spa_pod_builder_bool(builder, va_arg(args, int)); \
|
||||
spa_pod_builder_bool(builder, !!va_arg(args, int)); \
|
||||
break; \
|
||||
case 'I': \
|
||||
spa_pod_builder_id(builder, va_arg(args, uint32_t)); \
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ static inline int spa_pod_get_bool(const struct spa_pod *pod, bool *value)
|
|||
{
|
||||
if (!spa_pod_is_bool(pod))
|
||||
return -EINVAL;
|
||||
*value = SPA_POD_VALUE(struct spa_pod_bool, pod);
|
||||
*value = !!SPA_POD_VALUE(struct spa_pod_bool, pod);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ static inline bool spa_pod_parser_can_collect(const struct spa_pod *pod, char ty
|
|||
do { \
|
||||
switch (_type) { \
|
||||
case 'b': \
|
||||
*va_arg(args, int*) = SPA_POD_VALUE(struct spa_pod_bool, pod); \
|
||||
*va_arg(args, bool*) = SPA_POD_VALUE(struct spa_pod_bool, pod); \
|
||||
break; \
|
||||
case 'I': \
|
||||
case 'i': \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue