[libgsf] gsf: eliminate pointless G_OBJECT casts



commit 3ae58023dcb8f85498268103980cbbbdba4300ad
Author: Morten Welinder <terra gnome org>
Date:   Wed Dec 7 13:33:53 2011 -0500

    gsf: eliminate pointless G_OBJECT casts

 ChangeLog                    |    2 ++
 gsf/gsf-infile-ar.c          |    6 +++---
 gsf/gsf-infile-msole.c       |   14 +++++++-------
 gsf/gsf-infile-msvba.c       |   18 +++++++++---------
 gsf/gsf-infile-tar.c         |   37 +++++++++++++++++++------------------
 gsf/gsf-infile-zip.c         |   33 +++++++++++++++++----------------
 gsf/gsf-infile.c             |    4 ++--
 gsf/gsf-input-bzip.c         |    6 +++---
 gsf/gsf-input-gio.c          |    2 +-
 gsf/gsf-input-gzip.c         |   26 ++++++++++++--------------
 gsf/gsf-input-memory.c       |    4 ++--
 gsf/gsf-input-proxy.c        |    2 +-
 gsf/gsf-input-textline.c     |    6 +++---
 gsf/gsf-libxml.c             |    6 +++---
 gsf/gsf-open-pkg-utils.c     |    8 ++++----
 gsf/gsf-opendoc-utils.c      |    4 ++--
 gsf/gsf-outfile-msole.c      |   10 +++++-----
 gsf/gsf-output-bzip.c        |    6 +++---
 gsf/gsf-output-csv.c         |    2 +-
 gsf/gsf-output-gio.c         |   10 +++++-----
 gsf/gsf-output-gzip.c        |    2 +-
 gsf/gsf-output-iconv.c       |    2 +-
 gsf/gsf-output-transaction.c |    4 ++--
 gsf/gsf-structured-blob.c    |   10 +++++-----
 24 files changed, 113 insertions(+), 111 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4dbaba6..eac45a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2011-12-07  Morten Welinder  <terra gnome org>
 
+	* gsf/*.c: Eliminate pointless G_OBJECT casts.
+
 	* configure.in: Require glib 2.16 for g_strcmp0.
 
 	* gsf/gsf-input.c (gsf_input_dispose): Rename from
diff --git a/gsf/gsf-infile-ar.c b/gsf/gsf-infile-ar.c
index f603f36..5b84934 100644
--- a/gsf/gsf-infile-ar.c
+++ b/gsf/gsf-infile-ar.c
@@ -412,7 +412,7 @@ gsf_infile_ar_finalize (GObject *obj)
 	GsfInfileAr *ar = GSF_INFILE_AR (obj);
 
 	if (ar->input != NULL) {
-		g_object_unref (G_OBJECT (ar->input));
+		g_object_unref (ar->input);
 		ar->input = NULL;
 	}
 	g_free (ar->buf);
@@ -471,12 +471,12 @@ gsf_infile_ar_new (GsfInput *source, GError **err)
 	ar = g_object_new (GSF_INFILE_AR_TYPE, NULL);
 	if (G_UNLIKELY (NULL == ar)) return NULL;
 
-	g_object_ref (G_OBJECT (source));
+	g_object_ref (source);
 	ar->input = source;
 	gsf_input_set_size (GSF_INPUT (ar), 0);
 
 	if (ar_init_info (ar, err)) {
-		g_object_unref (G_OBJECT (ar));
+		g_object_unref (ar);
 		return NULL;
 	}
 	ar->vdir = ar->info->vdir;
diff --git a/gsf/gsf-infile-msole.c b/gsf/gsf-infile-msole.c
index 82cb59e..a6a5ece 100644
--- a/gsf/gsf-infile-msole.c
+++ b/gsf/gsf-infile-msole.c
@@ -415,7 +415,7 @@ ole_info_unref (MSOleInfo *info)
 		info->root_dir = NULL;
 	}
 	if (info->sb_file != NULL)  {
-		g_object_unref (G_OBJECT (info->sb_file));
+		g_object_unref (info->sb_file);
 		info->sb_file = NULL;
 	}
 	g_free (info);
@@ -626,7 +626,7 @@ gsf_infile_msole_finalize (GObject *obj)
 	GsfInfileMSOle *ole = GSF_INFILE_MSOLE (obj);
 
 	if (ole->input != NULL) {
-		g_object_unref (G_OBJECT (ole->input));
+		g_object_unref (ole->input);
 		ole->input = NULL;
 	}
 	if (ole->info != NULL &&
@@ -782,7 +782,7 @@ gsf_infile_msole_new_child (GsfInfileMSOle *parent,
 			if (err != NULL)
 				*err = g_error_new (gsf_input_error_id (), 0,
 						    "Failed to access child");
-			g_object_unref (G_OBJECT (child));
+			g_object_unref (child);
 			return NULL;
 		}
 	} else {
@@ -790,7 +790,7 @@ gsf_infile_msole_new_child (GsfInfileMSOle *parent,
 		size_guess = dirent->size >> info->bb.shift;
 	}
 	if (ole_make_bat (metabat, size_guess + 1, dirent->first_block, &child->bat)) {
-		g_object_unref (G_OBJECT (child));
+		g_object_unref (child);
 		return NULL;
 	}
 
@@ -813,14 +813,14 @@ gsf_infile_msole_new_child (GsfInfileMSOle *parent,
 
 				g_warning ("failure reading block %d for '%s'", i, dirent->name);
 				if (err) *err = g_error_new (gsf_input_error_id (), 0, "failure reading block");
-				g_object_unref (G_OBJECT (child));
+				g_object_unref (child);
 				return NULL;
 			}
 
 		if (remaining > 0) {
 			if (err) *err = g_error_new (gsf_input_error_id (), 0, "insufficient blocks");
 			g_warning ("Small-block file '%s' has insufficient blocks (%u) for the stated size (%lu)", dirent->name, child->bat.num_blocks, (long)dirent->size);
-			g_object_unref (G_OBJECT (child));
+			g_object_unref (child);
 			return NULL;
 		}
 	}
@@ -944,7 +944,7 @@ gsf_infile_msole_new (GsfInput *source, GError **err)
 		/* We do this so other kinds of archives can be tried.  */
 		(void)gsf_input_seek (source, calling_pos, G_SEEK_SET);
 
-		g_object_unref (G_OBJECT (ole));
+		g_object_unref (ole);
 		return NULL;
 	}
 
diff --git a/gsf/gsf-infile-msvba.c b/gsf/gsf-infile-msvba.c
index de73dc4..465fd02 100644
--- a/gsf/gsf-infile-msvba.c
+++ b/gsf/gsf-infile-msvba.c
@@ -264,7 +264,7 @@ fail_content :
 #endif
 
 fail_compression :
-	g_object_unref (G_OBJECT (dir));
+	g_object_unref (dir);
 fail_stream :
 
 	if (failed) {
@@ -406,7 +406,7 @@ gsf_infile_msvba_finalize (GObject *obj)
 		vba->modules = NULL;
 	}
 	if (vba->source != NULL) {
-		g_object_unref (G_OBJECT (vba->source));
+		g_object_unref (vba->source);
 		vba->source = NULL;
 	}
 	parent_class->finalize (obj);
@@ -443,7 +443,7 @@ gsf_infile_msvba_new (GsfInfile *source, GError **err)
 	vba = g_object_new (GSF_INFILE_MSVBA_TYPE, NULL);
 	if (G_UNLIKELY (NULL == vba)) return NULL;
 
-	g_object_ref (G_OBJECT (source));
+	g_object_ref (source);
 	vba->source = source;
 
 	/* vba_project_read (vba, err); */
@@ -456,7 +456,7 @@ gsf_infile_msvba_new (GsfInfile *source, GError **err)
 		*err = g_error_new (gsf_input_error_id (), 0,
 				"Unable to parse VBA header");
 
-	g_object_unref (G_OBJECT (vba));
+	g_object_unref (vba);
 	return NULL;
 }
 
@@ -517,7 +517,7 @@ gsf_input_find_vba (GsfInput *input, GError **err)
 
 		/* TODO : PPT is more complex */
 
-		g_object_unref (G_OBJECT (infile));
+		g_object_unref (infile);
 	} else if (NULL != (infile = gsf_infile_zip_new (input, NULL))) {
 		GsfInput *main_part = gsf_open_pkg_get_rel_by_type (GSF_INPUT (infile),
 			"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";);
@@ -529,13 +529,13 @@ gsf_input_find_vba (GsfInput *input, GError **err)
 				GsfInfile *ole = gsf_infile_msole_new (vba_stream, err);
 				if (NULL != ole) {
 					vba = gsf_infile_child_by_vname (ole, "VBA", NULL);
-					g_object_unref (G_OBJECT (ole));
+					g_object_unref (ole);
 				}
-				g_object_unref (G_OBJECT (vba_stream));
+				g_object_unref (vba_stream);
 			}
-			g_object_unref (G_OBJECT (main_part));
+			g_object_unref (main_part);
 		}
-		g_object_unref (G_OBJECT (infile));
+		g_object_unref (infile);
 	}
 
 	if (NULL != vba)
diff --git a/gsf/gsf-infile-tar.c b/gsf/gsf-infile-tar.c
index febc9ac..3e1d9d2 100644
--- a/gsf/gsf-infile-tar.c
+++ b/gsf/gsf-infile-tar.c
@@ -419,28 +419,28 @@ static void
 gsf_infile_tar_finalize (GObject *obj)
 {
 	GsfInfileTar *tar = GSF_INFILE_TAR (obj);
+	g_array_free (tar->children, TRUE);
+	parent_class->finalize (obj);
+}
 
-	if (tar->source != NULL) {
-		g_object_unref (G_OBJECT (tar->source));
-		tar->source = NULL;
-	}
-
-	if (tar->children) {
-		unsigned ui;
-		for (ui = 0; ui < tar->children->len; ui++) {
-			TarChild *c = &g_array_index (tar->children,
-						      TarChild,
-						      ui);
-			g_free (c->name);
-			if (c->dir)
-				g_object_unref (c->dir);
-		}
-		g_array_free (tar->children, TRUE);
-	}
+static void
+gsf_infile_tar_dispose (GObject *obj)
+{
+	GsfInfileTar *tar = GSF_INFILE_TAR (obj);
+	unsigned ui;
 
+	gsf_infile_tar_set_source (tar, NULL);
 	g_clear_error (&tar->err);
 
-	parent_class->finalize (obj);
+	for (ui = 0; ui < tar->children->len; ui++) {
+		TarChild *c = &g_array_index (tar->children, TarChild, ui);
+		g_free (c->name);
+		if (c->dir)
+			g_object_unref (c->dir);
+	}
+	g_array_set_size (tar->children, 0);
+
+	parent_class->dispose (obj);
 }
 
 static GObject*
@@ -523,6 +523,7 @@ gsf_infile_tar_class_init (GObjectClass *gobject_class)
 
 	gobject_class->constructor      = gsf_infile_tar_constructor;
 	gobject_class->finalize		= gsf_infile_tar_finalize;
+	gobject_class->dispose		= gsf_infile_tar_dispose;
 	gobject_class->get_property     = gsf_infile_tar_get_property;
 	gobject_class->set_property     = gsf_infile_tar_set_property;
 
diff --git a/gsf/gsf-infile-zip.c b/gsf/gsf-infile-zip.c
index cba7247..301e222 100644
--- a/gsf/gsf-infile-zip.c
+++ b/gsf/gsf-infile-zip.c
@@ -673,24 +673,35 @@ gsf_infile_zip_num_children (GsfInfile *infile)
 }
 
 static void
+gsf_infile_zip_set_source (GsfInfileZip *zip, GsfInput *src)
+{
+	if (src)
+		src = gsf_input_proxy_new (src);
+	if (zip->source)
+		g_object_unref (zip->source);
+	zip->source = src;
+}
+
+static void
 gsf_infile_zip_finalize (GObject *obj)
 {
 	GsfInfileZip *zip = GSF_INFILE_ZIP (obj);
 
-	if (zip->source != NULL) {
-		g_object_unref (G_OBJECT (zip->source));
-		zip->source = NULL;
-	}
 	if (zip->info != NULL) {
 		zip_info_unref (zip->info);
 		zip->info = NULL;
 	}
 
-	if (zip->stream)
+	if (zip->stream) {
 		(void) inflateEnd (zip->stream);
-	g_free (zip->stream);
+		g_free (zip->stream);
+		zip->stream = NULL;
+	}
+
 	g_free (zip->buf);
+	zip->buf = NULL;
 
+	gsf_infile_zip_set_source (zip, NULL);
 	g_clear_error (&zip->err);
 
 	parent_class->finalize (obj);
@@ -761,16 +772,6 @@ gsf_infile_zip_get_property (GObject     *object,
 }
 
 static void
-gsf_infile_zip_set_source (GsfInfileZip *zip, GsfInput *src)
-{
-	if (src)
-		src = gsf_input_proxy_new (src);
-	if (zip->source)
-		g_object_unref (zip->source);
-	zip->source = src;
-}
-
-static void
 gsf_infile_zip_set_property (GObject      *object,
 			     guint         property_id,
 			     GValue const *value,
diff --git a/gsf/gsf-infile.c b/gsf/gsf-infile.c
index 94a3014..52d26ed 100644
--- a/gsf/gsf-infile.c
+++ b/gsf/gsf-infile.c
@@ -160,7 +160,7 @@ gsf_infile_child_by_vaname (GsfInfile *infile, va_list names)
 		if (child == NULL)
 			break;
 		if (tmp != NULL)
-			g_object_unref (G_OBJECT (tmp));
+			g_object_unref (tmp);
 
 		g_return_val_if_fail (GSF_IS_INFILE (child), NULL);
 
@@ -191,7 +191,7 @@ gsf_infile_child_by_aname (GsfInfile *infile, char const *names[])
 	for (;*names ; names++) {
 		child = gsf_infile_child_by_name (infile, *names);
 		if (tmp != NULL)
-			g_object_unref (G_OBJECT (tmp));
+			g_object_unref (tmp);
 		if (child == NULL)
 			break;
 
diff --git a/gsf/gsf-input-bzip.c b/gsf/gsf-input-bzip.c
index 5349238..e20bd9d 100644
--- a/gsf/gsf-input-bzip.c
+++ b/gsf/gsf-input-bzip.c
@@ -84,7 +84,7 @@ gsf_input_memory_new_from_bzip (GsfInput *source, GError **err)
 						    "BZ2 decompress failed");
 			BZ2_bzDecompressEnd (&bzstm);
 			gsf_output_close (sink);
-			g_object_unref (G_OBJECT (sink));
+			g_object_unref (sink);
 			return NULL;
 		}
 		
@@ -99,7 +99,7 @@ gsf_input_memory_new_from_bzip (GsfInput *source, GError **err)
 		if (err)
 			*err = g_error_new (gsf_input_error_id (), 0,
 					    "BZ2 decompress end failed");
-		g_object_unref (G_OBJECT (sink));
+		g_object_unref (sink);
 		return NULL;
 	}
 
@@ -110,7 +110,7 @@ gsf_input_memory_new_from_bzip (GsfInput *source, GError **err)
 	if (mem != NULL)
 		gsf_input_set_name (mem, gsf_input_name (source));
 
-	g_object_unref (G_OBJECT (sink));
+	g_object_unref (sink);
 	return mem;
 #endif
 }
diff --git a/gsf/gsf-input-gio.c b/gsf/gsf-input-gio.c
index 9307b64..482c166 100644
--- a/gsf/gsf-input-gio.c
+++ b/gsf/gsf-input-gio.c
@@ -156,7 +156,7 @@ gsf_input_gio_new (GFile *file, GError **err)
 
 	gsf_input_set_size (GSF_INPUT (input), filesize);
 
-	g_object_ref (G_OBJECT (file));
+	g_object_ref (file);
 
 	input->stream = stream;
 	input->file = file;
diff --git a/gsf/gsf-input-gzip.c b/gsf/gsf-input-gzip.c
index 1a2c937..69f32a5 100644
--- a/gsf/gsf-input-gzip.c
+++ b/gsf/gsf-input-gzip.c
@@ -185,6 +185,17 @@ init_zip (GsfInputGZip *gzip, GError **err)
 	return FALSE;
 }
 
+static void
+gsf_input_gzip_set_source (GsfInputGZip *gzip, GsfInput *source)
+{
+	if (source)
+		g_object_ref (GSF_INPUT (source));
+	if (gzip->source)
+		g_object_unref (gzip->source);
+	gzip->source = source;
+}
+
+
 /**
  * gsf_input_gzip_new :
  * @source : The underlying data source.
@@ -222,10 +233,7 @@ gsf_input_gzip_finalize (GObject *obj)
 {
 	GsfInputGZip *gzip = (GsfInputGZip *)obj;
 
-	if (gzip->source != NULL) {
-		g_object_unref (G_OBJECT (gzip->source));
-		gzip->source = NULL;
-	}
+	gsf_input_gzip_set_source (gzip, NULL);
 
 	g_free (gzip->buf);
 
@@ -424,16 +432,6 @@ gsf_input_gzip_get_property (GObject     *object,
 }
 
 static void
-gsf_input_gzip_set_source (GsfInputGZip *gzip, GsfInput *source)
-{
-	if (source)
-		g_object_ref (GSF_INPUT (source));
-	if (gzip->source)
-		g_object_unref (gzip->source);
-	gzip->source = source;
-}
-
-static void
 gsf_input_gzip_set_property (GObject      *object,
 			     guint         property_id,
 			     GValue const *value,
diff --git a/gsf/gsf-input-memory.c b/gsf/gsf-input-memory.c
index 98a51a0..f3d3609 100644
--- a/gsf/gsf-input-memory.c
+++ b/gsf/gsf-input-memory.c
@@ -118,7 +118,7 @@ gsf_input_memory_finalize (GObject *obj)
 	GsfInputMemory *mem = (GsfInputMemory *) (obj);
 
 	if (mem->shared)
-		g_object_unref (G_OBJECT (mem->shared));
+		g_object_unref (mem->shared);
 
 #ifdef HAVE_BROKEN_MMAP
 	if (mem->fd != -1)
@@ -136,7 +136,7 @@ gsf_input_memory_dup (GsfInput *src_input, G_GNUC_UNUSED GError **err)
 	if (G_UNLIKELY (NULL == dst)) return NULL;
 
 	dst->shared = src->shared;
-	g_object_ref (G_OBJECT (dst->shared));
+	g_object_ref (dst->shared);
 	gsf_input_set_size (GSF_INPUT (dst), src->shared->size);
 
 #ifdef HAVE_BROKEN_MMAP
diff --git a/gsf/gsf-input-proxy.c b/gsf/gsf-input-proxy.c
index edebb37..4570124 100644
--- a/gsf/gsf-input-proxy.c
+++ b/gsf/gsf-input-proxy.c
@@ -110,7 +110,7 @@ gsf_input_proxy_finalize (GObject *obj)
 	GsfInputProxy *proxy = (GsfInputProxy *)obj;
 
 	if (proxy->source != NULL) {
-		g_object_unref (G_OBJECT (proxy->source));
+		g_object_unref (proxy->source);
 		proxy->source = NULL;
 	}
 
diff --git a/gsf/gsf-input-textline.c b/gsf/gsf-input-textline.c
index 5a8b0a4..9b177f2 100644
--- a/gsf/gsf-input-textline.c
+++ b/gsf/gsf-input-textline.c
@@ -64,7 +64,7 @@ gsf_input_textline_new (GsfInput *source)
 	input = g_object_new (GSF_INPUT_TEXTLINE_TYPE, NULL);
 	if (G_UNLIKELY (NULL == input)) return NULL;
 
-	g_object_ref (G_OBJECT (source));
+	g_object_ref (source);
 	input->source = source;
 	input->buf  = NULL;
 	input->buf_size = 0;
@@ -80,7 +80,7 @@ gsf_input_textline_finalize (GObject *obj)
 	GsfInputTextline *input = (GsfInputTextline *)obj;
 
 	if (input->source != NULL) {
-		g_object_unref (G_OBJECT (input->source));
+		g_object_unref (input->source);
 		input->source = NULL;
 	}
 	g_free (input->buf);
@@ -98,7 +98,7 @@ gsf_input_textline_dup (GsfInput *src_input, G_GNUC_UNUSED GError **err)
 	if (G_UNLIKELY (NULL == dst)) return NULL;
 
 	dst->source = src->source;
-	g_object_ref (G_OBJECT (dst->source));
+	g_object_ref (dst->source);
 	gsf_input_set_size (GSF_INPUT (dst), gsf_input_size (src_input));
 
 	return GSF_INPUT (dst);
diff --git a/gsf/gsf-libxml.c b/gsf/gsf-libxml.c
index 4bfa0ff..ca3998d 100644
--- a/gsf/gsf-libxml.c
+++ b/gsf/gsf-libxml.c
@@ -299,7 +299,7 @@ gsf_libxml_write (void *context, char const *buffer, int len)
 static int
 gsf_libxml_close (void *context)
 {
-	g_object_unref (G_OBJECT (context));
+	g_object_unref (context);
 	return TRUE;
 }
 
@@ -315,7 +315,7 @@ gsf_xml_parser_context_full (GsfInput *input, xmlSAXHandlerPtr sax, gpointer use
 	if (gzip != NULL)
 		input = gzip;
 	else
-		g_object_ref (G_OBJECT (input));
+		g_object_ref (input);
 
 	res = xmlCreateIOParserCtxt (
 		sax, user,
@@ -364,7 +364,7 @@ gsf_xml_output_buffer_new (GsfOutput *output,
 {
 	xmlOutputBufferPtr res = xmlAllocOutputBuffer (handler);
 	if (res != NULL) {
-		g_object_ref (G_OBJECT (output));
+		g_object_ref (output);
 		res->context = (void *)output;
 		res->writecallback = gsf_libxml_write;
 		res->closecallback = gsf_libxml_close;
diff --git a/gsf/gsf-open-pkg-utils.c b/gsf/gsf-open-pkg-utils.c
index 3db2426..5ecfb0b 100644
--- a/gsf/gsf-open-pkg-utils.c
+++ b/gsf/gsf-open-pkg-utils.c
@@ -184,7 +184,7 @@ gsf_open_pkg_get_rels (GsfInput *opkg)
 			(void) gsf_xml_in_doc_parse (rel_doc, rel_stream, rels);
 
 			gsf_xml_in_doc_free (rel_doc);
-			g_object_unref (G_OBJECT (rel_stream));
+			g_object_unref (rel_stream);
 		}
 
 		g_object_set_data_full (G_OBJECT (opkg), "OpenPkgRels", rels,
@@ -232,7 +232,7 @@ gsf_open_pkg_open_rel (GsfInput *opkg, GsfOpenPkgRel const *rel,
 			if (NULL != parent) {
 				/* check for attempt to gain access outside the zip file */
 				if (G_OBJECT_TYPE (parent) == G_OBJECT_TYPE (prev_parent))
-					g_object_ref (G_OBJECT (parent));
+					g_object_ref (parent);
 				else
 					parent = NULL;
 			}
@@ -243,7 +243,7 @@ gsf_open_pkg_open_rel (GsfInput *opkg, GsfOpenPkgRel const *rel,
 				parent = GSF_INFILE (res);
 			}
 		}
-		g_object_unref (G_OBJECT (prev_parent));
+		g_object_unref (prev_parent);
 	}
 	g_strfreev (elems);
 
@@ -421,7 +421,7 @@ gsf_open_pkg_parse_rel_by_id (GsfXMLIn *xin, char const *id,
 				gsf_input_name (cur_stream) );
 		gsf_xml_in_doc_free (doc);
 
-		g_object_unref (G_OBJECT (part_stream));
+		g_object_unref (part_stream);
 	}
 	return res;
 }
diff --git a/gsf/gsf-opendoc-utils.c b/gsf/gsf-opendoc-utils.c
index 39c9e3c..b6ce3fe 100644
--- a/gsf/gsf-opendoc-utils.c
+++ b/gsf/gsf-opendoc-utils.c
@@ -317,7 +317,7 @@ gsf_opendoc_metadata_subtree_free (G_GNUC_UNUSED GsfXMLIn *xin, gpointer old_sta
 		g_object_unref (state->keywords);
 	}
 
-	g_object_unref (G_OBJECT (state->md));
+	g_object_unref (state->md);
 	g_free (state);
 }
 
@@ -343,7 +343,7 @@ gsf_opendoc_metadata_subtree (GsfXMLIn *xin, GsfDocMetaData *md)
 	state = g_new0 (GsfOOMetaIn, 1);
 	state->md = md;
 	state->typ = G_TYPE_NONE;
-	g_object_ref (G_OBJECT (md));
+	g_object_ref (md);
 	gsf_xml_in_push_state (xin, doc_subtree, state, gsf_opendoc_metadata_subtree_free, NULL);
 }
 
diff --git a/gsf/gsf-outfile-msole.c b/gsf/gsf-outfile-msole.c
index 2a29341..3a50379 100644
--- a/gsf/gsf-outfile-msole.c
+++ b/gsf/gsf-outfile-msole.c
@@ -84,7 +84,7 @@ gsf_outfile_msole_finalize (GObject *obj)
 		gsf_output_close (output);
 
 	if (ole->sink != NULL) {
-		g_object_unref (G_OBJECT (ole->sink));
+		g_object_unref (ole->sink);
 		ole->sink = NULL;
 	}
 	switch (ole->type) {
@@ -456,7 +456,7 @@ recalc_bat_bat :
 
 	/* free the children */
 	for (i = 0 ; i < elem->len ; i++)
-		g_object_unref (G_OBJECT (g_ptr_array_index (elem, i)));
+		g_object_unref (g_ptr_array_index (elem, i));
 	g_ptr_array_free (elem, TRUE);
 	ole->content.dir.root_order = NULL;
 
@@ -557,7 +557,7 @@ static void
 ole_register_child (GsfOutfileMSOle *root, GsfOutfileMSOle *child)
 {
 	child->root = root;
-	g_object_ref (G_OBJECT (child));
+	g_object_ref (child);
 	child->child_index = root->content.dir.root_order->len;
 	g_ptr_array_add (root->content.dir.root_order, child);
 }
@@ -615,7 +615,7 @@ gsf_outfile_msole_new_child (GsfOutfile *parent,
 		child->type = MSOLE_SMALL_BLOCK;
 		child->content.small_block.buf = g_new0 (guint8, OLE_DEFAULT_THRESHOLD);
 	}
-	g_object_ref (G_OBJECT (ole_parent->sink));
+	g_object_ref (ole_parent->sink);
 	child->sink   = ole_parent->sink;
 	child->root   = ole_parent->root;
 	gsf_outfile_msole_set_block_shift (child,
@@ -712,7 +712,7 @@ gsf_outfile_msole_new_full (GsfOutput *sink, guint bb_size, guint sb_size)
 	ole = g_object_new (GSF_OUTFILE_MSOLE_TYPE, NULL);
 	if (G_UNLIKELY (NULL == ole)) return NULL;
 
-	g_object_ref (G_OBJECT (sink));
+	g_object_ref (sink);
 	ole->sink = sink;
 	ole->type = MSOLE_DIR;
 	ole->content.dir.root_order = g_ptr_array_new ();
diff --git a/gsf/gsf-output-bzip.c b/gsf/gsf-output-bzip.c
index 3d2ff62..87300f8 100644
--- a/gsf/gsf-output-bzip.c
+++ b/gsf/gsf-output-bzip.c
@@ -58,7 +58,7 @@ gsf_output_bzip_finalize (GObject *obj)
 	GsfOutputBzip *bzip = (GsfOutputBzip *)obj;
 
 	if (bzip->sink != NULL) {
-		g_object_unref (G_OBJECT (bzip->sink));
+		g_object_unref (bzip->sink);
 		bzip->sink = NULL;
 	}
 	g_free (bzip->buf);
@@ -254,11 +254,11 @@ gsf_output_bzip_new (GsfOutput *sink, GError **err)
 	bzip = g_object_new (GSF_OUTPUT_BZIP_TYPE, NULL);
 	if (G_UNLIKELY (NULL == bzip)) return NULL;
 
-	g_object_ref (G_OBJECT (sink));
+	g_object_ref (sink);
 	bzip->sink = sink;
 
 	if (!init_bzip (bzip, err)) {
-		g_object_unref (G_OBJECT (bzip));
+		g_object_unref (bzip);
 		return NULL;
 	}
 
diff --git a/gsf/gsf-output-csv.c b/gsf/gsf-output-csv.c
index 9b65cf2..83d896e 100644
--- a/gsf/gsf-output-csv.c
+++ b/gsf/gsf-output-csv.c
@@ -52,7 +52,7 @@ gsf_output_csv_finalize (GObject *obj)
 	GsfOutputCsv *csv = (GsfOutputCsv *)obj;
 
 	if (csv->sink != NULL)
-		g_object_unref (G_OBJECT (csv->sink));
+		g_object_unref (csv->sink);
 	g_free (csv->quote);
 	g_free (csv->quoting_triggers);
 	g_free (csv->eol);
diff --git a/gsf/gsf-output-gio.c b/gsf/gsf-output-gio.c
index 6e1f3b7..8256067 100644
--- a/gsf/gsf-output-gio.c
+++ b/gsf/gsf-output-gio.c
@@ -76,7 +76,7 @@ gsf_output_gio_new (GFile *file)
 	output = g_object_new (GSF_OUTPUT_GIO_TYPE, NULL);
 	if (G_UNLIKELY (NULL == output)) {
 		g_output_stream_close (stream, NULL, NULL);
-		g_object_unref (G_OBJECT (stream));
+		g_object_unref (stream);
 		return NULL;
 	}
 
@@ -110,7 +110,7 @@ gsf_output_gio_new_for_path (char const *path, GError **err)
 	file = g_file_new_for_path (path);
 
 	output = gsf_output_gio_new (file);
-	g_object_unref (G_OBJECT (file));
+	g_object_unref (file);
 	
 	return output;
 }
@@ -138,7 +138,7 @@ gsf_output_gio_new_for_uri (char const *uri, GError **err)
 	file = g_file_new_for_uri (uri);
 
 	output = gsf_output_gio_new (file);
-	g_object_unref (G_OBJECT (file));
+	g_object_unref (file);
 	
 	return output;
 }
@@ -150,10 +150,10 @@ gsf_output_gio_close (GsfOutput *output)
 
 	if (gio->stream != NULL) {
 		g_output_stream_close (gio->stream, NULL, NULL);
-		g_object_unref (G_OBJECT (gio->stream));
+		g_object_unref (gio->stream);
 		gio->stream = NULL;
 		
-		g_object_unref (G_OBJECT (gio->file));
+		g_object_unref (gio->file);
 		gio->file = NULL;
 
 		return TRUE;
diff --git a/gsf/gsf-output-gzip.c b/gsf/gsf-output-gzip.c
index 299db31..5e71750 100644
--- a/gsf/gsf-output-gzip.c
+++ b/gsf/gsf-output-gzip.c
@@ -143,7 +143,7 @@ gsf_output_gzip_finalize (GObject *obj)
 	GsfOutputGZip *gzip = (GsfOutputGZip *)obj;
 
 	if (gzip->sink != NULL) {
-		g_object_unref (G_OBJECT (gzip->sink));
+		g_object_unref (gzip->sink);
 		gzip->sink = NULL;
 	}
 
diff --git a/gsf/gsf-output-iconv.c b/gsf/gsf-output-iconv.c
index 9b75085..a3fc0d3 100644
--- a/gsf/gsf-output-iconv.c
+++ b/gsf/gsf-output-iconv.c
@@ -89,7 +89,7 @@ gsf_output_iconv_finalize (GObject *obj)
 	GsfOutputIconv *ic = (GsfOutputIconv *)obj;
 
 	if (ic->sink != NULL)
-		g_object_unref (G_OBJECT (ic->sink));
+		g_object_unref (ic->sink);
 	g_free (ic->input_charset);
 	g_free (ic->output_charset);
 	g_free (ic->buf);
diff --git a/gsf/gsf-output-transaction.c b/gsf/gsf-output-transaction.c
index 5d54339..c8f1f05 100644
--- a/gsf/gsf-output-transaction.c
+++ b/gsf/gsf-output-transaction.c
@@ -277,8 +277,8 @@ gsf_output_transaction_finalize (GObject *object)
 
 	g_return_if_fail (GSF_IS_OUTPUT_TRANSACTION (object));
 
-	g_object_unref (G_OBJECT (me->proxy));
-	g_object_unref (G_OBJECT (me->wrapped));
+	g_object_unref (me->proxy);
+	g_object_unref (me->wrapped);
 
 	parent_class->finalize (object);
 }
diff --git a/gsf/gsf-structured-blob.c b/gsf/gsf-structured-blob.c
index 4277e7b..ad5c8d6 100644
--- a/gsf/gsf-structured-blob.c
+++ b/gsf/gsf-structured-blob.c
@@ -48,7 +48,7 @@ blob_finalize (GObject *obj)
 	GsfStructuredBlob *blob = GSF_STRUCTURED_BLOB (obj);
 
 	if (blob->data != NULL) {
-		g_object_unref (G_OBJECT (blob->data));
+		g_object_unref (blob->data);
 		blob->data = NULL;
 	}
 
@@ -71,7 +71,7 @@ blob_dup (GsfInput *input, G_GNUC_UNUSED GError **err)
 
 	if (src->data != NULL) {
 		dst->data = src->data;
-		g_object_ref (G_OBJECT (dst->data));
+		g_object_ref (dst->data);
 	}
 	if (src->children != NULL) {
 		unsigned i;
@@ -221,7 +221,7 @@ gsf_structured_blob_read (GsfInput *input)
 			g_warning ("Failed attempting to allocate %" GSF_OFF_T_FORMAT " bytes",
 				   content_size);
 
-			g_object_unref (G_OBJECT (blob));
+			g_object_unref (blob);
 			return NULL;
 		}
 
@@ -242,7 +242,7 @@ gsf_structured_blob_read (GsfInput *input)
 		while (i-- > 0) {
 			child = gsf_infile_child_by_index (GSF_INFILE (input), i);
 			child_blob = gsf_structured_blob_read (child);
-			g_object_unref (G_OBJECT (child));
+			g_object_unref (child);
 
 			g_ptr_array_index (blob->children, i) = child_blob;
 #if 0
@@ -297,7 +297,7 @@ gsf_structured_blob_write (GsfStructuredBlob *blob, GsfOutfile *container)
 	if (blob->data != NULL)
 		gsf_output_write (output, blob->data->size, blob->data->buf);
 	gsf_output_close (output);
-	g_object_unref (G_OBJECT (output));
+	g_object_unref (output);
 
 	return TRUE;
 }



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