[libgsf] compilation: use return value of g_object_ref
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgsf] compilation: use return value of g_object_ref
- Date: Wed, 7 Dec 2011 22:08:12 +0000 (UTC)
commit 1b61ae33eef6881db3dde618d64e9c65316bc065
Author: Morten Welinder <terra gnome org>
Date: Wed Dec 7 17:07:56 2011 -0500
compilation: use return value of g_object_ref
gsf/gsf-clip-data.c | 2 +-
gsf/gsf-infile-msvba.c | 3 +--
gsf/gsf-input-memory.c | 3 +--
gsf/gsf-input-textline.c | 8 +++-----
gsf/gsf-output-transaction.c | 3 +--
gsf/gsf-structured-blob.c | 7 +++----
6 files changed, 10 insertions(+), 16 deletions(-)
---
diff --git a/gsf/gsf-clip-data.c b/gsf/gsf-clip-data.c
index 5f74358..33a833b 100644
--- a/gsf/gsf-clip-data.c
+++ b/gsf/gsf-clip-data.c
@@ -325,5 +325,5 @@ gsf_clip_data_peek_real_data (GsfClipData *clip_data, gsize *ret_size, GError **
offset = 0;
*ret_size = gsf_blob_get_size (priv->data_blob) - offset;
- return (char *) data + offset; /* cast to avoid warning about void pointer arithmetic */
+ return (char *) data + offset;
}
diff --git a/gsf/gsf-infile-msvba.c b/gsf/gsf-infile-msvba.c
index 465fd02..d00e8be 100644
--- a/gsf/gsf-infile-msvba.c
+++ b/gsf/gsf-infile-msvba.c
@@ -443,8 +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 (source);
- vba->source = source;
+ vba->source = g_object_ref (source);
/* vba_project_read (vba, err); */
diff --git a/gsf/gsf-input-memory.c b/gsf/gsf-input-memory.c
index ebc8bf4..e967faf 100644
--- a/gsf/gsf-input-memory.c
+++ b/gsf/gsf-input-memory.c
@@ -118,8 +118,7 @@ gsf_input_memory_dup (GsfInput *src_input, G_GNUC_UNUSED GError **err)
GsfInputMemory *dst = g_object_new (GSF_INPUT_MEMORY_TYPE, NULL);
if (G_UNLIKELY (NULL == dst)) return NULL;
- dst->shared = src->shared;
- g_object_ref (dst->shared);
+ dst->shared = g_object_ref (src->shared);
gsf_input_set_size (GSF_INPUT (dst), src->shared->size);
return GSF_INPUT (dst);
diff --git a/gsf/gsf-input-textline.c b/gsf/gsf-input-textline.c
index 9b177f2..8eddc70 100644
--- a/gsf/gsf-input-textline.c
+++ b/gsf/gsf-input-textline.c
@@ -64,9 +64,8 @@ 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 (source);
- input->source = source;
- input->buf = NULL;
+ input->source = g_object_ref (source);
+ input->buf = NULL;
input->buf_size = 0;
gsf_input_set_size (GSF_INPUT (input), gsf_input_size (source));
gsf_input_set_name (GSF_INPUT (input), gsf_input_name (source));
@@ -97,8 +96,7 @@ gsf_input_textline_dup (GsfInput *src_input, G_GNUC_UNUSED GError **err)
GsfInputTextline *dst = g_object_new (GSF_INPUT_TEXTLINE_TYPE, NULL);
if (G_UNLIKELY (NULL == dst)) return NULL;
- dst->source = src->source;
- g_object_ref (dst->source);
+ dst->source = g_object_ref (src->source);
gsf_input_set_size (GSF_INPUT (dst), gsf_input_size (src_input));
return GSF_INPUT (dst);
diff --git a/gsf/gsf-output-transaction.c b/gsf/gsf-output-transaction.c
index 2fc2f59..eaf044a 100644
--- a/gsf/gsf-output-transaction.c
+++ b/gsf/gsf-output-transaction.c
@@ -146,8 +146,7 @@ gsf_output_transaction_new_named (GsfOutput *wrapped, char const *name)
/* TODO: connect signals if wrapped is a GsfOutputTransaction for cascade-effect?? */
- trans->wrapped = wrapped;
- g_object_ref (trans->wrapped);
+ trans->wrapped = g_object_ref (wrapped);
return GSF_OUTPUT (trans);
}
diff --git a/gsf/gsf-structured-blob.c b/gsf/gsf-structured-blob.c
index e4845e8..71b086d 100644
--- a/gsf/gsf-structured-blob.c
+++ b/gsf/gsf-structured-blob.c
@@ -69,10 +69,9 @@ blob_dup (GsfInput *input, G_GNUC_UNUSED GError **err)
GsfStructuredBlob *dst = g_object_new (GSF_STRUCTURED_BLOB_TYPE, NULL);
if (G_UNLIKELY (NULL == dst)) return NULL;
- if (src->data != NULL) {
- dst->data = src->data;
- g_object_ref (dst->data);
- }
+ if (src->data != NULL)
+ dst->data = g_object_ref (src->data);
+
if (src->children != NULL) {
unsigned i;
gpointer child;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]