[gnome-panel] libgnome-panel: drop use of volatile



commit 6727d09d4bfd9c2db46495954062ca91d5d27e66
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Aug 20 18:20:34 2021 +0300

    libgnome-panel: drop use of volatile

 libgnome-panel/gp-enum-types.c.in | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/libgnome-panel/gp-enum-types.c.in b/libgnome-panel/gp-enum-types.c.in
index 5cb8b9201..674ff90b2 100644
--- a/libgnome-panel/gp-enum-types.c.in
+++ b/libgnome-panel/gp-enum-types.c.in
@@ -11,27 +11,30 @@
 GType
 @enum_name@_get_type (void)
 {
-  static volatile gsize g_enum_type_id__volatile = 0;
-
-  if (g_once_init_enter (&g_enum_type_id__volatile))
+  static gsize g_enum_type_id = 0;
+  static const G@Type@Value values[] =
     {
-      static const G@Type@Value values[] = {
 /*** END value-header ***/
 
 /*** BEGIN value-production ***/
-        { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
+      { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
 /*** END value-production ***/
 
 /*** BEGIN value-tail ***/
-        { 0, NULL, NULL }
-      };
-      GType g_enum_type_id;
+      { 0, NULL, NULL }
+    };
+
+  if (g_once_init_enter (&g_enum_type_id))
+    {
+      const char *string;
+      GType id;
 
-      g_enum_type_id = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
+      string = g_intern_static_string ("@EnumName@");
+      id = g_@type@_register_static (string, values);
 
-      g_once_init_leave (&g_enum_type_id__volatile, g_enum_type_id);
+      g_once_init_leave (&g_enum_type_id, id);
     }
 
-  return g_enum_type_id__volatile;
+  return g_enum_type_id;
 }
 /*** END value-tail ***/


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