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




commit cfce340a3df811078a7cd6068786d039b1e9eed7
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.

 src/libtracker-miners-common/tracker-miners-enum-types.c.template | 8 ++++----
 1 file changed, 4 insertions(+), 4 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..13f8c135c 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;
+  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]