[gcr/wip/nielsdg/cleanup-type-boilerplate: 2/2] gcr: Cleanup with G_DEFINE_BOXED_TYPE



commit 7c5deaf90e6bb87101d43265e6e9fff1cf1c1fa6
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Tue Mar 31 15:04:48 2020 +0200

    gcr: Cleanup with G_DEFINE_BOXED_TYPE

 gcr/gcr-parser.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
---
diff --git a/gcr/gcr-parser.c b/gcr/gcr-parser.c
index 288a3f1..f841535 100644
--- a/gcr/gcr-parser.c
+++ b/gcr/gcr-parser.c
@@ -2747,19 +2747,7 @@ gcr_parser_get_parsed (GcrParser *self)
        return self->pv->parsed;
 }
 
-GType
-gcr_parsed_get_type (void)
-{
-       static volatile gsize initialized = 0;
-       static GType type = 0;
-       if (g_once_init_enter (&initialized)) {
-               type = g_boxed_type_register_static ("GcrParsed",
-                                                    (GBoxedCopyFunc)gcr_parsed_ref,
-                                                    (GBoxedFreeFunc)gcr_parsed_unref);
-               g_once_init_leave (&initialized, 1);
-       }
-       return type;
-}
+G_DEFINE_BOXED_TYPE (GcrParsed, gcr_parsed, gcr_parsed_ref, gcr_parsed_unref)
 
 /**
  * gcr_parser_get_filename:


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