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




commit 34de3462e63730b5a1f51322121924c3d08c7bb5
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]