[gupnp] g_type_init() is deprecated for glib >= 2.35.0



commit 96bea0f67ee6b6209902bc276802feb877bb882c
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Thu Nov 15 16:46:15 2012 +0000

    g_type_init() is deprecated for glib >= 2.35.0
    
    Call it for old versions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688411

 doc/client-tutorial.xml    |    4 +++-
 doc/server-tutorial.xml    |    4 +++-
 examples/light-client.c    |    3 +++
 examples/light-server.c    |    2 ++
 tests/gtest/test-context.c |    2 ++
 tests/test-browsing.c      |    2 ++
 tests/test-introspection.c |    2 ++
 tests/test-proxy.c         |    2 ++
 tests/test-server.c        |    2 ++
 9 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/doc/client-tutorial.xml b/doc/client-tutorial.xml
index 4a60e3b..c480e07 100644
--- a/doc/client-tutorial.xml
+++ b/doc/client-tutorial.xml
@@ -47,7 +47,9 @@ main (int argc, char **argv)
   GUPnPControlPoint *cp;
   
   /* Required initialisation */
-  g_type_init ();
+  #if !GLIB_CHECK_VERSION(2,35,0)
+    g_type_init ();
+  #endif
 
   /* Create a new GUPnP Context.  By here we are using the default GLib main
      context, and connecting to the current machine's default IP on an
diff --git a/doc/server-tutorial.xml b/doc/server-tutorial.xml
index 4066bcc..06f1501 100644
--- a/doc/server-tutorial.xml
+++ b/doc/server-tutorial.xml
@@ -129,7 +129,9 @@
     </para>
     <programlisting>GUPnPContext *context;
 /* Initialize required subsystems */
-g_type_init ();
+#if !GLIB_CHECK_VERSION(2,35,0)
+  g_type_init ();
+#endif
 /* Create the GUPnP context with default host and port */
 context = gupnp_context_new (NULL, NULL, 0, NULL);</programlisting>
     <para>
diff --git a/examples/light-client.c b/examples/light-client.c
index 2944c2a..69f2b74 100644
--- a/examples/light-client.c
+++ b/examples/light-client.c
@@ -77,7 +77,10 @@ main (int argc, char **argv)
   GUPnPContext *context;
   GUPnPControlPoint *cp;
 
+#if !GLIB_CHECK_VERSION(2,35,0)
   g_type_init ();
+#endif
+
 
   /* Check and parse command line arguments */
   if (argc != 2) {
diff --git a/examples/light-server.c b/examples/light-server.c
index 7b7caba..eecd51d 100644
--- a/examples/light-server.c
+++ b/examples/light-server.c
@@ -109,7 +109,9 @@ main (int argc, char **argv)
   GUPnPRootDevice *dev;
   GUPnPServiceInfo *service;
   
+#if !GLIB_CHECK_VERSION(2,35,0)
   g_type_init ();
+#endif
 
   /* By default the light is off */
   status = FALSE;
diff --git a/tests/gtest/test-context.c b/tests/gtest/test-context.c
index 8e230a2..9126e87 100644
--- a/tests/gtest/test-context.c
+++ b/tests/gtest/test-context.c
@@ -222,7 +222,9 @@ test_gupnp_context_http_ranged_requests (void)
 }
 
 int main (int argc, char *argv[]) {
+#if !GLIB_CHECK_VERSION(2,35,0)
         g_type_init ();
+#endif
         g_test_init (&argc, &argv, NULL);
         g_test_add_func ("/context/http/ranged-requests",
                          test_gupnp_context_http_ranged_requests);
diff --git a/tests/test-browsing.c b/tests/test-browsing.c
index 161907f..bdb78ae 100644
--- a/tests/test-browsing.c
+++ b/tests/test-browsing.c
@@ -100,7 +100,9 @@ main (int argc, char **argv)
         struct sigaction sig_action;
 #endif /* G_OS_WIN32 */
 
+#if !GLIB_CHECK_VERSION(2,35,0)
         g_type_init ();
+#endif
         setlocale (LC_ALL, "");
 
         error = NULL;
diff --git a/tests/test-introspection.c b/tests/test-introspection.c
index 2569b62..1b25e5d 100644
--- a/tests/test-introspection.c
+++ b/tests/test-introspection.c
@@ -256,7 +256,9 @@ main (int argc, char **argv)
                 return EXIT_FAILURE;
         }
 		
+#if !GLIB_CHECK_VERSION(2,35,0)
         g_type_init ();
+#endif
 
         error = NULL;
         context = g_initable_new (GUPNP_TYPE_CONTEXT, NULL, &error, NULL);
diff --git a/tests/test-proxy.c b/tests/test-proxy.c
index c9a8fd8..e7059d2 100644
--- a/tests/test-proxy.c
+++ b/tests/test-proxy.c
@@ -156,7 +156,9 @@ main (int argc, char **argv)
         struct sigaction sig_action;
 #endif /* G_OS_WIN32 */
 
+#if !GLIB_CHECK_VERSION(2,35,0)
         g_type_init ();
+#endif
         setlocale (LC_ALL, "");
 
         error = NULL;
diff --git a/tests/test-server.c b/tests/test-server.c
index 046e6c6..bed1a4b 100644
--- a/tests/test-server.c
+++ b/tests/test-server.c
@@ -72,7 +72,9 @@ main (int argc, char **argv)
                 return EXIT_FAILURE;
         }
 
+#if !GLIB_CHECK_VERSION(2,35,0)
         g_type_init ();
+#endif
         setlocale (LC_ALL, "");
 
         error = NULL;



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