Removed some unused variables and unused assignments.
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 10 Nov 2009 12:05:25 +0000 (12:05 +0000)
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 10 Nov 2009 12:05:25 +0000 (12:05 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30918 f5534014-38df-0310-8fa8-9805f1628bb7

20 files changed:
gtk/capture_file_dlg.c
gtk/color_dlg.c
gtk/color_edit_dlg.c
gtk/conversations_table.c
gtk/decode_as_dlg.c
gtk/dfilter_expr_dlg.c
gtk/drag_and_drop.c
gtk/filter_autocomplete.c
gtk/filter_dlg.c
gtk/follow_ssl.c
gtk/follow_udp.c
gtk/font_utils.c
gtk/graph_analysis.c
gtk/gsm_map_stat.c
gtk/packet_list_store.c
gtk/prefs_capture.c
gtk/profile_dlg.c
gtk/proto_hier_stats_dlg.c
gtk/rtp_stream_dlg.c
gtk/supported_protos_dlg.c

index 24acb38710620f7e3a57e6377616e7e4917a3214..077646e647f1c99df239e9456e781f24843cc7f6 100644 (file)
@@ -1192,7 +1192,6 @@ file_save_as_cmd(action_after_save_e action_after_save, gpointer action_after_sa
   win32_save_as_file(GDK_WINDOW_HWND(top_level->window), action_after_save, action_after_save_data);
 #else /* _WIN32 */
   GtkWidget     *main_vb, *ft_hb, *ft_lb, *range_fr, *compressed_cb;
-  GtkTooltips   *tooltips;
 
   if (file_save_as_w != NULL) {
     /* There's already an "Save Capture File As" dialog box; reactivate it. */
@@ -1206,9 +1205,6 @@ file_save_as_cmd(action_after_save_e action_after_save, gpointer action_after_sa
   /* init the packet range */
   packet_range_init(&range);
 
-  /* Enable tooltips */
-  tooltips = gtk_tooltips_new();
-
   /* build the file selection */
   file_save_as_w = file_selection_new ("Wireshark: Save Capture File As",
                                        FILE_SELECTION_SAVE);
index 2e5ea684779037c2e83a80db2632e2ca681fc396..6bb0fd45a1806d38a916462bc0708349a5afcaa2 100644 (file)
@@ -705,13 +705,11 @@ static void
 select_row(GtkWidget *color_filters, int row)
 {
   GtkTreeModel     *model;
-  gint              num_filters;
   GtkTreeIter       iter;
   GtkTreeSelection *sel;
 
   /* select the new row */
   model = gtk_tree_view_get_model(GTK_TREE_VIEW(color_filters));
-  num_filters = gtk_tree_model_iter_n_children(model, NULL);
   gtk_tree_model_iter_nth_child(model, &iter, NULL, row);
   sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(color_filters));
   gtk_tree_selection_select_iter(sel, &iter);
index 009a72ce408f7cdade3b41f61140f08d81d0ea6a..3ebf512e134f03170788e24340723dd4a215a928 100644 (file)
@@ -532,7 +532,7 @@ color_sel_ok_cb                        (GtkButton       *button _U_,
   GdkColor new_color; /* Color from color selection dialog */
   GtkWidget *color_dialog;
   GtkWidget *parent;
-  GtkWidget *color_selection_fg, *color_selection_bg;
+  GtkWidget *color_selection_bg;
   gboolean is_bg;
 
   color_dialog = (GtkWidget *)user_data;
@@ -550,7 +550,6 @@ color_sel_ok_cb                        (GtkButton       *button _U_,
 
        /* Find that dialog box's foreground and background color selection
           boxes, if any. */
-       color_selection_fg = g_object_get_data(G_OBJECT(parent), COLOR_SELECTION_FG);
        color_selection_bg = g_object_get_data(G_OBJECT(parent), COLOR_SELECTION_BG);
        is_bg = (color_dialog == color_selection_bg);
 
@@ -559,7 +558,7 @@ color_sel_ok_cb                        (GtkButton       *button _U_,
        /* now apply the change to the fore/background */
        if (is_bg)
          gtk_widget_modify_base(filt_name_entry, GTK_STATE_NORMAL, &new_color);
-        else
+       else
          gtk_widget_modify_text(filt_name_entry, GTK_STATE_NORMAL, &new_color);
   }
 }
index e53f22bbc00a0f07b784a2bd9dce37d8a56678ef..2a6222302e391dd07db414ea80b54aee6e16a802 100644 (file)
@@ -1840,7 +1840,6 @@ add_conversation_table_data(conversations_table *ct, const address *src, const a
     guint32 port1, port2;
     conv_t *conversation=NULL;
     unsigned int conversation_idx=0;
-    gboolean new_conversation;
 
     if(src_port>dst_port){
         addr1=src;
@@ -1864,11 +1863,9 @@ add_conversation_table_data(conversations_table *ct, const address *src, const a
         port1=dst_port;
     }
 
-    new_conversation=FALSE;
     /* if we dont have any entries at all yet */
     if(ct->conversations==NULL){
         ct->conversations= g_array_sized_new(FALSE, FALSE, sizeof(conv_t), 10000);
-        conversation_idx=0;
 
         ct->hashtable = g_hash_table_new_full(conversation_hash,
                        conversation_match, /* key_equal_func */
@@ -1896,7 +1893,6 @@ add_conversation_table_data(conversations_table *ct, const address *src, const a
     if(conversation==NULL){
        conv_key_t *new_key;
         conv_t conv;
-        new_conversation=TRUE;
         
         COPY_ADDRESS(&conv.src_address, addr1);
         COPY_ADDRESS(&conv.dst_address, addr2);
index f0affeeb48b24f8a1ff53d9fe6e95779150fcc9e..7842222b7addc5aa14eec31e9061abc3d1284da8 100644 (file)
@@ -1012,7 +1012,6 @@ decode_add_yes_no (void)
     gtk_box_pack_start(GTK_BOX(format_vb), radio_button, TRUE, TRUE, 0);
 
     radio_button = gtk_radio_button_new_with_label(format_grp, "Do not decode");
-    format_grp = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button));
     g_signal_connect(radio_button, "clicked", G_CALLBACK(decode_update_action),
                    GINT_TO_POINTER(E_DECODE_NO));
     gtk_box_pack_start(GTK_BOX(format_vb), radio_button, TRUE, TRUE, 0);
@@ -1585,7 +1584,6 @@ decode_sctp_add_port_ppid (GtkWidget *page)
     gtk_box_pack_start(GTK_BOX(format_vb), radio_button, TRUE, TRUE, 0);
 
     radio_button = gtk_radio_button_new_with_label(format_grp, "Port");
-    format_grp = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button));
     g_signal_connect(radio_button, "clicked", G_CALLBACK(decode_sctp_update_srcdst_menu), page);
 
     gtk_box_pack_start(GTK_BOX(format_vb), radio_button, TRUE, TRUE, 0);
index 40c06bee59841b9d64ebf9d9e1252a3c1ecf3c2b..ae030a2f790ec39a989000458de164bfe84fe776 100644 (file)
@@ -455,13 +455,6 @@ display_value_fields(header_field_info *hfinfo, gboolean is_comparison,
         *
         * so we hide the value entry.
         */
-       show_value_list = is_comparison;
-       if (is_comparison) {
-               /*
-                * If we're showing the entry; show the label as well.
-                */
-               show_value_label = TRUE;
-       }
 
        switch (hfinfo->type) {
 
index f5bd0db1eeb5cfd46d5fee36cabc9dd50168f754..c0ca337f190ad9b91953b280fa2a03a1caa90b2a 100644 (file)
@@ -206,7 +206,6 @@ dnd_open_file_cmd(gchar *cf_names_freeme)
     int       err;
     gchar     *cf_name;
     int       in_files;
-    gpointer  dialog;
     GString   *dialog_text;
     int       files_work;
     char      **in_filenames;
@@ -270,7 +269,7 @@ dnd_open_file_cmd(gchar *cf_names_freeme)
             g_string_append(dialog_text, "\n");
         }
         g_string_append(dialog_text, "\nThe packets in these files will be merged chronologically into a new temporary file.");
-        dialog = simple_dialog(ESD_TYPE_CONFIRMATION,
+        simple_dialog(ESD_TYPE_CONFIRMATION,
                     ESD_BTN_OK, "%s", 
                     dialog_text->str);
         g_string_free(dialog_text, TRUE);
@@ -322,7 +321,7 @@ GtkSelectionData *selection_data, guint info, guint t _U_, gpointer data _U_)
 #ifdef HAVE_LIBPCAP
         /* if a capture is running, do nothing but warn the user */
         if((global_capture_opts.state != CAPTURE_STOPPED)) {
-            dialog = simple_dialog(ESD_TYPE_CONFIRMATION,
+            simple_dialog(ESD_TYPE_CONFIRMATION,
                         ESD_BTN_OK,
                         "%sDrag and Drop currently not possible!%s\n\n"
                         "Dropping a file isn't possible while a capture is in progress.",
@@ -333,7 +332,7 @@ GtkSelectionData *selection_data, guint info, guint t _U_, gpointer data _U_)
 
         /* if another file read is still in progress, do nothing but warn the user */
         if((cfile.state == FILE_READ_IN_PROGRESS)) {
-            dialog = simple_dialog(ESD_TYPE_CONFIRMATION,
+            simple_dialog(ESD_TYPE_CONFIRMATION,
                         ESD_BTN_OK,
                         "%sDrag and Drop currently not possible!%s\n\n"
                         "Dropping a file isn't possible while loading another capture file.",
index f169f27de1c09a0fd4286f619738ba611ae2bea5..f72ba99ffc7ee2d57d0532a19df0898da193b80c 100644 (file)
@@ -263,7 +263,6 @@ autocompletion_list_lookup(GtkWidget *filter_te, GtkWidget *popup_win, GtkWidget
   GtkRequisition requisition;
   GtkListStore *store;
   GtkTreeIter iter;
-  GtkTreeSelection *selection;
   gchar *curr_str;
   unsigned int str_len = (unsigned int) strlen(str);
   gchar *first = NULL;
@@ -275,8 +274,6 @@ autocompletion_list_lookup(GtkWidget *filter_te, GtkWidget *popup_win, GtkWidget
 
   if( gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter) ) {
 
-    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
-
     do {
 
       gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, 0, &curr_str,  -1);
index 803f8fd9e223e9185f0554f0fc9068fc261cdc18..45ccb57cedce1c2b4789043a1593829d54663e42 100644 (file)
@@ -129,8 +129,7 @@ capture_filter_construct_cb(GtkWidget *w, gpointer user_data _U_)
     parent_filter_te = g_object_get_data(G_OBJECT(w), E_FILT_TE_PTR_KEY);
 
     /* Now create a new dialog, without an "Add Expression..." button. */
-    filter_browse_w = filter_dialog_new(w, parent_filter_te,
-        CFILTER_LIST, &args);
+    filter_dialog_new(w, parent_filter_te, CFILTER_LIST, &args);
 }
 #endif
 
@@ -167,8 +166,7 @@ display_filter_construct_cb(GtkWidget *w, gpointer construct_args_ptr)
 
     /* Now create a new dialog, possibly with an "Apply" button, and
        definitely with an "Add Expression..." button. */
-    filter_browse_w = filter_dialog_new(w, parent_filter_te,
-                                        DFILTER_LIST, construct_args);
+    filter_dialog_new(w, parent_filter_te, DFILTER_LIST, construct_args);
 }
 
 /* Should be called when a button that creates filters is destroyed; it
index f128c4d735575d2a5687adbfa57741e7001ec9f0..16d147d39ef8569243e7093652cfa7fb10918671 100644 (file)
@@ -308,7 +308,6 @@ follow_read_ssl_stream(follow_info_t *follow_info,
                       gboolean (*print_line)(char *, size_t, gboolean, void *),
                       void *arg)
 {
-    int                        iplen;
     guint32            global_client_pos = 0, global_server_pos = 0;
     guint32            server_packet_count = 0;
     guint32            client_packet_count = 0;
@@ -317,8 +316,6 @@ follow_read_ssl_stream(follow_info_t *follow_info,
     GList* cur;
     frs_return_t        frs_return;
 
-    iplen = (follow_info->is_ipv6) ? 16 : 4;
-
     for (cur = follow_info->payload; cur; cur = g_list_next(cur)) {
         SslDecryptedRecord* rec = cur->data;
        skip = FALSE;
index d95c580e2a6d17522705a0e8136c0ce883aa335f..3ccf59c2e4f37ecbeb8af61fcf4de91afee1005a 100644 (file)
@@ -256,7 +256,6 @@ follow_read_udp_stream(follow_info_t *follow_info,
                       gboolean (*print_line)(char *, size_t, gboolean, void *),
                       void *arg)
 {
-       int iplen;
        guint32 global_client_pos = 0, global_server_pos = 0;
        guint32 server_packet_count = 0;
        guint32 client_packet_count = 0;
@@ -267,8 +266,7 @@ follow_read_udp_stream(follow_info_t *follow_info,
        follow_record_t *follow_record;
        char *buffer;
 
-       iplen = (follow_info->is_ipv6) ? 16 : 4;
-    
+
        for (cur = follow_info->payload; cur; cur = g_list_next(cur)) {
                follow_record = cur->data;
                skip = FALSE;
index 50e4a5db4a318618e7d840b28beae65a21c61034..798cd7ef883521882a263b65b6fd26d95fae5ea8 100644 (file)
@@ -219,7 +219,6 @@ font_zoom(char *gui_font_name)
     }
 
     font_name_dup = g_strdup(gui_font_name);
-    font_name_p = font_name_dup;
 
     /* find the start of the font_size string */
     font_name_p = strrchr(font_name_dup, ' ');
index b8a5ee211a1da6606892f8bb6cf5233fa5a9f565..ea6601d03a373a5c1b55ef05144c673af5ff4fae 100644 (file)
@@ -496,10 +496,6 @@ static void save_to_file_destroy_cb(GtkWidget *win _U_, gpointer user_data _U_)
 
 static void overwrite_existing_file_cb(gpointer dialog _U_, gint btn, gpointer user_data)
 {
-       graph_analysis_data_t *user_data_p;
-
-       user_data_p = user_data;
-
        switch(btn) {
        case(ESD_BTN_YES):
            /* overwrite the file*/
@@ -625,7 +621,6 @@ static void dialog_graph_draw(graph_analysis_data_t* user_data)
        guint32 bottom_y_border;
        graph_analysis_item_t *gai;
        guint16 first_conv_num;
-       gboolean several_convs = FALSE;
        gboolean first_packet = TRUE;
 
        GdkGC *frame_fg_color;
@@ -680,7 +675,6 @@ static void dialog_graph_draw(graph_analysis_data_t* user_data)
 
        first_item = user_data->dlg.first_item;
        display_items = draw_height/ITEM_HEIGHT;
-       last_item = first_item+display_items-1;
 
        /* get the items to display and fill the matrix array */
        list = g_list_first(user_data->graph_info->list);
@@ -711,10 +705,6 @@ static void dialog_graph_draw(graph_analysis_data_t* user_data)
                                        first_packet=FALSE;
                                }
 
-                               if (user_data->dlg.items[current_item].conv_num != first_conv_num){
-                                       several_convs = TRUE;
-                               }
-
                                user_data->dlg.items[current_item].src_node = gai->src_node;
                                user_data->dlg.items[current_item].dst_node = gai->dst_node;
                                user_data->dlg.items[current_item].line_style = gai->line_style;
index ab226f9bdd8a6b997c0f5331c962b03f3f7c2aa5..83e2647eb3203994902e6fba637e881ea5d742d9 100644 (file)
@@ -329,7 +329,6 @@ gsm_map_stat_draw(
     int                        i;
     GtkListStore *list_store;
        GtkTreeIter  iter;
-       guint id;
 
     if (dlg.win && tapdata)
     {
@@ -341,7 +340,6 @@ gsm_map_stat_draw(
                        float avrage_bytes_rev;
                        float avrage_bytes_tot;
 
-                       id = gsm_map_opr_code_strings[i].value;
                        if (stat_p->opr_code[i] >0){
                                avrage_bytes_fwd =(float)stat_p->size[i]/(float)stat_p->opr_code[i];
                        }else{
index 142ab255c9fe4a3ec9b9383674ed430b05db0f0a..6258228352dd9eacb6b0ceedda81aa78f2877e2d 100644 (file)
@@ -336,14 +336,11 @@ packet_list_get_path(GtkTreeModel *tree_model, GtkTreeIter *iter)
 {
        GtkTreePath *path;
        PacketListRecord *record;
-       PacketList *packet_list;
 
        g_return_val_if_fail(PACKETLIST_IS_LIST(tree_model), NULL);
        g_return_val_if_fail(iter != NULL, NULL);
        g_return_val_if_fail(iter->user_data != NULL, NULL);
 
-       packet_list = PACKET_LIST(tree_model);
-
        record = (PacketListRecord*) iter->user_data;
 
        path = gtk_tree_path_new();
index d61c335a060b073e84633a704f692920d1c1df10..4924b0ee2ca9f0162de921c8e978540b3a6be26c 100644 (file)
@@ -967,7 +967,6 @@ ifopts_if_liststore_add(void)
 
        /* We have an interface list.                            */
        /* add OS description + interface name text to ListStore */
-       ifl_p = if_list;
        for (ifl_p = if_list; ifl_p != NULL; ifl_p = g_list_next(ifl_p)) {
                /* should never happen, but just in case */
                if ((ifl_p->data) == NULL)
index 510f26888e8a91ddab6136609e4248ea774e7164..8652a33abfc3d628d1427b3cfb427940c1296502 100644 (file)
@@ -296,7 +296,6 @@ profile_apply(GtkWidget *main_w, GtkTreeView *profile_l, gboolean destroy)
   /* First validate all profile names */
   fl1 = g_list_first(edited_profiles);
   while (fl1) {
-    found = FALSE;
     profile1 = (profile_def *) fl1->data;
     g_strstrip(profile1->name);
     if (profile_is_invalid_name(profile1->name)) {
@@ -308,7 +307,6 @@ profile_apply(GtkWidget *main_w, GtkTreeView *profile_l, gboolean destroy)
   /* Then create new and rename changed */
   fl1 = g_list_first(edited_profiles);
   while (fl1) {
-    found = FALSE;
     profile1 = (profile_def *) fl1->data;
     g_strstrip(profile1->name);
     if (profile1->status == PROF_STAT_NEW) {
index c75310d314e65b13c08fed663ae9088b70af46d1..5493236251c31380e7ef54e65c557a4118063e94 100644 (file)
@@ -144,7 +144,6 @@ fill_in_tree_node(GNode *node, gpointer data)
     ph_stats_node_t *stats = node->data;
     draw_info_t     *di = data;
     ph_stats_t      *ps = di->ps;
-    gboolean   is_leaf;
     draw_info_t     child_di;
     double          seconds;
     gchar           *text[NUM_STAT_COLUMNS];
@@ -154,12 +153,6 @@ fill_in_tree_node(GNode *node, gpointer data)
     GtkTreeStore    *store;
     GtkTreeIter      new_iter;
 
-    if (g_node_n_children(node) > 0) {
-        is_leaf = FALSE;
-    } else {
-        is_leaf = TRUE;
-    }
-
     seconds = ps->last_time - ps->first_time;
 
     percent = (float) PCT(stats->num_pkts_total, ps->tot_packets);
index 6135740ec09772a59e49801959de90cf04d31083..37a6d4d2386907a48306548ebe9f0a0222d67f16 100644 (file)
@@ -275,7 +275,6 @@ rtpstream_on_findrev                       (GtkButton       *button _U_,
        }
 
        start_row = gtk_clist_find_row_from_data(GTK_CLIST(clist), pstream);
-       row = start_row+1;
 
        for (row=start_row+1;
                (pstream = gtk_clist_get_row_data(GTK_CLIST(clist), row));
index a1a0cc1530f4587f129cd630121936b992afb4a5..6c0b6d38e913c8fea1574730aa0bd6113e371cd6 100644 (file)
@@ -236,7 +236,6 @@ static void set_supported_text(GtkWidget *w, supported_type_t type)
            if ((len = (int) strlen(filter_name)) > filter_namel)
                    filter_namel = len;
     }
-    maxlen = namel + short_namel + filter_namel;
 
     len = g_snprintf(buffer, BUFF_LEN, proto_supported, count);
     insert_text(w, buffer, len);
@@ -254,7 +253,7 @@ static void set_supported_text(GtkWidget *w, supported_type_t type)
                           -short_namel,  short_name,
                           -namel,        name,
                           -filter_namel, filter_name);
-           insert_text(w, buffer, (int) strlen(buffer));
+           insert_text(w, buffer, len);
     }
 
     break;
@@ -327,7 +326,7 @@ static void set_supported_text(GtkWidget *w, supported_type_t type)
                                             -maxlen2, hfinfo->name,
                                             type_name);
                    }
-                   insert_text(w, buffer, (int) strlen(buffer));
+                   insert_text(w, buffer, len);
            }
     }
     len = g_snprintf(buffer, BUFF_LEN, "\n-- Total %d fields\n", fcount);