/pidgin/main: f06dab8296be: Fix coverity dead code warnings

Tomasz Wasilczyk twasilczyk at pidgin.im
Sat May 17 09:35:53 EDT 2014


Changeset: f06dab8296bec2f869d525bfda91acd2c9bdd928
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-05-17 15:35 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/f06dab8296be

Description:

Fix coverity dead code warnings

diffstat:

 libpurple/plugins/ciphertest.c   |   5 -----
 libpurple/prefs.c                |   3 +++
 libpurple/protocols/yahoo/util.c |   7 +++++--
 pidgin/gtkconv.c                 |  12 ++++++++----
 4 files changed, 16 insertions(+), 11 deletions(-)

diffs (100 lines):

diff --git a/libpurple/plugins/ciphertest.c b/libpurple/plugins/ciphertest.c
--- a/libpurple/plugins/ciphertest.c
+++ b/libpurple/plugins/ciphertest.c
@@ -422,11 +422,6 @@ cipher_test_pbkdf2(void)
 		skip_nss = TRUE;
 #endif
 
-		if (!ret) {
-			purple_debug_info("cipher-test", "\tnss test failed\n");
-			fail = TRUE;
-		}
-
 		purple_debug_info("cipher-test", "\tGot:          %s\n", digest);
 		if (digest_nss)
 			purple_debug_info("cipher-test", "\tGot from NSS: %s\n", digest_nss);
diff --git a/libpurple/prefs.c b/libpurple/prefs.c
--- a/libpurple/prefs.c
+++ b/libpurple/prefs.c
@@ -396,8 +396,11 @@ purple_prefs_load()
 
 		error = NULL;
 
+#ifndef __COVERITY__
+		/* coverity dead_error_line false positive */
 		if (sysconfdir == NULL)
 			sysconfdir = "";
+#endif
 		filename = g_build_filename(sysconfdir, "purple", "prefs.xml", NULL);
 
 		purple_debug_info("prefs", "Reading %s\n", filename);
diff --git a/libpurple/protocols/yahoo/util.c b/libpurple/protocols/yahoo/util.c
--- a/libpurple/protocols/yahoo/util.c
+++ b/libpurple/protocols/yahoo/util.c
@@ -38,13 +38,16 @@ yahoo_account_use_http_proxy(PurpleConne
 	PurpleAccount *account = purple_connection_get_account(pc);
 	PurpleProxyInfo *ppi = NULL;
 	PurpleProxyType type = PURPLE_PROXY_NONE;
-	gboolean proxy_ssl = TRUE; /*purple_account_get_bool(account, "proxy_ssl", FALSE);*/
+#if 0
+	gboolean proxy_ssl = purple_account_get_bool(account, "proxy_ssl", FALSE);
 
 	if(proxy_ssl)
 		ppi = purple_proxy_get_setup(account);
 	else
 		ppi = purple_proxy_get_setup(NULL);
-
+#else
+	ppi = purple_proxy_get_setup(account);
+#endif
 	type = purple_proxy_info_get_proxy_type(ppi);
 
 	return (type == PURPLE_PROXY_HTTP || type == PURPLE_PROXY_USE_ENVVAR);
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -602,7 +602,9 @@ send_cb(GtkWidget *widget, PidginConvers
 {
 	PurpleConversation *conv = gtkconv->active_conv;
 	PurpleAccount *account;
+#if 0
 	PurpleConnection *gc;
+#endif
 	PurpleMessageFlags flags = 0;
 	char *buf;
 
@@ -634,9 +636,9 @@ send_cb(GtkWidget *widget, PidginConvers
 	if (strstr(buf, "<img ") != NULL)
 		flags |= PURPLE_MESSAGE_IMAGES;
 
-	gc = NULL/*purple_account_get_connection(account)*/;
+#if 0
+	gc = purple_account_get_connection(account);
 	if (gc && (purple_conversation_get_features(conv) & PURPLE_CONNECTION_FLAG_NO_NEWLINES)) {
-#if 0
 		/* TODO WebKit */
 		char **bufs;
 		int i;
@@ -648,9 +650,9 @@ send_cb(GtkWidget *widget, PidginConvers
 		}
 
 		g_strfreev(bufs);
+	} else
 #endif
-
-	} else {
+	{
 		send_history_add(gtkconv, buf);
 		purple_conversation_send_with_flags(conv, buf, flags);
 	}
@@ -4340,8 +4342,10 @@ add_chat_user_common(PurpleChatConversat
 	purple_chat_user_set_ui_data(cb, gtk_tree_row_reference_new(tm, newpath));
 	gtk_tree_path_free(newpath);
 
+#if 0
 	if (is_me && color)
 		gdk_color_free(color);
+#endif
 	g_free(alias_key);
 }
 



More information about the Commits mailing list