mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
gatomic: Drop unnecessary volatile qualifiers from macro variables
It’s not necessary and provides no thread safety guarantees. The `volatile` qualifiers on the function arguments have to be kept, as they are (unfortunately) part of the API. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #600
This commit is contained in:
parent
3c648457c2
commit
9474655eb2
@ -211,7 +211,7 @@ G_END_DECLS
|
||||
}))
|
||||
#define g_atomic_pointer_and(atomic, val) \
|
||||
(G_GNUC_EXTENSION ({ \
|
||||
volatile gsize *gapa_atomic = (volatile gsize *) (atomic); \
|
||||
gsize *gapa_atomic = (gsize *) (atomic); \
|
||||
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
|
||||
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gsize)); \
|
||||
(void) (0 ? (gpointer) *(atomic) : NULL); \
|
||||
@ -220,7 +220,7 @@ G_END_DECLS
|
||||
}))
|
||||
#define g_atomic_pointer_or(atomic, val) \
|
||||
(G_GNUC_EXTENSION ({ \
|
||||
volatile gsize *gapo_atomic = (volatile gsize *) (atomic); \
|
||||
gsize *gapo_atomic = (gsize *) (atomic); \
|
||||
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
|
||||
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gsize)); \
|
||||
(void) (0 ? (gpointer) *(atomic) : NULL); \
|
||||
@ -229,7 +229,7 @@ G_END_DECLS
|
||||
}))
|
||||
#define g_atomic_pointer_xor(atomic, val) \
|
||||
(G_GNUC_EXTENSION ({ \
|
||||
volatile gsize *gapx_atomic = (volatile gsize *) (atomic); \
|
||||
gsize *gapx_atomic = (gsize *) (atomic); \
|
||||
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
|
||||
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gsize)); \
|
||||
(void) (0 ? (gpointer) *(atomic) : NULL); \
|
||||
|
Loading…
Reference in New Issue
Block a user