From 5beddfe76ba5d23ce08ed236a5d7e51509867aff Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Thu, 26 May 2011 16:41:16 -0400
Subject: [PATCH] * #5949: remove unused/unused-but-set variable warnings

---
 sflphone-client-gnome/src/actions.c               |  6 ++----
 sflphone-client-gnome/src/codeclist.c             |  4 ++--
 .../src/config/accountconfigdialog.c              |  4 ----
 .../src/config/addressbook-config.c               |  4 ----
 sflphone-client-gnome/src/config/audioconf.c      | 15 ++++++---------
 .../src/contacts/addressbook/eds.c                | 12 ++++--------
 sflphone-client-gnome/src/uimanager.c             |  9 ++-------
 7 files changed, 16 insertions(+), 38 deletions(-)

diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c
index c92f3e67a2..008592f7b2 100644
--- a/sflphone-client-gnome/src/actions.c
+++ b/sflphone-client-gnome/src/actions.c
@@ -1199,7 +1199,6 @@ void sflphone_fill_call_list (void)
 {
 
     gchar** calls = (gchar**) dbus_get_call_list();
-    gchar** pl;
     GHashTable *call_details;
     callable_obj_t *c;
     gchar *callID;
@@ -1207,7 +1206,7 @@ void sflphone_fill_call_list (void)
     DEBUG ("sflphone_fill_call_list");
 
     if (calls) {
-        for (pl=calls; *calls; calls++) {
+        for (; *calls; calls++) {
             c = g_new0 (callable_obj_t, 1);
             callID = (gchar*) (*calls);
             call_details = dbus_get_call_details (callID);
@@ -1229,7 +1228,6 @@ void sflphone_fill_conference_list (void)
     // TODO Fetch the active conferences at client startup
 
     gchar** conferences;
-    gchar** pl;
     GHashTable *conference_details;
     gchar* conf_id;
     conference_obj_t* conf;
@@ -1239,7 +1237,7 @@ void sflphone_fill_conference_list (void)
     conferences = dbus_get_conference_list();
 
     if (conferences) {
-        for (pl = conferences; *conferences; conferences++) {
+        for (; *conferences; conferences++) {
             conf = g_new0 (conference_obj_t, 1);
             conf_id = (gchar*) (*conferences);
 
diff --git a/sflphone-client-gnome/src/codeclist.c b/sflphone-client-gnome/src/codeclist.c
index b17be65c68..4d263df510 100644
--- a/sflphone-client-gnome/src/codeclist.c
+++ b/sflphone-client-gnome/src/codeclist.c
@@ -70,7 +70,7 @@ void codec_list_init (GQueue **queue)
 void codec_capabilities_load (void)
 {
 
-    gchar **codecs = NULL, **pl = NULL, **specs = NULL;
+    gchar **codecs = NULL, **specs = NULL;
     guint payload;
 
     // Create the queue object that will contain the global list of audio codecs
@@ -84,7 +84,7 @@ void codec_capabilities_load (void)
 
     if (codecs != NULL) {
         // Add the codecs in the list
-        for (pl=codecs; *codecs; codecs++) {
+        for (; *codecs; codecs++) {
 
             codec_t *c;
             payload = atoi (*codecs);
diff --git a/sflphone-client-gnome/src/config/accountconfigdialog.c b/sflphone-client-gnome/src/config/accountconfigdialog.c
index 4eccca7a3b..4b86dad105 100644
--- a/sflphone-client-gnome/src/config/accountconfigdialog.c
+++ b/sflphone-client-gnome/src/config/accountconfigdialog.c
@@ -285,8 +285,6 @@ static GtkWidget* create_basic_tab (account_t **a)
 #endif
 
     // Default settings
-    gchar *curAccountID = "";
-    gchar *curAccountEnabled = "true";
     gchar *curAccountType = "SIP";
     gchar *curAlias = "";
     gchar *curUsername = "";
@@ -305,9 +303,7 @@ static GtkWidget* create_basic_tab (account_t **a)
 
     // Load from SIP/IAX/Unknown ?
     if (currentAccount) {
-        curAccountID = currentAccount->accountID;
         curAccountType = g_hash_table_lookup (currentAccount->properties, ACCOUNT_TYPE);
-        curAccountEnabled = g_hash_table_lookup (currentAccount->properties, ACCOUNT_ENABLED);
         curAlias = g_hash_table_lookup (currentAccount->properties, ACCOUNT_ALIAS);
         curHostname = g_hash_table_lookup (currentAccount->properties, ACCOUNT_HOSTNAME);
         curPassword = g_hash_table_lookup (currentAccount->properties, ACCOUNT_PASSWORD);
diff --git a/sflphone-client-gnome/src/config/addressbook-config.c b/sflphone-client-gnome/src/config/addressbook-config.c
index 74852236a9..f2da4d5a28 100644
--- a/sflphone-client-gnome/src/config/addressbook-config.c
+++ b/sflphone-client-gnome/src/config/addressbook-config.c
@@ -314,7 +314,6 @@ create_addressbook_settings()
 
     GtkListStore *store;
     GtkCellRenderer *renderer;
-    GtkTreeSelection *tree_selection;
     GtkTreeViewColumn *tree_view_column;
 
     // Load the user value
@@ -408,9 +407,6 @@ create_addressbook_settings()
     // Create tree view with list store
     book_tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
 
-    // Get tree selection manager
-    tree_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (book_tree_view));
-
     // Active column
     renderer = gtk_cell_renderer_toggle_new();
     tree_view_column = gtk_tree_view_column_new_with_attributes ("", renderer, "active", COLUMN_BOOK_ACTIVE, NULL);
diff --git a/sflphone-client-gnome/src/config/audioconf.c b/sflphone-client-gnome/src/config/audioconf.c
index 581264a7bb..069e0c4285 100644
--- a/sflphone-client-gnome/src/config/audioconf.c
+++ b/sflphone-client-gnome/src/config/audioconf.c
@@ -146,7 +146,6 @@ preferences_dialog_fill_output_audio_device_list()
 
     GtkTreeIter iter;
     gchar** list;
-    gchar** audioDevice;
     int index;
 
     gtk_list_store_clear (outputlist);
@@ -157,7 +156,7 @@ preferences_dialog_fill_output_audio_device_list()
     // For each device name included in list
     int c = 0;
 
-    for (audioDevice = list; *list ; list++) {
+    for (; *list ; list++) {
         index = dbus_get_audio_device_index (*list);
         gtk_list_store_append (outputlist, &iter);
         gtk_list_store_set (outputlist, &iter, 0, *list, 1, index, -1);
@@ -176,7 +175,6 @@ preferences_dialog_fill_ringtone_audio_device_list()
 
     GtkTreeIter iter;
     gchar** list;
-    gchar** audioDevice;
     int index;
 
     gtk_list_store_clear (ringtonelist);
@@ -187,7 +185,7 @@ preferences_dialog_fill_ringtone_audio_device_list()
     // For each device name in the list
     int c = 0;
 
-    for (audioDevice = list; *list; list++) {
+    for (; *list; list++) {
         index = dbus_get_audio_device_index (*list);
         gtk_list_store_append (ringtonelist, &iter);
         gtk_list_store_set (ringtonelist, &iter, 0, *list, 1, index, -1);
@@ -285,7 +283,6 @@ preferences_dialog_fill_input_audio_device_list()
 
     GtkTreeIter iter;
     gchar** list;
-    gchar** audioDevice;
     int index ;
     gtk_list_store_clear (inputlist);
 
@@ -294,7 +291,7 @@ preferences_dialog_fill_input_audio_device_list()
 
     // For each device name included in list
     //int c = 0;
-    for (audioDevice = list; *list; list++) {
+    for (; *list; list++) {
         index = dbus_get_audio_device_index (*list);
         gtk_list_store_append (inputlist, &iter);
         gtk_list_store_set (inputlist, &iter, 0, *list, 1, index, -1);
@@ -799,8 +796,9 @@ active_echo_cancel(void)
 }
 
 void
-echo_tail_length_changed(GtkRange *range, gpointer  user_data)
+echo_tail_length_changed(GtkRange *range, gpointer user_data)
 {
+    (void) user_data; /* UNUSED */
     gint value;
     value = (gint)gtk_range_get_value(range);
 
@@ -810,6 +808,7 @@ echo_tail_length_changed(GtkRange *range, gpointer  user_data)
 void
 echo_delay_changed(GtkRange *range, gpointer  user_data)
 {
+    (void) user_data; /* UNUSED */
     gint value;
     value = (gint)gtk_range_get_value(range);
 
@@ -963,8 +962,6 @@ GtkWidget* create_audio_configuration()
     GtkWidget *frame;
     GtkWidget *enableNoiseReduction;
     GtkWidget *enableEchoCancel;
-    GtkWidget *echoTailLength;
-    GtkWidget *echoDelay;
     gboolean noisesuppressActive;
     gboolean echoCancelActive;
     gchar *state;
diff --git a/sflphone-client-gnome/src/contacts/addressbook/eds.c b/sflphone-client-gnome/src/contacts/addressbook/eds.c
index 625d6f53f8..e58679cda8 100644
--- a/sflphone-client-gnome/src/contacts/addressbook/eds.c
+++ b/sflphone-client-gnome/src/contacts/addressbook/eds.c
@@ -497,6 +497,8 @@ init_eds_mutex() {
 static void
 authenticate_source (EBook *book)
 {
+    (void) book; /* unused */
+    /*
     const gchar *auth_domain;
     const gchar *password = NULL;
     const gchar *component_name;
@@ -538,7 +540,6 @@ authenticate_source (EBook *book)
     if (auth) {
         component_name = auth_domain ? auth_domain : "Addressbook";
 
-/*
         password = e_passwords_get_password (component_name, uri);
 
         if (e_book_authenticate_user (book, user, password, auth, &err)) {
@@ -547,8 +548,9 @@ authenticate_source (EBook *book)
         else {
             ERROR ("Addressbook: authentication error");
         }
-*/
+
     }
+*/
 }
 
 /**
@@ -559,7 +561,6 @@ fill_books_data ()
 {
     GSList *list, *l;
     ESourceList *source_list = NULL;
-    gboolean default_found;
 
     DEBUG ("Addressbook: Fill books data");
 
@@ -584,10 +585,6 @@ fill_books_data ()
         books_data = NULL;
     }
 
-
-    // in case default property is not set for any addressbook
-    default_found = FALSE;
-
     for (l = list; l != NULL; l = l->next) {
 
         ESourceGroup *group = l->data;
@@ -611,7 +608,6 @@ fill_books_data ()
             if (prop) {
                 if (strcmp (prop, "true") == 0) {
                     book_data->isdefault = TRUE;
-                    default_found = TRUE;
                 } else {
                     book_data->isdefault = FALSE;
                 }
diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c
index a603725b30..30f37ab51f 100644
--- a/sflphone-client-gnome/src/uimanager.c
+++ b/sflphone-client-gnome/src/uimanager.c
@@ -51,7 +51,6 @@
 void show_edit_number (callable_obj_t *call);
 
 static GtkWidget *toolbar;
-static GtkWidget *toolbarWindows;
 
 guint transfertButtonConnId; //The button toggled signal connection ID
 guint recordButtonConnId; //The button toggled signal connection ID
@@ -1107,8 +1106,8 @@ show_popup_menu (GtkWidget *my_widget, GdkEventButton *event)
     // TODO update the selection to make sure the call under the mouse is the call selected
 
     // call type boolean
-    gboolean pickup = FALSE, hangup = FALSE, hold = FALSE, copy = FALSE, record =
-                                          FALSE, detach = FALSE, im = FALSE;
+    gboolean pickup = FALSE, hangup = FALSE, hold = FALSE, copy = FALSE,
+             record = FALSE, im = FALSE;
     gboolean accounts = FALSE;
 
     // conference type boolean
@@ -1128,16 +1127,13 @@ show_popup_menu (GtkWidget *my_widget, GdkEventButton *event)
                 case CALL_STATE_INCOMING:
                     pickup = TRUE;
                     hangup = TRUE;
-                    detach = TRUE;
                     break;
                 case CALL_STATE_HOLD:
                     hangup = TRUE;
                     hold = TRUE;
-                    detach = TRUE;
                     break;
                 case CALL_STATE_RINGING:
                     hangup = TRUE;
-                    detach = TRUE;
                     break;
                 case CALL_STATE_DIALING:
                     pickup = TRUE;
@@ -1149,7 +1145,6 @@ show_popup_menu (GtkWidget *my_widget, GdkEventButton *event)
                     hangup = TRUE;
                     hold = TRUE;
                     record = TRUE;
-                    detach = TRUE;
                     im = TRUE;
                     break;
                 case CALL_STATE_BUSY:
-- 
GitLab