[Telepathy-commits] [telepathy-salut/master] change salut_presence_cache_copy_cache_entry to return a GHashTable*

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Thu Feb 26 11:20:22 PST 2009


---
 src/salut-contact.c        |    2 +-
 src/salut-presence-cache.c |   18 +++++++++++-------
 src/salut-presence-cache.h |    2 +-
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/salut-contact.c b/src/salut-contact.c
index 5cb386a..0a520c5 100644
--- a/src/salut-contact.c
+++ b/src/salut-contact.c
@@ -452,7 +452,7 @@ salut_contact_set_capabilities (SalutContact *contact,
                                 GHashTable *per_channel_manager_caps)
 {
   salut_presence_cache_free_cache_entry (contact->per_channel_manager_caps);
-  salut_presence_cache_copy_cache_entry (&contact->per_channel_manager_caps,
+  contact->per_channel_manager_caps = salut_presence_cache_copy_cache_entry (
       per_channel_manager_caps);
 }
 
diff --git a/src/salut-presence-cache.c b/src/salut-presence-cache.c
index 046a50a..f55b0a1 100644
--- a/src/salut-presence-cache.c
+++ b/src/salut-presence-cache.c
@@ -508,7 +508,8 @@ _caps_disco_cb (SalutDisco *disco,
           if (!bad_hash)
             {
               GHashTable *save_enhanced_caps;
-              salut_presence_cache_copy_cache_entry (&save_enhanced_caps,
+
+              save_enhanced_caps = salut_presence_cache_copy_cache_entry (
                   waiter->contact->per_channel_manager_caps);
 
               DEBUG ("setting caps for %s (thanks to %s)",
@@ -602,7 +603,7 @@ salut_presence_cache_process_caps (SalutPresenceCache *self,
 
       DEBUG ("setting caps for %s", contact->name);
 
-      salut_presence_cache_copy_cache_entry (&save_enhanced_caps,
+      save_enhanced_caps = salut_presence_cache_copy_cache_entry (
           contact->per_channel_manager_caps);
 
       DEBUG ("setting caps for %s (thanks to %s)",
@@ -694,14 +695,17 @@ copy_caps_helper (gpointer key, gpointer value, gpointer user_data)
   g_hash_table_insert (table_out, key, out);
 }
 
-void
-salut_presence_cache_copy_cache_entry (
-    GHashTable **out, GHashTable *in)
+GHashTable *
+salut_presence_cache_copy_cache_entry (GHashTable *in)
 {
-  *out = g_hash_table_new (NULL, NULL);
+  GHashTable *out;
+
+  out = g_hash_table_new (NULL, NULL);
   if (in != NULL)
     g_hash_table_foreach (in, copy_caps_helper,
-        *out);
+        out);
+
+  return out;
 }
 
 static void
diff --git a/src/salut-presence-cache.h b/src/salut-presence-cache.h
index 5d0881f..d99729b 100644
--- a/src/salut-presence-cache.h
+++ b/src/salut-presence-cache.h
@@ -82,7 +82,7 @@ void salut_presence_cache_free_cache_entry (
 
 /* loop on CapabilityInfo::per_channel_manager_caps and call
  * salut_caps_channel_manager_copy_capabilities */
-void salut_presence_cache_copy_cache_entry (GHashTable **out,
+G_GNUC_WARN_UNUSED_RESULT GHashTable * salut_presence_cache_copy_cache_entry (
     GHashTable *in);
 
 /* loop on CapabilityInfo::per_channel_manager_caps and call
-- 
1.5.6.5




More information about the telepathy-commits mailing list