[evince/wip/chpe/build-fixes: 5/6] libdocument: Fix volatile misuse




commit fb03cdbda1e102dcb02b75608855a33758f69b7e
Author: Christian Persch <chpe src gnome org>
Date:   Tue Nov 16 23:34:27 2021 +0100

    libdocument: Fix volatile misuse

 libdocument/ev-document-type-builtins.c.template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/libdocument/ev-document-type-builtins.c.template 
b/libdocument/ev-document-type-builtins.c.template
index 0449b7601..35e1d403b 100644
--- a/libdocument/ev-document-type-builtins.c.template
+++ b/libdocument/ev-document-type-builtins.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 ***/
 
@@ -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]