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




commit 6a1ca605effc60d76c35981dd23125c7089bfb3e
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 | 8 ++++----
 1 file changed, 4 insertions(+), 4 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..94f130358 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;
+  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 ***/
 
@@ -31,10 +31,10 @@ GType
     GType g_define_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, g_define_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]