[gconf] Return the refernced objects in _ref



commit a612aad7fcf817d6174505e8ac519e6a554d15d3
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Tue Sep 21 21:57:16 2010 +0200

    Return the refernced objects in _ref
    
    Both gconf_entry_ref() and gconf_change_set_ref() don't return
    the referenced objects but nothing (void), which causes issues for
    g_boxed_copy which uses the return value.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=629984

 doc/gconf/tmpl/gconf-changeset.sgml |    1 +
 doc/gconf/tmpl/gconf-value.sgml     |    1 +
 gconf/gconf-changeset.c             |    4 +++-
 gconf/gconf-changeset.h             |    2 +-
 gconf/gconf-value.c                 |    4 +++-
 gconf/gconf-value.h                 |    2 +-
 6 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/doc/gconf/tmpl/gconf-changeset.sgml b/doc/gconf/tmpl/gconf-changeset.sgml
index af33f9a..ff8b433 100644
--- a/doc/gconf/tmpl/gconf-changeset.sgml
+++ b/doc/gconf/tmpl/gconf-changeset.sgml
@@ -136,6 +136,7 @@ Increases the reference count of a #GConfChangeSet by one.
 </para>
 
 @cs: a #GConfChangeSet.
+ Returns: the referenced #GConfChangeSet.
 
 
 <!-- ##### FUNCTION gconf_change_set_unref ##### -->
diff --git a/doc/gconf/tmpl/gconf-value.sgml b/doc/gconf/tmpl/gconf-value.sgml
index 91d6798..4a60684 100644
--- a/doc/gconf/tmpl/gconf-value.sgml
+++ b/doc/gconf/tmpl/gconf-value.sgml
@@ -599,6 +599,7 @@ Increases the refcount of a #GConfEntry by one.
 </para>
 
 @entry: a #GConfEntry.
+ Returns: the referenced #GConfEntry.
 
 
 <!-- ##### FUNCTION gconf_entry_unref ##### -->
diff --git a/gconf/gconf-changeset.c b/gconf/gconf-changeset.c
index 4890fce..e27f1df 100644
--- a/gconf/gconf-changeset.c
+++ b/gconf/gconf-changeset.c
@@ -77,12 +77,14 @@ gconf_change_set_new      (void)
   return cs;
 }
 
-void
+GConfChangeSet*
 gconf_change_set_ref      (GConfChangeSet* cs)
 {
   g_return_if_fail(cs != NULL);
   
   cs->refcount += 1;
+
+  return cs;
 }
 
 void
diff --git a/gconf/gconf-changeset.h b/gconf/gconf-changeset.h
index 33f2a8a..b6f1dba 100644
--- a/gconf/gconf-changeset.h
+++ b/gconf/gconf-changeset.h
@@ -70,7 +70,7 @@ GConfChangeSet* gconf_engine_change_set_from_current (GConfEngine* conf,
 
 GType           gconf_change_set_get_type (void);
 GConfChangeSet* gconf_change_set_new      (void);
-void            gconf_change_set_ref      (GConfChangeSet* cs);
+GConfChangeSet* gconf_change_set_ref      (GConfChangeSet* cs);
 
 void            gconf_change_set_unref    (GConfChangeSet* cs);
 
diff --git a/gconf/gconf-value.c b/gconf/gconf-value.c
index da9d743..de42f75 100644
--- a/gconf/gconf-value.c
+++ b/gconf/gconf-value.c
@@ -1501,12 +1501,14 @@ gconf_entry_new_nocopy (char* key, GConfValue* val)
   return (GConfEntry*) real;
 }
 
-void
+GConfEntry *
 gconf_entry_ref (GConfEntry *entry)
 {
   g_return_if_fail (entry != NULL);
   
   REAL_ENTRY (entry)->refcount += 1;
+
+  return entry;
 }
 
 void
diff --git a/gconf/gconf-value.h b/gconf/gconf-value.h
index d8d3c82..5b37b84 100644
--- a/gconf/gconf-value.h
+++ b/gconf/gconf-value.h
@@ -186,7 +186,7 @@ GConfEntry* gconf_entry_copy             (const GConfEntry *src);
 #ifndef GCONF_DISABLE_DEPRECATED
 void        gconf_entry_free             (GConfEntry  *entry);
 #endif
-void        gconf_entry_ref   (GConfEntry *entry);
+GConfEntry* gconf_entry_ref   (GConfEntry *entry);
 void        gconf_entry_unref (GConfEntry *entry);
 
 /* Transfer ownership of value to the caller. */



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