[tracker-miners/wip/carlosg/compiler-warnings: 13/23] libtracker-miners-common: Do not set volatile on g_once arguments




commit e40a08294d66867defbf380e3a65d62c53f28181
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Aug 28 23:37:39 2022 +0200

    libtracker-miners-common: Do not set volatile on g_once arguments
    
    It is a mistake to do so, and the compiler warns about it.

 .../tracker-miners-enum-types.c.template                 | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-miners-common/tracker-miners-enum-types.c.template 
b/src/libtracker-miners-common/tracker-miners-enum-types.c.template
index c712dda4f..4db7ef139 100644
--- a/src/libtracker-miners-common/tracker-miners-enum-types.c.template
+++ b/src/libtracker-miners-common/tracker-miners-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_id =
        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_id);
   }
-    
-  return g_define_type_id__volatile;
+
+  return g_define_type_id;
 }
 
 /*** END value-tail ***/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]