Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 1 | From eee7e3c6688f2f1ee9beed5d6d209973c1df387e Mon Sep 17 00:00:00 2001 |
| 2 | From: Philip Withnall <pwithnall@endlessos.org> |
| 3 | Date: Wed, 11 Nov 2020 19:14:25 +0000 |
| 4 | Subject: [PATCH 17/29] gmessages: Drop unnecessary volatile qualifiers from |
| 5 | macro variables |
| 6 | MIME-Version: 1.0 |
| 7 | Content-Type: text/plain; charset=UTF-8 |
| 8 | Content-Transfer-Encoding: 8bit |
| 9 | |
| 10 | It’s not necessary and provides no thread safety guarantees. |
| 11 | |
| 12 | Signed-off-by: Philip Withnall <pwithnall@endlessos.org> |
| 13 | |
| 14 | Helps: #600 |
| 15 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719] |
| 16 | --- |
| 17 | glib/gmessages.h | 4 ++-- |
| 18 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 19 | |
| 20 | diff --git a/glib/gmessages.h b/glib/gmessages.h |
| 21 | index 6a28443b4..2e3650baf 100644 |
| 22 | --- a/glib/gmessages.h |
| 23 | +++ b/glib/gmessages.h |
| 24 | @@ -478,7 +478,7 @@ g_debug (const gchar *format, |
| 25 | #if defined(G_HAVE_ISO_VARARGS) && !G_ANALYZER_ANALYZING |
| 26 | #define g_warning_once(...) \ |
| 27 | G_STMT_START { \ |
| 28 | - static volatile int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; \ |
| 29 | + static int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; /* (atomic) */ \ |
| 30 | if (g_atomic_int_compare_and_exchange (&G_PASTE (_GWarningOnceBoolean, __LINE__), \ |
| 31 | 0, 1)) \ |
| 32 | g_warning (__VA_ARGS__); \ |
| 33 | @@ -487,7 +487,7 @@ g_debug (const gchar *format, |
| 34 | #elif defined(G_HAVE_GNUC_VARARGS) && !G_ANALYZER_ANALYZING |
| 35 | #define g_warning_once(format...) \ |
| 36 | G_STMT_START { \ |
| 37 | - static volatile int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; \ |
| 38 | + static int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; /* (atomic) */ \ |
| 39 | if (g_atomic_int_compare_and_exchange (&G_PASTE (_GWarningOnceBoolean, __LINE__), \ |
| 40 | 0, 1)) \ |
| 41 | g_warning (format); \ |
| 42 | -- |
| 43 | 2.30.1 |
| 44 | |