[gcr/bugfix/drop-volatile] Drop "volatile" for g_once_init_enter locations




commit a18c22298a34b0ea51f23f73f0d75461fe5453f4
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sun May 2 16:57:13 2021 +0200

    Drop "volatile" for g_once_init_enter locations
    
    This fixes a few (fatal in gcc 11) warnings, breaking the CI.
    
    For the original discussion on why this change is needed, see
    https://gitlab.gnome.org/GNOME/glib/-/issues/600

 egg/egg-libgcrypt.c          | 2 +-
 egg/egg-oid.c                | 2 +-
 egg/egg-symkey.c             | 2 +-
 gck/gck-misc.c               | 2 +-
 gck/gck-object-cache.c       | 2 +-
 gck/gck-uri.c                | 2 +-
 gcr/gcr-certificate.c        | 2 +-
 gcr/gcr-collection.c         | 2 +-
 gcr/gcr-import-interaction.c | 2 +-
 gcr/gcr-importer.c           | 2 +-
 gcr/gcr-mkoids               | 2 +-
 gcr/gcr-parser.c             | 2 +-
 gcr/gcr-system-prompt.c      | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/egg/egg-libgcrypt.c b/egg/egg-libgcrypt.c
index 7c3e889..adb5195 100644
--- a/egg/egg-libgcrypt.c
+++ b/egg/egg-libgcrypt.c
@@ -59,7 +59,7 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
 void
 egg_libgcrypt_initialize (void)
 {
-       static volatile gsize gcrypt_initialized = 0;
+       static size_t gcrypt_initialized = 0;
        unsigned seed;
 
        if (g_once_init_enter (&gcrypt_initialized)) {
diff --git a/egg/egg-oid.c b/egg/egg-oid.c
index ec77a0b..48e9677 100644
--- a/egg/egg-oid.c
+++ b/egg/egg-oid.c
@@ -142,7 +142,7 @@ static OidInfo oid_info[] = {
 static OidInfo*
 find_oid_info (GQuark oid)
 {
-       static volatile gsize inited_oids = 0;
+       static size_t inited_oids = 0;
        int i;
 
        g_return_val_if_fail (oid != 0, NULL);
diff --git a/egg/egg-symkey.c b/egg/egg-symkey.c
index a0b08a3..76c4f6b 100644
--- a/egg/egg-symkey.c
+++ b/egg/egg-symkey.c
@@ -56,7 +56,7 @@ static GQuark OID_SHA1;
 static void
 init_quarks (void)
 {
-       static volatile gsize quarks_inited = 0;
+       static size_t quarks_inited = 0;
 
        if (g_once_init_enter (&quarks_inited)) {
 
diff --git a/gck/gck-misc.c b/gck/gck-misc.c
index 8dc50f6..e44241b 100644
--- a/gck/gck-misc.c
+++ b/gck/gck-misc.c
@@ -139,7 +139,7 @@ GQuark
 gck_error_get_quark (void)
 {
        static GQuark domain = 0;
-       static volatile gsize quark_inited = 0;
+       static size_t quark_inited = 0;
 
        if (g_once_init_enter (&quark_inited)) {
                domain = g_quark_from_static_string ("gck-error");
diff --git a/gck/gck-object-cache.c b/gck/gck-object-cache.c
index 4db51b3..fd1e170 100644
--- a/gck/gck-object-cache.c
+++ b/gck/gck-object-cache.c
@@ -66,7 +66,7 @@ G_DEFINE_INTERFACE (GckObjectCache, gck_object_cache, GCK_TYPE_OBJECT);
 static void
 gck_object_cache_default_init (GckObjectCacheIface *iface)
 {
-       static volatile gsize initialized = 0;
+       static size_t initialized = 0;
        if (g_once_init_enter (&initialized)) {
 
                /**
diff --git a/gck/gck-uri.c b/gck/gck-uri.c
index 6c7c7dc..7187042 100644
--- a/gck/gck-uri.c
+++ b/gck/gck-uri.c
@@ -155,7 +155,7 @@ GQuark
 gck_uri_error_get_quark (void)
 {
        static GQuark domain = 0;
-       static volatile gsize quark_inited = 0;
+       static size_t quark_inited = 0;
 
        if (g_once_init_enter (&quark_inited)) {
                domain = g_quark_from_static_string ("gck-uri-error");
diff --git a/gcr/gcr-certificate.c b/gcr/gcr-certificate.c
index 01e1b35..22bfabb 100644
--- a/gcr/gcr-certificate.c
+++ b/gcr/gcr-certificate.c
@@ -255,7 +255,7 @@ on_transform_date_to_string (const GValue *src, GValue *dest)
 static void
 gcr_certificate_default_init (GcrCertificateIface *iface)
 {
-       static volatile gsize initialized = 0;
+       static size_t initialized = 0;
 
        if (g_once_init_enter (&initialized)) {
                CERTIFICATE_INFO = g_quark_from_static_string ("_gcr_certificate_certificate_info");
diff --git a/gcr/gcr-collection.c b/gcr/gcr-collection.c
index 54c4667..5d9ff69 100644
--- a/gcr/gcr-collection.c
+++ b/gcr/gcr-collection.c
@@ -56,7 +56,7 @@ G_DEFINE_INTERFACE (GcrCollection, gcr_collection, G_TYPE_OBJECT);
 static void
 gcr_collection_default_init (GcrCollectionIface *iface)
 {
-       static volatile gsize initialized = 0;
+       static size_t initialized = 0;
 
        if (g_once_init_enter (&initialized)) {
 
diff --git a/gcr/gcr-import-interaction.c b/gcr/gcr-import-interaction.c
index c8e7585..5fafa4c 100644
--- a/gcr/gcr-import-interaction.c
+++ b/gcr/gcr-import-interaction.c
@@ -58,7 +58,7 @@ G_DEFINE_INTERFACE (GcrImportInteraction, gcr_import_interaction, G_TYPE_TLS_INT
 static void
 gcr_import_interaction_default_init (GcrImportInteractionIface *iface)
 {
-       static volatile gsize initialized = 0;
+       static size_t initialized = 0;
 
        if (g_once_init_enter (&initialized)) {
                g_once_init_leave (&initialized, 1);
diff --git a/gcr/gcr-importer.c b/gcr/gcr-importer.c
index d3df41b..0a119e8 100644
--- a/gcr/gcr-importer.c
+++ b/gcr/gcr-importer.c
@@ -86,7 +86,7 @@ static gboolean registered_sorted = FALSE;
 static void
 gcr_importer_default_init (GcrImporterIface *iface)
 {
-       static volatile gsize initialized = 0;
+       static size_t initialized = 0;
 
        if (g_once_init_enter (&initialized)) {
 
diff --git a/gcr/gcr-mkoids b/gcr/gcr-mkoids
index b0eb5c4..ad8b0a9 100644
--- a/gcr/gcr-mkoids
+++ b/gcr/gcr-mkoids
@@ -38,7 +38,7 @@ generate_source ()
                        echo "GQuark"
                        echo "_${LOWER}_oid_${lname}_get_quark (void)"
                        echo "{"
-                       echo "  static volatile gsize inited = 0;"
+                       echo "  static size_t inited = 0;"
                        echo "  static GQuark quark = 0;"
                        echo "  if (g_once_init_enter (&inited)) {"
                        echo "          quark = g_quark_from_static_string (\"${oid}\");"
diff --git a/gcr/gcr-parser.c b/gcr/gcr-parser.c
index adec310..812ed94 100644
--- a/gcr/gcr-parser.c
+++ b/gcr/gcr-parser.c
@@ -187,7 +187,7 @@ static GQuark ARMOR_PGP_PRIVATE_KEY_BLOCK;
 static void
 init_quarks (void)
 {
-       static volatile gsize quarks_inited = 0;
+       static size_t quarks_inited = 0;
 
        if (g_once_init_enter (&quarks_inited)) {
 
diff --git a/gcr/gcr-system-prompt.c b/gcr/gcr-system-prompt.c
index b58aa2b..530faf6 100644
--- a/gcr/gcr-system-prompt.c
+++ b/gcr/gcr-system-prompt.c
@@ -1642,7 +1642,7 @@ static const GDBusErrorEntry SYSTEM_PROMPT_ERRORS[] = {
 GQuark
 gcr_system_prompt_error_get_domain (void)
 {
-       static volatile gsize quark_volatile = 0;
+       static size_t quark_volatile = 0;
        g_dbus_error_register_error_domain ("gcr-system-prompt-error-domain",
                                            &quark_volatile,
                                            SYSTEM_PROMPT_ERRORS,


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