Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
authoralagoutte <alagoutte@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 16 Apr 2012 07:59:48 +0000 (07:59 +0000)
committeralagoutte <alagoutte@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 16 Apr 2012 07:59:48 +0000 (07:59 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@42090 f5534014-38df-0310-8fa8-9805f1628bb7

airpcap_loader.c
ui/gtk/airpcap_dlg.c
ui/gtk/airpcap_gui_utils.c

index 98288ba57caf70faf585afa37b5c6cfef8f983f7..537bdf289e0b07c4bcf5aa7bc38f23444b81241f 100644 (file)
@@ -349,11 +349,6 @@ write_wlan_wep_keys_to_registry(airpcap_if_info_t* info_if, GList* key_list)
 
     keys_in_list = g_list_length(key_list);
 
-    /*
-     * Save the encryption keys, if we have any of them
-     */
-    KeysCollectionSize = 0;
-
     /*
      * Calculate the size of the keys collection
      */
@@ -453,11 +448,6 @@ write_wlan_driver_wep_keys_to_registry(GList* key_list)
        if(((decryption_key_t*)g_list_nth_data(key_list,k))->type == AIRPDCAP_KEY_TYPE_WEP)
            keys_in_list++;
 
-    /*
-     * Save the encryption keys, if we have any of them
-     */
-    KeysCollectionSize = 0;
-
     /*
      * Calculate the size of the keys collection
      */
@@ -1966,7 +1956,6 @@ merge_key_list(GList* list1, GList* list2)
 
     if(list1 == NULL)
     {
-       n1 = 0;
        n2 = g_list_length(list2);
 
        for(i=0;i<n2;i++)
@@ -1987,7 +1976,6 @@ merge_key_list(GList* list1, GList* list2)
     else if(list2 == NULL)
     {
        n1 = g_list_length(list1);
-       n2 = 0;
 
        for(i=0;i<n1;i++)
        {
@@ -2204,7 +2192,6 @@ key_lists_are_equal(GList* list1, GList* list2)
     /* if(n1 != n2) return FALSE; */
     if(wep_n1 != wep_n2) return FALSE;
 
-    n1 = wep_n1;
     n2 = wep_n2;
 
     /*for(i=0;i<n1;i++)
@@ -2326,14 +2313,12 @@ static guint
 set_on_off(pref_t *pref, gpointer ud)
 {
     gboolean *is_on;
-    gboolean number;
 
     /* Retrieve user data info */
     is_on = (gboolean*)ud;
 
     if (g_ascii_strncasecmp(pref->name, "enable_decryption", 17) == 0 && pref->type == PREF_BOOL)
     {
-       number = *pref->varp.boolp;
 
        if(*is_on)
            *pref->varp.boolp = TRUE;
index 736e6135b78bf6da497c9ee7c21a54a352e5f7d6..e463f7823aa82f762589e745c023ad837eee6788 100644 (file)
@@ -2479,20 +2479,15 @@ on_keep_bt_clicked (GtkWidget *button _U_, gpointer user_data)
     GtkListStore *key_list_store=NULL;
 
     GList* wireshark_keys=NULL;
-    guint n_wireshark_keys = 0;
 
     GList* merged_keys=NULL;
 
-    guint n_total_keys=0;
-
     keys_check_w = GTK_WIDGET(user_data);
 
     key_management_w = g_object_get_data(G_OBJECT(keys_check_w),AIRPCAP_CHECK_WINDOW_KEY);
 
     /* Retrieve Wireshark keys */
     wireshark_keys = get_wireshark_keys();
-    n_wireshark_keys = g_list_length(wireshark_keys);
-    n_total_keys += n_wireshark_keys;
 
     merged_keys = merge_key_list(wireshark_keys,NULL);
 
index a31322f14a791ffafafae9e2fe90ac40e155ef4d..1d6ce032ebc82d18f88529e3959485ade73c46ac 100644 (file)
@@ -278,8 +278,6 @@ airpcap_fill_key_list(GtkListStore *key_list_store)
     decryption_key_t* curr_key = NULL;
     GtkTreeIter    iter;
 
-    n = 0;
-
     fake_if_info = airpcap_driver_fake_if_info_new();
 
     /* We can retrieve the driver's key list (i.e. we have the right .dll)*/
@@ -716,11 +714,6 @@ airpcap_add_keys_to_driver_from_list(GtkListStore *key_list_store, airpcap_if_in
 
     keys_in_list = gtk_tree_model_iter_n_children(model, NULL);
 
-    /*
-     * Save the encryption keys, if we have any of them
-     */
-    KeysCollectionSize = 0;
-
     /*
      * Calculate the size of the keys collection
      */
@@ -801,7 +794,6 @@ airpcap_read_and_save_decryption_keys_from_list_store(GtkListStore* key_list_sto
     gboolean items_left;
     gint if_n = 0;
     gint i = 0;
-    gint r = 0;
     airpcap_if_info_t* curr_if = NULL;
     airpcap_if_info_t* fake_info_if = NULL;
     GList* key_list=NULL;
@@ -859,7 +851,7 @@ airpcap_read_and_save_decryption_keys_from_list_store(GtkListStore* key_list_sto
         g_free(tmp_ssid);
     }
 
-    r = save_wlan_wireshark_wep_keys(key_list);
+    save_wlan_wireshark_wep_keys(key_list);
     /* The key_list has been freed!!! */
 
     /*
@@ -910,7 +902,6 @@ airpcap_check_decryption_keys(GList* if_list)
     gint i = 0;
     gint n_adapters_keys = 0;
     gint n_driver_keys = 0;
-    gint n_wireshark_keys = 0;
     airpcap_if_info_t* curr_if = NULL;
 
     GList* wireshark_key_list;
@@ -931,7 +922,6 @@ airpcap_check_decryption_keys(GList* if_list)
 
     /* Get Wireshark preferences keys */
     wireshark_key_list = get_wireshark_keys();
-    n_wireshark_keys = g_list_length(wireshark_key_list);
 
     /* Retrieve AirPcap driver's keys */
     driver_key_list = get_airpcap_driver_keys();
@@ -973,7 +963,6 @@ airpcap_load_decryption_keys(GList* if_list)
 {
     gint if_n = 0;
     gint i = 0;
-    airpcap_if_info_t* curr_if = NULL;
 
     if(if_list == NULL) return;
 
@@ -981,7 +970,6 @@ airpcap_load_decryption_keys(GList* if_list)
 
     for(i = 0; i < if_n; i++)
     {
-        curr_if = (airpcap_if_info_t*)g_list_nth_data(if_list,i);
         load_wlan_driver_wep_keys();
     }
 }
@@ -994,7 +982,6 @@ void
 airpcap_save_decryption_keys(GList* key_list, GList* adapters_list)
 {
     gint if_n = 0;
-    gint key_n = 0;
     gint i = 0;
     airpcap_if_info_t* curr_if = NULL;
     GList* empty_key_list = NULL;
@@ -1002,7 +989,6 @@ airpcap_save_decryption_keys(GList* key_list, GList* adapters_list)
     if( (key_list == NULL) || (adapters_list == NULL)) return;
 
     if_n = g_list_length(adapters_list);
-    key_n = g_list_length(key_list);
 
     /* Set the driver's global list of keys. */
     write_wlan_driver_wep_keys_to_registry(key_list);