aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2012-04-16 07:59:48 +0000
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2012-04-16 07:59:48 +0000
commit9380f962a2d694183b9ce20830b5943d3ea7b7fb (patch)
tree722a0221205b9032ebb30a13f3976f218d69192c
parent53155a11c0a111179c1ee8ad3b2327b127d0ac14 (diff)
downloadwireshark-9380f962a2d694183b9ce20830b5943d3ea7b7fb.tar.gz
wireshark-9380f962a2d694183b9ce20830b5943d3ea7b7fb.tar.bz2
wireshark-9380f962a2d694183b9ce20830b5943d3ea7b7fb.zip
Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=42090
-rw-r--r--airpcap_loader.c15
-rw-r--r--ui/gtk/airpcap_dlg.c5
-rw-r--r--ui/gtk/airpcap_gui_utils.c16
3 files changed, 1 insertions, 35 deletions
diff --git a/airpcap_loader.c b/airpcap_loader.c
index 98288ba57c..537bdf289e 100644
--- a/airpcap_loader.c
+++ b/airpcap_loader.c
@@ -350,11 +350,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
*/
KeysCollectionSize = sizeof(AirpcapKeysCollection) + keys_in_list * sizeof(AirpcapKey);
@@ -454,11 +449,6 @@ write_wlan_driver_wep_keys_to_registry(GList* key_list)
keys_in_list++;
/*
- * Save the encryption keys, if we have any of them
- */
- KeysCollectionSize = 0;
-
- /*
* Calculate the size of the keys collection
*/
KeysCollectionSize = sizeof(AirpcapKeysCollection) + keys_in_list * sizeof(AirpcapKey);
@@ -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;
diff --git a/ui/gtk/airpcap_dlg.c b/ui/gtk/airpcap_dlg.c
index 736e6135b7..e463f7823a 100644
--- a/ui/gtk/airpcap_dlg.c
+++ b/ui/gtk/airpcap_dlg.c
@@ -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);
diff --git a/ui/gtk/airpcap_gui_utils.c b/ui/gtk/airpcap_gui_utils.c
index a31322f14a..1d6ce032eb 100644
--- a/ui/gtk/airpcap_gui_utils.c
+++ b/ui/gtk/airpcap_gui_utils.c
@@ -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)*/
@@ -717,11 +715,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
*/
KeysCollectionSize = sizeof(AirpcapKeysCollection) + keys_in_list * sizeof(AirpcapKey);
@@ -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);