[PATCH] glib: remove invocations of g_type_init()

Ben Chan benchan at chromium.org
Tue Jun 27 03:58:22 UTC 2017


g_type_init() has been deprecated (and also marked with the attribute
'deprecated') since glib 2.36 as the type system is automatically
initialized. Since the minimum version of glib required by libmbim is
2.36, calling g_type_init() isn't necessarily in the libmbim code.
---
 src/mbim-proxy/mbim-proxy.c | 4 ----
 src/mbimcli/mbimcli.c       | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/src/mbim-proxy/mbim-proxy.c b/src/mbim-proxy/mbim-proxy.c
index 2e8eeb9..46f023e 100644
--- a/src/mbim-proxy/mbim-proxy.c
+++ b/src/mbim-proxy/mbim-proxy.c
@@ -196,10 +196,6 @@ int main (int argc, char **argv)
 
     setlocale (LC_ALL, "");
 
-#if !GLIB_CHECK_VERSION (2, 36, 0)
-    g_type_init ();
-#endif
-
     /* Setup option context, process it and destroy it */
     context = g_option_context_new ("- Proxy for MBIM devices");
     g_option_context_add_main_entries (context, main_entries, NULL);
diff --git a/src/mbimcli/mbimcli.c b/src/mbimcli/mbimcli.c
index a265895..76183fd 100644
--- a/src/mbimcli/mbimcli.c
+++ b/src/mbimcli/mbimcli.c
@@ -372,10 +372,6 @@ int main (int argc, char **argv)
 
     setlocale (LC_ALL, "");
 
-#if !GLIB_CHECK_VERSION (2, 36, 0)
-    g_type_init ();
-#endif
-
     /* Setup option context, process it and destroy it */
     context = g_option_context_new ("- Control MBIM devices");
     g_option_context_add_group (context,
-- 
2.13.1.611.g7e3b11ae1-goog



More information about the libmbim-devel mailing list