mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-31 04:43:06 +02:00
gmessages: Drop unnecessary volatile qualifiers from macro variables
It’s not necessary and provides no thread safety guarantees. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #600
This commit is contained in:
parent
08d04d0428
commit
eee7e3c668
@ -478,7 +478,7 @@ g_debug (const gchar *format,
|
|||||||
#if defined(G_HAVE_ISO_VARARGS) && !G_ANALYZER_ANALYZING
|
#if defined(G_HAVE_ISO_VARARGS) && !G_ANALYZER_ANALYZING
|
||||||
#define g_warning_once(...) \
|
#define g_warning_once(...) \
|
||||||
G_STMT_START { \
|
G_STMT_START { \
|
||||||
static volatile int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; \
|
static int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; /* (atomic) */ \
|
||||||
if (g_atomic_int_compare_and_exchange (&G_PASTE (_GWarningOnceBoolean, __LINE__), \
|
if (g_atomic_int_compare_and_exchange (&G_PASTE (_GWarningOnceBoolean, __LINE__), \
|
||||||
0, 1)) \
|
0, 1)) \
|
||||||
g_warning (__VA_ARGS__); \
|
g_warning (__VA_ARGS__); \
|
||||||
@ -487,7 +487,7 @@ g_debug (const gchar *format,
|
|||||||
#elif defined(G_HAVE_GNUC_VARARGS) && !G_ANALYZER_ANALYZING
|
#elif defined(G_HAVE_GNUC_VARARGS) && !G_ANALYZER_ANALYZING
|
||||||
#define g_warning_once(format...) \
|
#define g_warning_once(format...) \
|
||||||
G_STMT_START { \
|
G_STMT_START { \
|
||||||
static volatile int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; \
|
static int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; /* (atomic) */ \
|
||||||
if (g_atomic_int_compare_and_exchange (&G_PASTE (_GWarningOnceBoolean, __LINE__), \
|
if (g_atomic_int_compare_and_exchange (&G_PASTE (_GWarningOnceBoolean, __LINE__), \
|
||||||
0, 1)) \
|
0, 1)) \
|
||||||
g_warning (format); \
|
g_warning (format); \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user