[libgsf] init: use g_type_ensure.



commit 90e1e9c85d862e9f68ec30f8cce15f8eac162b39
Author: Morten Welinder <terra gnome org>
Date:   Thu Aug 2 11:28:14 2018 -0400

    init: use g_type_ensure.

 configure.ac    | 2 +-
 gsf/gsf-utils.c | 9 +--------
 2 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d60ba10..67af833 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,7 +71,7 @@ ifelse([
 ])
 dnl Modules required for libgsf
 libgsf_reqs="
-    gobject-2.0 >= 2.16.0
+    gobject-2.0 >= 2.34.0
     glib-2.0 >= 2.26.0
     gio-2.0 >= 2.26.0
     libxml-2.0 >= 2.4.16
diff --git a/gsf/gsf-utils.c b/gsf/gsf-utils.c
index 063402a..4534334 100644
--- a/gsf/gsf-utils.c
+++ b/gsf/gsf-utils.c
@@ -163,7 +163,7 @@ gsf_shutdown (void)
        } while (0)
 #else
 /* Assign the value to avoid compiler warnings */
-#define REGISTER(prefix)       t = prefix ## _get_type()
+#define REGISTER(prefix)       g_type_ensure (prefix ## _get_type())
 #endif
 
 /**
@@ -176,7 +176,6 @@ void
 gsf_init_dynamic (GTypeModule *module)
 {
 #ifndef _GSF_GTYPE_THREADING_FIXED
-       GType t;
        if (NULL != module) {
                g_warning ("glib's support of dynamic types is not thread safe.\n"
                           "Support for gsf_init_dynamic has been disabled until that is fixed");
@@ -222,12 +221,6 @@ gsf_init_dynamic (GTypeModule *module)
        REGISTER (gsf_clip_data);
        REGISTER (gsf_doc_meta_data);
        REGISTER (gsf_docprop_vector);
-
-#ifndef _GSF_GTYPE_THREADING_FIXED
-       /* add a test to avoid a set but unused variable warning */
-       if (t == 0)
-               g_warning ("Failed to register objects types");
-#endif
 }
 
 /**


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