[gdk-pixbuf] Avoid deprecation warnings for g_type_init



commit d3f583a6cd9d83bc5862f1b248527bbeaceb93af
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Dec 28 00:23:03 2012 -0500

    Avoid deprecation warnings for g_type_init
    
    Add a version check to avoid depending on unstable GLib.

 gdk-pixbuf/gdk-pixbuf-csource.c |    4 +++-
 gdk-pixbuf/gdk-pixbuf-pixdata.c |    4 +++-
 gdk-pixbuf/make-inline-pixbuf.c |    7 ++++---
 gdk-pixbuf/test-gdk-pixbuf.c    |    4 +++-
 4 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/gdk-pixbuf/gdk-pixbuf-csource.c b/gdk-pixbuf/gdk-pixbuf-csource.c
index 78af373..642d5ee 100644
--- a/gdk-pixbuf/gdk-pixbuf-csource.c
+++ b/gdk-pixbuf/gdk-pixbuf-csource.c
@@ -76,8 +76,10 @@ main (int   argc,
   GError *error = NULL;
   gchar *infilename;
 
-  /* initialize glib/GdkPixbuf */
+#if !GLIB_CHECK_VERSION (2, 35, 3)
+  /* initialize gtype */
   g_type_init ();
+#endif
 
   /* parse args and do fast exits */
   parse_args (&argc, &argv);
diff --git a/gdk-pixbuf/gdk-pixbuf-pixdata.c b/gdk-pixbuf/gdk-pixbuf-pixdata.c
index df76272..4c5053c 100644
--- a/gdk-pixbuf/gdk-pixbuf-pixdata.c
+++ b/gdk-pixbuf/gdk-pixbuf-pixdata.c
@@ -55,8 +55,10 @@ main (int   argc,
   guint8 *data;
   guint data_len;
 
-  /* initialize glib/GdkPixbuf */
+#if !GLIB_CHECK_VERSION (2, 35, 3)
+  /* initialize GType */
   g_type_init ();
+#endif
 
   /* parse args and do fast exits */
   parse_args (&argc, &argv);
diff --git a/gdk-pixbuf/make-inline-pixbuf.c b/gdk-pixbuf/make-inline-pixbuf.c
index e2e1f61..d48c155 100644
--- a/gdk-pixbuf/make-inline-pixbuf.c
+++ b/gdk-pixbuf/make-inline-pixbuf.c
@@ -152,10 +152,11 @@ main (int argc, char **argv)
   FILE *outfile;
   gchar *outfilename;
   int i;
-  
+
+#if !GLIB_CHECK_VERSION (2, 35, 3)
   g_type_init ();
-  
-  
+#endif
+
   if (argc < 4)
     usage ();
 
diff --git a/gdk-pixbuf/test-gdk-pixbuf.c b/gdk-pixbuf/test-gdk-pixbuf.c
index b2d565a..27adffe 100644
--- a/gdk-pixbuf/test-gdk-pixbuf.c
+++ b/gdk-pixbuf/test-gdk-pixbuf.c
@@ -230,8 +230,10 @@ main (int argc, char **argv)
 
 	result = EXIT_SUCCESS;
 
+#if !GLIB_CHECK_VERSION (2, 35, 3)
 	g_type_init ();
-	
+#endif
+
 	/* Run some tests. */
 	if (!simple_composite_test ()) {
 		result = EXIT_FAILURE;



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