/soc/2013/ankitkv/gobjectification: e0bd77bd4508: Moved the blis...

Ankit Vani a at nevitus.org
Wed Jul 3 12:43:45 EDT 2013


Changeset: e0bd77bd4508f163fa98d9fe3fa5b93a875529d2
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-07-03 22:13 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/e0bd77bd4508

Description:

Moved the blist node prev, next, child and parent pointers to the instance struct

diffstat:

 libpurple/blist.c                |   4 ----
 libpurple/blist.h                |   5 +++++
 libpurple/protocols/gg/purplew.c |  12 +++---------
 3 files changed, 8 insertions(+), 13 deletions(-)

diffs (61 lines):

diff --git a/libpurple/blist.c b/libpurple/blist.c
--- a/libpurple/blist.c
+++ b/libpurple/blist.c
@@ -39,10 +39,6 @@
 
 /** Private data of a buddy list node */
 struct _PurpleBlistNodePrivate {
-	PurpleBlistNode *prev;    /**< The sibling before this buddy.          */
-	PurpleBlistNode *next;    /**< The sibling after this buddy.           */
-	PurpleBlistNode *parent;  /**< The parent of this node                 */
-	PurpleBlistNode *child;   /**< The child of this node                  */
 	GHashTable *settings;     /**< per-node settings                       */
 	gboolean dont_save;       /**< node should not be saved with the buddy
 	                               list                                    */
diff --git a/libpurple/blist.h b/libpurple/blist.h
--- a/libpurple/blist.h
+++ b/libpurple/blist.h
@@ -138,6 +138,11 @@ struct _PurpleBlistNode {
 	 *  field provided to the UIs -- it is not used by the libpurple core.
 	 */
 	gpointer ui_data;
+
+	PurpleBlistNode *prev;    /**< The sibling before this buddy. */
+	PurpleBlistNode *next;    /**< The sibling after this buddy.  */
+	PurpleBlistNode *parent;  /**< The parent of this node        */
+	PurpleBlistNode *child;   /**< The child of this node         */
 };
 
 /** The base class for all #PurpleBlistNode's. */
diff --git a/libpurple/protocols/gg/purplew.c b/libpurple/protocols/gg/purplew.c
--- a/libpurple/protocols/gg/purplew.c
+++ b/libpurple/protocols/gg/purplew.c
@@ -101,15 +101,11 @@ GList * ggp_purplew_group_get_buddies(Pu
 	g_return_val_if_fail(group != NULL, NULL);
 	
 	gnode = PURPLE_BLIST_NODE(group);
-	for (cnode = purple_blist_node_get_first_child(gnode);
-		cnode != NULL;
-		cnode = purple_blist_node_get_sibling_next(cnode))
+	for (cnode = gnode->child; cnode; cnode = cnode->next)
 	{
 		if (!PURPLE_IS_CONTACT(cnode))
 			continue;
-		for (bnode = purple_blist_node_get_first_child(cnode);
-			bnode != NULL;
-			bnode = purple_blist_node_get_sibling_next(bnode))
+		for (bnode = cnode->child; bnode; bnode = bnode->next)
 		{
 			PurpleBuddy *buddy;
 			if (!PURPLE_IS_BUDDY(bnode))
@@ -128,9 +124,7 @@ GList * ggp_purplew_account_get_groups(P
 {
 	PurpleBlistNode *bnode;
 	GList *groups = NULL;
-	for (bnode = purple_blist_get_root();
-		bnode != NULL;
-		bnode = purple_blist_node_get_sibling_next(bnode))
+	for (bnode = purple_blist_get_root(); bnode; bnode = bnode->next)
 	{
 		PurpleGroup *group;
 		GSList *accounts;



More information about the Commits mailing list