mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-11 11:56:16 +01:00
Merge branch 'fix_atomic_cast' into 'main'
Coerce type cast to void* because it causes compiler warnings See merge request GNOME/glib!2114
This commit is contained in:
commit
97d39b745f
@ -157,7 +157,7 @@ G_END_DECLS
|
|||||||
gint gaicae_oldval = (oldval); \
|
gint gaicae_oldval = (oldval); \
|
||||||
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
|
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \
|
||||||
(void) (0 ? *(atomic) ^ (newval) ^ (oldval) : 1); \
|
(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) \
|
#define g_atomic_int_add(atomic, val) \
|
||||||
(G_GNUC_EXTENSION ({ \
|
(G_GNUC_EXTENSION ({ \
|
||||||
@ -208,7 +208,7 @@ G_END_DECLS
|
|||||||
gpointer gapcae_oldval = (gpointer)(oldval); \
|
gpointer gapcae_oldval = (gpointer)(oldval); \
|
||||||
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
|
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
|
||||||
(void) (0 ? (gpointer) *(atomic) : NULL); \
|
(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) */
|
#endif /* defined(glib_typeof) */
|
||||||
#define g_atomic_pointer_add(atomic, val) \
|
#define g_atomic_pointer_add(atomic, val) \
|
||||||
|
Loading…
Reference in New Issue
Block a user