blob: 78753f821a95ffdaf1cd61e047339c060be8ebd5 [file] [log] [blame]
Andrew Geissler95ac1b82021-03-31 14:34:31 -05001From 33612404397f87f0cd45da90d3aa9ab60df895ee Mon Sep 17 00:00:00 2001
2From: Philip Withnall <pwithnall@endlessos.org>
3Date: Wed, 11 Nov 2020 18:24:28 +0000
4Subject: [PATCH 07/29] gdbusconnection: Drop unnecessary volatile qualifiers
5 from variables
6
7This should introduce no API changes; there are public functions
8exported by `GDBusConnection` which still have some (incorrectly)
9`volatile` arguments, but dropping those qualifiers would be an API
10break.
11
12Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
13
14Helps: #600
15Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719]
16---
17 gio/gdbusconnection.c | 22 +++++++++++-----------
18 1 file changed, 11 insertions(+), 11 deletions(-)
19
20diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
21index ed8cf6219..91c365e80 100644
22--- a/gio/gdbusconnection.c
23+++ b/gio/gdbusconnection.c
24@@ -393,7 +393,7 @@ struct _GDBusConnection
25 * FLAG_CLOSED is the closed property. It may be read at any time, but
26 * may only be written while holding @lock.
27 */
28- volatile gint atomic_flags;
29+ gint atomic_flags; /* (atomic) */
30
31 /* If the connection could not be established during initable_init(),
32 * this GError will be set.
33@@ -1596,7 +1596,7 @@ static gboolean
34 g_dbus_connection_send_message_unlocked (GDBusConnection *connection,
35 GDBusMessage *message,
36 GDBusSendMessageFlags flags,
37- volatile guint32 *out_serial,
38+ guint32 *out_serial,
39 GError **error)
40 {
41 guchar *blob;
42@@ -1741,7 +1741,7 @@ g_dbus_connection_send_message (GDBusConnection *connection,
43 g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
44
45 CONNECTION_LOCK (connection);
46- ret = g_dbus_connection_send_message_unlocked (connection, message, flags, out_serial, error);
47+ ret = g_dbus_connection_send_message_unlocked (connection, message, flags, (guint32 *) out_serial, error);
48 CONNECTION_UNLOCK (connection);
49 return ret;
50 }
51@@ -1901,7 +1901,7 @@ g_dbus_connection_send_message_with_reply_unlocked (GDBusConnection *connect
52 GDBusMessage *message,
53 GDBusSendMessageFlags flags,
54 gint timeout_msec,
55- volatile guint32 *out_serial,
56+ guint32 *out_serial,
57 GCancellable *cancellable,
58 GAsyncReadyCallback callback,
59 gpointer user_data)
60@@ -1909,7 +1909,7 @@ g_dbus_connection_send_message_with_reply_unlocked (GDBusConnection *connect
61 GTask *task;
62 SendMessageData *data;
63 GError *error = NULL;
64- volatile guint32 serial;
65+ guint32 serial;
66
67 if (out_serial == NULL)
68 out_serial = &serial;
69@@ -2022,7 +2022,7 @@ g_dbus_connection_send_message_with_reply (GDBusConnection *connection,
70 message,
71 flags,
72 timeout_msec,
73- out_serial,
74+ (guint32 *) out_serial,
75 cancellable,
76 callback,
77 user_data);
78@@ -3082,7 +3082,7 @@ g_dbus_connection_get_peer_credentials (GDBusConnection *connection)
79
80 /* ---------------------------------------------------------------------------------------------------- */
81
82-static volatile guint _global_filter_id = 1;
83+static guint _global_filter_id = 1; /* (atomic) */
84
85 /**
86 * g_dbus_connection_add_filter:
87@@ -3327,9 +3327,9 @@ args_to_rule (const gchar *sender,
88 return g_string_free (rule, FALSE);
89 }
90
91-static volatile guint _global_subscriber_id = 1;
92-static volatile guint _global_registration_id = 1;
93-static volatile guint _global_subtree_registration_id = 1;
94+static guint _global_subscriber_id = 1; /* (atomic) */
95+static guint _global_registration_id = 1; /* (atomic) */
96+static guint _global_subtree_registration_id = 1; /* (atomic) */
97
98 /* ---------------------------------------------------------------------------------------------------- */
99
100@@ -5992,7 +5992,7 @@ g_dbus_connection_call_sync_internal (GDBusConnection *connection,
101 message,
102 send_flags,
103 timeout_msec,
104- NULL, /* volatile guint32 *out_serial */
105+ NULL, /* guint32 *out_serial */
106 cancellable,
107 &local_error);
108
109--
1102.30.1
111