diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2021-09-24 14:26:06 +0000 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2021-09-24 14:26:06 +0000 |
commit | 97d39b745ff1f621424f68a41ce0a7c5bb554c87 (patch) | |
tree | 21bb1f41bd8e2e6d822c7533adad4b013bce1427 | |
parent | 8f2a61f35f3e2f7984bb34110250a028a0dff076 (diff) | |
parent | f304df34c7335526ef08701dc0b4a35f03299249 (diff) | |
download | glib-97d39b745ff1f621424f68a41ce0a7c5bb554c87.tar.gz |
Merge branch 'fix_atomic_cast' into 'main'
Coerce type cast to void* because it causes compiler warnings
See merge request GNOME/glib!2114
-rw-r--r-- | glib/gatomic.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/glib/gatomic.h b/glib/gatomic.h index 5583fb0c9..5eba1dbc7 100644 --- a/glib/gatomic.h +++ b/glib/gatomic.h @@ -157,7 +157,7 @@ G_END_DECLS gint gaicae_oldval = (oldval); \ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \ (void) (0 ? *(atomic) ^ (newval) ^ (oldval) : 1); \ - __atomic_compare_exchange_n ((atomic), &gaicae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \ + __atomic_compare_exchange_n ((atomic), (void *) (&(gaicae_oldval)), (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \ })) #define g_atomic_int_add(atomic, val) \ (G_GNUC_EXTENSION ({ \ @@ -208,7 +208,7 @@ G_END_DECLS gpointer gapcae_oldval = (gpointer)(oldval); \ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \ (void) (0 ? (gpointer) *(atomic) : NULL); \ - __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \ + __atomic_compare_exchange_n ((atomic), (void *) (&(gapcae_oldval)), (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \ })) #endif /* defined(glib_typeof) */ #define g_atomic_pointer_add(atomic, val) \ |