[tracker-miners/wip/carlosg/compiler-warnings: 1/12] libtracker-miner: Do not set volatile on g_once argument




commit c3ce0f05f7717107d4df2195d14eb27739974f83
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Aug 28 23:36:56 2022 +0200

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

 src/libtracker-miner/tracker-miner-enum-types.c.template | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-enum-types.c.template 
b/src/libtracker-miner/tracker-miner-enum-types.c.template
index 7be7a0180..b969c4753 100644
--- a/src/libtracker-miner/tracker-miner-enum-types.c.template
+++ b/src/libtracker-miner/tracker-miner-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]