[gcr/wip/gcr4] gck: Use G_DEFINE_QUARK to define GckUriError quark



commit b9ca5bb826aaac46585b67facf030559a287446f
Author: Corentin Noël <corentin noel collabora com>
Date:   Wed Oct 6 18:20:16 2021 +0200

    gck: Use G_DEFINE_QUARK to define GckUriError quark

 gck/gck-uri.c | 14 +-------------
 gck/gck-uri.h |  4 ++--
 2 files changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/gck/gck-uri.c b/gck/gck-uri.c
index 814b199..91d32c3 100644
--- a/gck/gck-uri.c
+++ b/gck/gck-uri.c
@@ -144,19 +144,7 @@ struct _GckUri {
        GckAttributes *attributes;
 };
 
-GQuark
-gck_uri_error_get_quark (void)
-{
-       static GQuark domain = 0;
-       static size_t quark_inited = 0;
-
-       if (g_once_init_enter (&quark_inited)) {
-               domain = g_quark_from_static_string ("gck-uri-error");
-               g_once_init_leave (&quark_inited, 1);
-       }
-
-       return domain;
-}
+G_DEFINE_QUARK(gck-uri-error, gck_uri_error)
 
 /**
  * gck_uri_data_new:
diff --git a/gck/gck-uri.h b/gck/gck-uri.h
index 98970ca..ce48edf 100644
--- a/gck/gck-uri.h
+++ b/gck/gck-uri.h
@@ -52,9 +52,9 @@ struct _GckUriData {
        gpointer dummy[4];
 };
 
-#define             GCK_URI_ERROR                           (gck_uri_error_get_quark ())
+#define             GCK_URI_ERROR                           (gck_uri_error_quark ())
 
-GQuark              gck_uri_error_get_quark                 (void) G_GNUC_CONST;
+GQuark              gck_uri_error_quark                     (void) G_GNUC_CONST;
 
 GckUriData*         gck_uri_data_new                        (void);
 


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