summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glib-2.0/glib-2.0/0008-gdbuserror-Drop-unnecessary-volatile-qualifiers-from.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-03-04 11:38:40 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-14 16:33:59 +0000
commiteec64066073428e38d5b0b6947ff302943188f65 (patch)
treeec55d656734941dee8b2a599b588a12cc174337d /meta/recipes-core/glib-2.0/glib-2.0/0008-gdbuserror-Drop-unnecessary-volatile-qualifiers-from.patch
parent8a74a7deca45ceef351f47a9f160df9bafc0f546 (diff)
downloadpoky-eec64066073428e38d5b0b6947ff302943188f65.tar.gz
glib-2.0: Drop volatile qualifier
Fixes glib/gatomic.h:112:5: error: argument 2 of '__atomic_load' discards 'volatile' qualifier [-Werror=incompatible-pointer-types] (From OE-Core rev: 06ac55a06f2300fa5442ec73a28c3f52022cc640) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glib-2.0/glib-2.0/0008-gdbuserror-Drop-unnecessary-volatile-qualifiers-from.patch')
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/0008-gdbuserror-Drop-unnecessary-volatile-qualifiers-from.patch95
1 files changed, 95 insertions, 0 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0008-gdbuserror-Drop-unnecessary-volatile-qualifiers-from.patch b/meta/recipes-core/glib-2.0/glib-2.0/0008-gdbuserror-Drop-unnecessary-volatile-qualifiers-from.patch
new file mode 100644
index 0000000000..e947a264c5
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/0008-gdbuserror-Drop-unnecessary-volatile-qualifiers-from.patch
@@ -0,0 +1,95 @@
1From 7c7623c4a31fb0f2a7176c43acc728093818b58c Mon Sep 17 00:00:00 2001
2From: Philip Withnall <pwithnall@endlessos.org>
3Date: Wed, 11 Nov 2020 18:26:19 +0000
4Subject: [PATCH 08/29] gdbuserror: Drop unnecessary volatile qualifiers from
5 variables
6
7This should introduce no API changes. The
8`g_dbus_error_register_error_domain()` function still (incorrectly) has
9a `volatile` argument, but dropping that qualifier 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/gdbuserror.c | 28 +++++++++++++++++-----------
18 1 file changed, 17 insertions(+), 11 deletions(-)
19
20diff --git a/gio/gdbuserror.c b/gio/gdbuserror.c
21index 682677354..b03a33f27 100644
22--- a/gio/gdbuserror.c
23+++ b/gio/gdbuserror.c
24@@ -84,12 +84,12 @@
25 * GQuark
26 * foo_bar_error_quark (void)
27 * {
28- * static volatile gsize quark_volatile = 0;
29+ * static gsize quark = 0;
30 * g_dbus_error_register_error_domain ("foo-bar-error-quark",
31- * &quark_volatile,
32+ * &quark,
33 * foo_bar_error_entries,
34 * G_N_ELEMENTS (foo_bar_error_entries));
35- * return (GQuark) quark_volatile;
36+ * return (GQuark) quark;
37 * }
38 * ]|
39 * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and
40@@ -160,12 +160,12 @@ GQuark
41 g_dbus_error_quark (void)
42 {
43 G_STATIC_ASSERT (G_N_ELEMENTS (g_dbus_error_entries) - 1 == G_DBUS_ERROR_PROPERTY_READ_ONLY);
44- static volatile gsize quark_volatile = 0;
45+ static gsize quark = 0;
46 g_dbus_error_register_error_domain ("g-dbus-error-quark",
47- &quark_volatile,
48+ &quark,
49 g_dbus_error_entries,
50 G_N_ELEMENTS (g_dbus_error_entries));
51- return (GQuark) quark_volatile;
52+ return (GQuark) quark;
53 }
54
55 /**
56@@ -185,25 +185,31 @@ g_dbus_error_register_error_domain (const gchar *error_domain_quark_na
57 const GDBusErrorEntry *entries,
58 guint num_entries)
59 {
60+ gsize *quark;
61+
62 g_return_if_fail (error_domain_quark_name != NULL);
63 g_return_if_fail (quark_volatile != NULL);
64 g_return_if_fail (entries != NULL);
65 g_return_if_fail (num_entries > 0);
66
67- if (g_once_init_enter (quark_volatile))
68+ /* Drop the volatile qualifier, which should never have been on the argument
69+ * in the first place. */
70+ quark = (gsize *) quark_volatile;
71+
72+ if (g_once_init_enter (quark))
73 {
74 guint n;
75- GQuark quark;
76+ GQuark new_quark;
77
78- quark = g_quark_from_static_string (error_domain_quark_name);
79+ new_quark = g_quark_from_static_string (error_domain_quark_name);
80
81 for (n = 0; n < num_entries; n++)
82 {
83- g_warn_if_fail (g_dbus_error_register_error (quark,
84+ g_warn_if_fail (g_dbus_error_register_error (new_quark,
85 entries[n].error_code,
86 entries[n].dbus_error_name));
87 }
88- g_once_init_leave (quark_volatile, quark);
89+ g_once_init_leave (quark, new_quark);
90 }
91 }
92
93--
942.30.1
95