[tracker: 7/8] Remove volatile from g_once_init_{enter, leave}() arguments
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker: 7/8] Remove volatile from g_once_init_{enter, leave}() arguments
- Date: Sat, 8 May 2021 10:52:18 +0000 (UTC)
commit eac86d26680de894a855a41f2a66d32101d30868
Author: Daniele Nicolodi <daniele grinta net>
Date: Tue Apr 27 14:01:46 2021 +0200
Remove volatile from g_once_init_{enter,leave}() arguments
The argument to g_once_init_enter() and g_once_init_leave() should not
be volatile, accordig to the GLib documentation. This fixes several
incompatible pointer types warnings.
src/libtracker-common/tracker-enum-types.c.template | 16 ++++++++--------
src/libtracker-data/tracker-data-enum-types.c.template | 16 ++++++++--------
src/libtracker-sparql/tracker-namespace-manager.c | 8 ++++----
.../tracker-sparql-enum-types.c.template | 10 +++++-----
src/libtracker-sparql/tracker-uri.c | 16 ++++++++--------
5 files changed, 33 insertions(+), 33 deletions(-)
---
diff --git a/src/libtracker-common/tracker-enum-types.c.template
b/src/libtracker-common/tracker-enum-types.c.template
index 4e6b3007d..097a659be 100644
--- a/src/libtracker-common/tracker-enum-types.c.template
+++ b/src/libtracker-common/tracker-enum-types.c.template
@@ -15,9 +15,9 @@
GType
@enum_name@_get_type (void)
{
- static volatile gsize g_define_type_id__volatile = 0;
-
- if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static gsize g_define_type_id = 0;
+
+ if (g_once_init_enter (&g_define_type_id)) {
static const G@Type@Value values[] = {
/*** END value-header ***/
@@ -28,13 +28,13 @@ GType
/*** BEGIN value-tail ***/
{ 0, NULL, NULL }
};
- GType g_define_type_id =
+ GType type =
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
-
- g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+
+ g_once_init_leave (&g_define_type_id, type);
}
-
- return g_define_type_id__volatile;
+
+ return g_define_type_id;
}
/*** END value-tail ***/
diff --git a/src/libtracker-data/tracker-data-enum-types.c.template
b/src/libtracker-data/tracker-data-enum-types.c.template
index 1cad5a372..d9a15bc0e 100644
--- a/src/libtracker-data/tracker-data-enum-types.c.template
+++ b/src/libtracker-data/tracker-data-enum-types.c.template
@@ -15,9 +15,9 @@
GType
@enum_name@_get_type (void)
{
- static volatile gsize g_define_type_id__volatile = 0;
-
- if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static gsize g_define_type_id = 0;
+
+ if (g_once_init_enter (&g_define_type_id)) {
static const G@Type@Value values[] = {
/*** END value-header ***/
@@ -28,13 +28,13 @@ GType
/*** BEGIN value-tail ***/
{ 0, NULL, NULL }
};
- GType g_define_type_id =
+ GType type =
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
-
- g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+
+ g_once_init_leave (&g_define_type_id, type);
}
-
- return g_define_type_id__volatile;
+
+ return g_define_type_id;
}
/*** END value-tail ***/
diff --git a/src/libtracker-sparql/tracker-namespace-manager.c
b/src/libtracker-sparql/tracker-namespace-manager.c
index 6a4ebc315..7cac92d90 100644
--- a/src/libtracker-sparql/tracker-namespace-manager.c
+++ b/src/libtracker-sparql/tracker-namespace-manager.c
@@ -125,9 +125,9 @@ tracker_namespace_manager_new ()
TrackerNamespaceManager *
tracker_namespace_manager_get_default ()
{
- static TrackerNamespaceManager * volatile default_namespace_manager__volatile = NULL;
+ static TrackerNamespaceManager *default_namespace_manager = NULL;
- if (g_once_init_enter (&default_namespace_manager__volatile)) {
+ if (g_once_init_enter (&default_namespace_manager)) {
TrackerNamespaceManager *manager = tracker_namespace_manager_new();
tracker_namespace_manager_add_prefix (manager, "rdf", TRACKER_PREFIX_RDF);
@@ -147,10 +147,10 @@ tracker_namespace_manager_get_default ()
tracker_namespace_manager_add_prefix (manager, "mfo", TRACKER_PREFIX_MFO);
tracker_namespace_manager_add_prefix (manager, "osinfo", TRACKER_PREFIX_OSINFO);
- g_once_init_leave (&default_namespace_manager__volatile, manager);
+ g_once_init_leave (&default_namespace_manager, manager);
}
- return default_namespace_manager__volatile;
+ return default_namespace_manager;
}
/**
diff --git a/src/libtracker-sparql/tracker-sparql-enum-types.c.template
b/src/libtracker-sparql/tracker-sparql-enum-types.c.template
index 142e2d7a8..a411cecfd 100644
--- a/src/libtracker-sparql/tracker-sparql-enum-types.c.template
+++ b/src/libtracker-sparql/tracker-sparql-enum-types.c.template
@@ -15,9 +15,9 @@
GType
@enum_name@_get_type (void)
{
- static volatile gsize g_define_type_id__volatile = 0;
+ static gsize g_define_type_id = 0;
- if (g_once_init_enter (&g_define_type_id__volatile)) {
+ if (g_once_init_enter (&g_define_type_id)) {
static const G@Type@Value values[] = {
/*** END value-header ***/
@@ -28,13 +28,13 @@ GType
/*** BEGIN value-tail ***/
{ 0, NULL, NULL }
};
- GType g_define_type_id =
+ GType type =
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
- g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ g_once_init_leave (&g_define_type_id, type);
}
- return g_define_type_id__volatile;
+ return g_define_type_id;
}
/*** END value-tail ***/
diff --git a/src/libtracker-sparql/tracker-uri.c b/src/libtracker-sparql/tracker-uri.c
index 3f01256b0..dee41e51a 100644
--- a/src/libtracker-sparql/tracker-uri.c
+++ b/src/libtracker-sparql/tracker-uri.c
@@ -36,16 +36,16 @@
GType
tracker_uri_get_type (void)
{
- static volatile gsize g_define_type_id__volatile = 0;
- if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static gsize g_define_type_id = 0;
+ if (g_once_init_enter (&g_define_type_id)) {
GTypeInfo info = { 0, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, };
- GType g_define_type_id = g_type_register_static (G_TYPE_STRING,
- g_intern_static_string ("TrackerUri"),
- &info,
- 0);
- g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ GType type = g_type_register_static (G_TYPE_STRING,
+ g_intern_static_string ("TrackerUri"),
+ &info,
+ 0);
+ g_once_init_leave (&g_define_type_id, type);
}
- return g_define_type_id__volatile;
+ return g_define_type_id;
}
static const char *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]