spa: avoid warnings when compiling cpp

I don't think those qualifiers are needed when doing the atomic
operations.

../spa/include/spa/pod/body.h:250:9: note: in expansion of macro ‘SPA_POD_BODY_LOAD_FIELD_ONCE’
  250 |         SPA_POD_BODY_LOAD_FIELD_ONCE(&b, body, value);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../spa/include/spa/pod/body.h: In function ‘int spa_pod_body_get_rectangle(const spa_pod*, const void*, spa_rectangle*)’:
../spa/include/spa/pod/body.h:110:81: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
  110 | #define SPA_POD_BODY_LOAD_FIELD_ONCE(a, b, field) ((a)->field = SPA_LOAD_ONCE(&((volatile __typeof__(a))(b))->field))
      |                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../spa/include/spa/utils/atomic.h:22:58: note: in definition of macro ‘SPA_LOAD_ONCE’
   22 | #define SPA_LOAD_ONCE(s)                __atomic_load_n((s), __ATOMIC_RELAXED)
      |                                                          ^
This commit is contained in:
Wim Taymans 2025-08-26 14:54:23 +02:00
parent e3cc44966b
commit 335d891ee9

View file

@ -106,8 +106,8 @@ SPA_API_POD_BODY int spa_pod_is_bool(const struct spa_pod *pod)
return SPA_POD_CHECK(pod, SPA_TYPE_Bool, sizeof(int32_t));
}
#define SPA_POD_BODY_LOAD_ONCE(a, b) (*(a) = SPA_LOAD_ONCE((const volatile __typeof__(a))(b)))
#define SPA_POD_BODY_LOAD_FIELD_ONCE(a, b, field) ((a)->field = SPA_LOAD_ONCE(&((const volatile __typeof__(a))(b))->field))
#define SPA_POD_BODY_LOAD_ONCE(a, b) (*(a) = SPA_LOAD_ONCE((__typeof__(a))(b)))
#define SPA_POD_BODY_LOAD_FIELD_ONCE(a, b, field) ((a)->field = SPA_LOAD_ONCE(&((__typeof__(a))(b))->field))
SPA_API_POD_BODY int spa_pod_body_get_bool(const struct spa_pod *pod, const void *body, bool *value)
{