/pidgin/main: 1690e0b2c508: Fix a bunch of unused variables

Daniel Atallah datallah at pidgin.im
Fri Feb 22 18:54:56 EST 2013


Changeset: 1690e0b2c508b8aeb2d91e6e4a1c37052c2b8fea
Author:	 Daniel Atallah <datallah at pidgin.im>
Date:	 2013-02-22 18:54 -0500
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/1690e0b2c508

Description:

Fix a bunch of unused variables

 * some of these are extra work being done, but most are just style things
 * these came from the coverity static analysis

diffstat:

 libpurple/protocols/bonjour/jabber.c     |   4 ++--
 libpurple/protocols/mxit/multimx.c       |   3 +--
 libpurple/protocols/novell/novell.c      |   4 ----
 libpurple/protocols/oscar/oscar.c        |   6 ------
 libpurple/protocols/oscar/userinfo.c     |   8 +-------
 libpurple/protocols/sametime/sametime.c  |   3 +--
 libpurple/protocols/simple/simple.c      |   6 +++---
 libpurple/protocols/yahoo/yahoo_doodle.c |   6 ++----
 libpurple/protocols/zephyr/zephyr.c      |   4 ++--
 libpurple/smiley.c                       |  32 ++++++++++++++------------------
 pidgin/gtkconv.c                         |   2 +-
 pidgin/gtkdocklet.c                      |   2 --
 pidgin/gtkpounce.c                       |   9 ---------
 13 files changed, 27 insertions(+), 62 deletions(-)

diffs (truncated from 388 to 300 lines):

diff --git a/libpurple/protocols/bonjour/jabber.c b/libpurple/protocols/bonjour/jabber.c
--- a/libpurple/protocols/bonjour/jabber.c
+++ b/libpurple/protocols/bonjour/jabber.c
@@ -181,7 +181,7 @@ static void
 			/* Types of messages sent by iChat */
 			if (html_body_font_node != NULL) {
 				gchar *html_body;
-				const char *font_face, *font_size, *font_color,
+				const char *font_face, *font_size,
 					*ichat_balloon_color, *ichat_text_color;
 
 				font_face = xmlnode_get_attrib(html_body_font_node, "face");
@@ -189,7 +189,7 @@ static void
 				font_size = xmlnode_get_attrib(html_body_font_node, "ABSZ");
 				if (font_size != NULL)
 					font_size = _font_size_ichat_to_purple(atoi(font_size));
-				font_color = xmlnode_get_attrib(html_body_font_node, "color");
+				/*font_color = xmlnode_get_attrib(html_body_font_node, "color");*/
 				ichat_balloon_color = xmlnode_get_attrib(html_body_node, "ichatballooncolor");
 				ichat_text_color = xmlnode_get_attrib(html_body_node, "ichattextcolor");
 
diff --git a/libpurple/protocols/mxit/multimx.c b/libpurple/protocols/mxit/multimx.c
--- a/libpurple/protocols/mxit/multimx.c
+++ b/libpurple/protocols/mxit/multimx.c
@@ -275,7 +275,6 @@ static void member_update(PurpleConversa
 void multimx_invite(struct MXitSession* session, struct contact* contact, const char* creator)
 {
 	GHashTable *components;
-	struct multimx* multimx = NULL;
 
 	purple_debug_info(MXIT_PLUGIN_ID, "Groupchat invite to '%s' (roomid='%s') by '%s'\n", contact->alias, contact->username, creator);
 
@@ -284,7 +283,7 @@ void multimx_invite(struct MXitSession* 
 		return;
 
 	/* Create a new room */
-	multimx = room_create(session, contact->username, contact->alias, STATE_INVITED);
+	room_create(session, contact->username, contact->alias, STATE_INVITED);
 
 	components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
 	g_hash_table_insert(components, g_strdup("room"), g_strdup(contact->alias));
diff --git a/libpurple/protocols/novell/novell.c b/libpurple/protocols/novell/novell.c
--- a/libpurple/protocols/novell/novell.c
+++ b/libpurple/protocols/novell/novell.c
@@ -1284,7 +1284,6 @@ static void
 	PurpleBuddy *buddy = NULL;
 	PurpleGroup *group;
 	NMERR_T cnt = 0, i;
-	const char *text = NULL;
 	const char *name = NULL;
 	const char *fname = NULL;
 	int status = 0;
@@ -1327,7 +1326,6 @@ static void
 				user_record = nm_contact_get_user_record(contact);
 				if (user_record) {
 					status = nm_user_record_get_status(user_record);
-					text = nm_user_record_get_status_text(user_record);
 				}
 				_update_buddy_status(user, buddy, status, time(0));
 
@@ -3303,11 +3301,9 @@ novell_set_permit_deny(PurpleConnection 
 				}
 
 				for (node = gc->account->permit; node; node = node->next) {
-					name = NULL;
 					dn = nm_lookup_dn(user, (char *)node->data);
 					if (dn) {
 						user_record = nm_find_user_record(user, dn);
-						name = nm_user_record_get_display_id(user_record);
 
 						if (!g_slist_find_custom(user->allow_list,
 												 dn, (GCompareFunc)purple_utf8_strcasecmp)) {
diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c
--- a/libpurple/protocols/oscar/oscar.c
+++ b/libpurple/protocols/oscar/oscar.c
@@ -3471,13 +3471,11 @@ oscar_set_info(PurpleConnection *gc, con
 static guint32
 oscar_get_extended_status(PurpleConnection *gc)
 {
-	OscarData *od;
 	PurpleAccount *account;
 	PurpleStatus *status;
 	const gchar *status_id;
 	guint32 data = 0x00000000;
 
-	od = purple_connection_get_protocol_data(gc);
 	account = purple_connection_get_account(gc);
 	status = purple_account_get_active_status(account);
 	status_id = purple_status_get_id(status);
@@ -4609,7 +4607,6 @@ const char *oscar_list_emblem(PurpleBudd
 	PurpleAccount *account = NULL;
 	PurplePresence *presence;
 	PurpleStatus *status;
-	const char *status_id;
 	aim_userinfo_t *userinfo = NULL;
 	const char *name;
 
@@ -4624,7 +4621,6 @@ const char *oscar_list_emblem(PurpleBudd
 
 	presence = purple_buddy_get_presence(b);
 	status = purple_presence_get_active_status(presence);
-	status_id = purple_status_get_id(status);
 
 	if (purple_presence_is_online(presence) == FALSE) {
 		char *gname;
@@ -4683,7 +4679,6 @@ char *oscar_status_text(PurpleBuddy *b)
 	OscarData *od;
 	const PurplePresence *presence;
 	const PurpleStatus *status;
-	const char *id;
 	const char *message;
 	gchar *ret = NULL;
 
@@ -4692,7 +4687,6 @@ char *oscar_status_text(PurpleBuddy *b)
 	od = purple_connection_get_protocol_data(gc);
 	presence = purple_buddy_get_presence(b);
 	status = purple_presence_get_active_status(presence);
-	id = purple_status_get_id(status);
 
 	if ((od != NULL) && !purple_presence_is_online(presence))
 	{
diff --git a/libpurple/protocols/oscar/userinfo.c b/libpurple/protocols/oscar/userinfo.c
--- a/libpurple/protocols/oscar/userinfo.c
+++ b/libpurple/protocols/oscar/userinfo.c
@@ -310,7 +310,6 @@ oscar_user_info_append_extra_info(Purple
 	OscarData *od;
 	PurpleAccount *account;
 	PurplePresence *presence = NULL;
-	PurpleStatus *status = NULL;
 	PurpleGroup *g = NULL;
 	struct buddyinfo *bi = NULL;
 	char *tmp;
@@ -333,7 +332,6 @@ oscar_user_info_append_extra_info(Purple
 		g = purple_buddy_get_group(b);
 		gname = purple_group_get_name(g);
 		presence = purple_buddy_get_presence(b);
-		status = purple_presence_get_active_status(presence);
 	}
 
 	if (userinfo != NULL)
@@ -485,10 +483,6 @@ oscar_user_info_display_icq(OscarData *o
 		oscar_user_info_convert_and_add_hyperlink(account, od, user_info, _("Web Page"), info->email, "");
 	}
 
-	if (buddy != NULL)
-		alias = purple_buddy_get_alias(buddy);
-	else
-		alias = who;
 	purple_notify_userinfo(gc, who, user_info, NULL, NULL);
 	purple_notify_user_info_destroy(user_info);
 }
@@ -547,4 +541,4 @@ oscar_user_info_display_aim(OscarData *o
 
 	purple_notify_userinfo(gc, userinfo->bn, user_info, NULL, NULL);
 	purple_notify_user_info_destroy(user_info);
-}
\ No newline at end of file
+}
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c
--- a/libpurple/protocols/sametime/sametime.c
+++ b/libpurple/protocols/sametime/sametime.c
@@ -986,7 +986,6 @@ static void blist_merge(PurpleConnection
   struct mwSametimeUser *stuser;
 
   PurpleGroup *group;
-  PurpleBuddy *buddy;
 
   GList *gl, *gtl, *ul, *utl;
 
@@ -1000,7 +999,7 @@ static void blist_merge(PurpleConnection
     for(; ul; ul = ul->next) {
 
       stuser = (struct mwSametimeUser *) ul->data;
-      buddy = buddy_ensure(gc, group, stuser);
+      buddy_ensure(gc, group, stuser);
     }
     g_list_free(utl);
   }
diff --git a/libpurple/protocols/simple/simple.c b/libpurple/protocols/simple/simple.c
--- a/libpurple/protocols/simple/simple.c
+++ b/libpurple/protocols/simple/simple.c
@@ -901,11 +901,11 @@ static gboolean simple_add_lcs_contacts(
 
 		for(item = xmlnode_get_child(isc, "contact"); item; item = xmlnode_get_next_twin(item))
 		{
-			const char *uri, *name, *groups;
+			const char *uri;
 			char *buddy_name;
 			uri = xmlnode_get_attrib(item, "uri");
-			name = xmlnode_get_attrib(item, "name");
-			groups = xmlnode_get_attrib(item, "groups");
+			/*name = xmlnode_get_attrib(item, "name");
+			groups = xmlnode_get_attrib(item, "groups");*/
 			purple_debug_info("simple", "URI->%s\n", uri);
 
 			buddy_name = g_strdup_printf("sip:%s", uri);
diff --git a/libpurple/protocols/yahoo/yahoo_doodle.c b/libpurple/protocols/yahoo/yahoo_doodle.c
--- a/libpurple/protocols/yahoo/yahoo_doodle.c
+++ b/libpurple/protocols/yahoo/yahoo_doodle.c
@@ -104,20 +104,18 @@ void yahoo_doodle_initiate(PurpleConnect
 {
 	PurpleAccount *account;
 	char *to = (char*)name;
-	PurpleWhiteboard *wb;
 
 	g_return_if_fail(gc);
 	g_return_if_fail(name);
 
 	account = purple_connection_get_account(gc);
-	wb = purple_whiteboard_get_session(account, to);
 
-	if(wb == NULL)
+	if(purple_whiteboard_get_session(account, to) == NULL)
 	{
 		/* Insert this 'session' in the list.  At this point, it's only a
 		 * requested session.
 		 */
-		wb = purple_whiteboard_create(account, to, DOODLE_STATE_REQUESTING);
+		purple_whiteboard_create(account, to, DOODLE_STATE_REQUESTING);
 	}
 
 	/* NOTE Perhaps some careful handling of remote assumed established
diff --git a/libpurple/protocols/zephyr/zephyr.c b/libpurple/protocols/zephyr/zephyr.c
--- a/libpurple/protocols/zephyr/zephyr.c
+++ b/libpurple/protocols/zephyr/zephyr.c
@@ -1515,10 +1515,10 @@ static void process_anyone(PurpleConnect
 		while (fgets(buff, BUFSIZ, fd)) {
 			strip_comments(buff);
 			if (buff[0]) {
-				if (!(b = purple_find_buddy(gc->account, buff))) {
+				if (!purple_find_buddy(gc->account, buff)) {
 					char *stripped_user = zephyr_strip_local_realm(zephyr,buff);
 					purple_debug_info("zephyr","stripped_user %s\n",stripped_user);
-					if (!(b = purple_find_buddy(gc->account,stripped_user))){
+					if (!purple_find_buddy(gc->account,stripped_user)){
 						b = purple_buddy_new(gc->account, stripped_user, NULL);
 						purple_blist_add_buddy(b, NULL, g, NULL);
 					}
diff --git a/libpurple/smiley.c b/libpurple/smiley.c
--- a/libpurple/smiley.c
+++ b/libpurple/smiley.c
@@ -114,7 +114,7 @@ static char *get_file_full_path(const ch
 
 static PurpleSmiley *purple_smiley_create(const char *shortcut);
 
-static PurpleSmiley *purple_smiley_load_file(const char *shortcut, const char *checksum,
+static void purple_smiley_load_file(const char *shortcut, const char *checksum,
 		const char *filename);
 
 static void
@@ -227,10 +227,9 @@ purple_smileys_save(void)
  * Reading from disk                                                 *
  *********************************************************************/
 
-static PurpleSmiley *
+static void
 parse_smiley(xmlnode *smiley_node)
 {
-	PurpleSmiley *smiley;
 	const char *shortcut = NULL;
 	const char *checksum = NULL;
 	const char *filename = NULL;
@@ -240,11 +239,9 @@ parse_smiley(xmlnode *smiley_node)
 	filename = xmlnode_get_attrib(smiley_node, XML_FILENAME_ATRIB_TAG);
 
 	if ((shortcut == NULL) || (checksum == NULL) || (filename == NULL))
-		return NULL;
+		return;
 
-	smiley = purple_smiley_load_file(shortcut, checksum, filename);
-
-	return smiley;
+	purple_smiley_load_file(shortcut, checksum, filename);
 }
 
 static void
@@ -272,9 +269,7 @@ purple_smileys_load(void)
 		smiley_node = xmlnode_get_child(smileyset_node, XML_SMILEY_TAG);
 		for (; smiley_node != NULL;
 				smiley_node = xmlnode_get_next_twin(smiley_node)) {
-			PurpleSmiley *smiley;
-
-			smiley = parse_smiley(smiley_node);
+			parse_smiley(smiley_node);
 		}
 	}
 
@@ -473,7 +468,7 @@ static char *get_file_full_path(const ch
 	return path;
 }
 
-static PurpleSmiley *
+static void
 purple_smiley_load_file(const char *shortcut, const char *checksum, const char *filename)
 {
 	PurpleSmiley *smiley = NULL;
@@ -481,18 +476,20 @@ purple_smiley_load_file(const char *shor
 	size_t smiley_data_len;
 	char *fullpath = NULL;
 



More information about the Commits mailing list