/pidgin/main: 55fcd8716546: Change purple_buddy_icon_unref to no...

Mark Doliner mark at kingant.net
Tue Jan 22 03:14:50 EST 2013


Changeset: 55fcd87165461d7af42cb419057be95f96a6df5a
Author:	 Mark Doliner <mark at kingant.net>
Date:	 2013-01-22 00:14 -0800
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/55fcd8716546

Description:

Change purple_buddy_icon_unref to not return anything.

It's weird for unref functions to return a value and we weren't using it
anywhere.

diffstat:

 ChangeLog.API                              |   1 +
 libpurple/buddyicon.c                      |  10 +++-------
 libpurple/buddyicon.h                      |   4 +---
 libpurple/plugins/perl/common/BuddyIcon.xs |   2 +-
 4 files changed, 6 insertions(+), 11 deletions(-)

diffs (70 lines):

diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -82,6 +82,7 @@ version 3.0.0 (??/??/????):
 		  parameter
 		* purple_account_add_buddies now takes an invite message as the last
 		  parameter
+		* purple_buddy_icon_unref no longer has a return value
 		* purple_certificate_check_signature_chain now returns a list of failing
 		  PurpleCertificate*s as the second parameter
 		* purple_connection_error now takes a PurpleConnectionError
diff --git a/libpurple/buddyicon.c b/libpurple/buddyicon.c
--- a/libpurple/buddyicon.c
+++ b/libpurple/buddyicon.c
@@ -342,13 +342,13 @@ purple_buddy_icon_ref(PurpleBuddyIcon *i
 	return icon;
 }
 
-PurpleBuddyIcon *
+void
 purple_buddy_icon_unref(PurpleBuddyIcon *icon)
 {
 	if (icon == NULL)
-		return NULL;
+		return;
 
-	g_return_val_if_fail(icon->ref_count > 0, NULL);
+	g_return_if_fail(icon->ref_count > 0);
 
 	icon->ref_count--;
 
@@ -365,11 +365,7 @@ purple_buddy_icon_unref(PurpleBuddyIcon 
 
 		PURPLE_DBUS_UNREGISTER_POINTER(icon);
 		g_slice_free(PurpleBuddyIcon, icon);
-
-		return NULL;
 	}
-
-	return icon;
 }
 
 void
diff --git a/libpurple/buddyicon.h b/libpurple/buddyicon.h
--- a/libpurple/buddyicon.h
+++ b/libpurple/buddyicon.h
@@ -79,10 +79,8 @@ PurpleBuddyIcon *purple_buddy_icon_ref(P
  * If the reference count reaches 0, the icon will be destroyed.
  *
  * @param icon The buddy icon.
- *
- * @return @a icon, or @c NULL if the reference count reached 0.
  */
-PurpleBuddyIcon *purple_buddy_icon_unref(PurpleBuddyIcon *icon);
+void purple_buddy_icon_unref(PurpleBuddyIcon *icon);
 
 /**
  * Updates every instance of this icon.
diff --git a/libpurple/plugins/perl/common/BuddyIcon.xs b/libpurple/plugins/perl/common/BuddyIcon.xs
--- a/libpurple/plugins/perl/common/BuddyIcon.xs
+++ b/libpurple/plugins/perl/common/BuddyIcon.xs
@@ -7,7 +7,7 @@ Purple::Buddy::Icon
 purple_buddy_icon_ref(icon)
 	Purple::Buddy::Icon icon
 
-Purple::Buddy::Icon
+void
 purple_buddy_icon_unref(icon)
 	Purple::Buddy::Icon icon
 



More information about the Commits mailing list