Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings;
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 7 Jun 2011 22:50:49 +0000 (22:50 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 7 Jun 2011 22:50:49 +0000 (22:50 +0000)
Also: whitespace cleanup in some cases.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37601 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/dcerpc_stat.c
gtk/graph_analysis.c
gtk/prefs_dlg.c
gtk/rtp_player.c
gtk/sctp_assoc_analyse.c
gtk/sctp_byte_graph_dlg.c
gtk/sctp_graph_dlg.c
gtk/sctp_stat.c

index 76e2f5d887b86a42f6ca8629d0ba88a3e9b42569..f826a406936c578ca1260c1be54d0dbf34da2332 100644 (file)
@@ -528,7 +528,9 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
        GtkWidget       *filter_box, *filter_bt;
        GtkWidget       *bbox, *start_button, *cancel_button;
         GtkCellRenderer *cell_renderer;
+#if 0
        GtkTreeIter      program_first_item_iter;
+#endif
        const char      *filter;
        int              program_item_index = 0;
 
@@ -609,8 +611,10 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
                        GtkTreeIter tmp_iter;
                        tmp_iter = dcerpcstat_add_program_to_menu(new_uuid_key, new_uuid_value,
                                                                  prog_combo_box, program_item_index);
+#if 0
                        if (program_item_index == 0)
                                program_first_item_iter = tmp_iter;
+#endif
                        program_item_index += 1;
                }
                current_uuid_key   = new_uuid_key;
index 06ba1cb209d30128257f382dcd025e266a499187..ff229363202cae2d9d9b1caae813df84f0eb9888 100644 (file)
@@ -605,8 +605,6 @@ static void dialog_graph_draw(graph_analysis_data_t *user_data)
        guint32 top_y_border;
        guint32 bottom_y_border;
        graph_analysis_item_t *gai;
-       guint16 first_conv_num;
-       gboolean first_packet = TRUE;
 
        GdkGC *frame_fg_color;
        GdkGC *frame_bg_color;
@@ -712,11 +710,6 @@ static void dialog_graph_draw(graph_analysis_data_t *user_data)
                                user_data->dlg.items[current_item].comment = gai->comment;
                                user_data->dlg.items[current_item].conv_num = gai->conv_num;
 
-                               if (first_packet){
-                                       first_conv_num = gai->conv_num;
-                                       first_packet=FALSE;
-                               }
-
                                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;
@@ -727,7 +720,7 @@ static void dialog_graph_draw(graph_analysis_data_t *user_data)
 
                list = g_list_next(list);
        }
-       /* in case the windows is resized so we have to move the top item */
+       /* in case the window is resized we might have to move the top item */
        if ((first_item + display_items) > user_data->num_items){
                if (display_items>user_data->num_items)
                        first_item=0;
@@ -1528,18 +1521,18 @@ static void create_draw_area(graph_analysis_data_t *user_data, GtkWidget *box)
        gtk_widget_set_size_request(user_data->dlg.draw_area_comments, COMMENT_WIDTH, user_data->dlg.pixmap_height);
        scroll_window_comments=gtk_scrolled_window_new(NULL, NULL);
        gtk_widget_set_size_request(scroll_window_comments, (gint)(COMMENT_WIDTH/1.5), user_data->dlg.pixmap_height);
-       /* 
+       /*
         * Set the scrollbar policy for the horizontal and vertical scrollbars
         * The policy determines when the scrollbar should appear
         */
-       gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scroll_window_comments), 
+       gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scroll_window_comments),
                GTK_POLICY_ALWAYS, /* Policy for horizontal bar. */
                GTK_POLICY_NEVER); /* Policy for vertical bar */
 
        /* Changes the type of shadow drawn around the contents of scrolled_window. */
-       gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scroll_window_comments), 
+       gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scroll_window_comments),
                GTK_SHADOW_ETCHED_IN);
-       
+
        viewport_comments = gtk_viewport_new(gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(scroll_window_comments)),
                                             gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(scroll_window_comments)));
        gtk_container_add(GTK_CONTAINER(viewport_comments), user_data->dlg.draw_area_comments);
@@ -1561,11 +1554,11 @@ static void create_draw_area(graph_analysis_data_t *user_data, GtkWidget *box)
        else
                gtk_widget_set_size_request(user_data->dlg.scroll_window, NODE_WIDTH*5, user_data->dlg.pixmap_height);
 
-       gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(user_data->dlg.scroll_window), 
-               GTK_POLICY_ALWAYS, 
+       gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(user_data->dlg.scroll_window),
+               GTK_POLICY_ALWAYS,
                GTK_POLICY_NEVER);
 
-       gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(user_data->dlg.scroll_window), 
+       gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(user_data->dlg.scroll_window),
                GTK_SHADOW_ETCHED_IN);
        viewport = gtk_viewport_new(gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(user_data->dlg.scroll_window)),
                                    gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(user_data->dlg.scroll_window)));
index d542ac46fef42249e115fcaa758195ff8d264470..0503a70dda2620b4469cd68c5323da278dcc32cb 100644 (file)
@@ -246,7 +246,7 @@ pref_show(pref_t *pref, gpointer user_data)
                                           pref->varp.uat);
     break;
   }
+
   case PREF_OBSOLETE:
     g_assert_not_reached();
     break;
@@ -294,7 +294,7 @@ module_prefs_show(module_t *module, gpointer user_data)
   model = GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(cts->tree)));
   if (prefs_module_has_submodules(module) && !cts->iter.stamp)
     gtk_tree_store_append(model, &iter, NULL);
-  else 
+  else
     gtk_tree_store_append(model, &iter, &cts->iter);
 
   /*
@@ -319,7 +319,7 @@ module_prefs_show(module_t *module, gpointer user_data)
     /* keep the page count right */
     cts->page = child_cts.page;
 
-  } 
+  }
   if(module->prefs) {
     /*
      * Has preferences.  Create a notebook page for it.
@@ -367,7 +367,7 @@ module_prefs_show(module_t *module, gpointer user_data)
   } else {
     /* show the protocols page */
 
-    gtk_tree_store_set(model, &iter, 0, label_str, 1, protocols_page, -1);  
+    gtk_tree_store_set(model, &iter, 0, label_str, 1, protocols_page, -1);
 
   }
 
@@ -538,7 +538,7 @@ prefs_page_cb(GtkWidget *w _U_, gpointer dummy _U_, PREFS_PAGE_E prefs_page)
      only work if the widget and it's corresponding window is already shown
      (so don't put the following into gui_font_prefs_show()) !!! */
 
-  /* We set the current font now, because setting it appears not to work 
+  /* We set the current font now, because setting it appears not to work
      when run before appending the frame to the notebook. */
 
   gtk_font_selection_set_font_name(
@@ -925,7 +925,6 @@ pref_check(pref_t *pref, gpointer user_data)
 {
   const char *str_val;
   char *p;
-  guint uval;
   pref_t **badpref = user_data;
 
   /* Fetch the value of the preference, and check whether it's valid. */
@@ -933,7 +932,7 @@ pref_check(pref_t *pref, gpointer user_data)
 
   case PREF_UINT:
     str_val = gtk_entry_get_text(GTK_ENTRY(pref->control));
-    uval = strtoul(str_val, &p, pref->info.base);
+    strtoul(str_val, &p, pref->info.base);
     if (p == str_val || *p != '\0') {
       *badpref = pref;
       return PREFS_SET_SYNTAX_ERR;      /* number was bad */
@@ -1673,7 +1672,7 @@ module_search_properties(module_t *module, gpointer user_data)
     p->module = module;
     return 1;   /* stops the search */
   }
-  
+
   if(prefs_module_has_submodules(module))
     return prefs_modules_foreach_submodules(module, module_search_properties, p);
 
index bd66a4a74fdc1a2d38581734229d10c491dfb9db..2fcc50800064fd4da5c86a669b6fdc3c29dce2c0 100644 (file)
@@ -594,14 +594,18 @@ decode_rtp_stream(rtp_stream_info_t *rsi, gpointer ptr _U_)
        double start_rtp_time = 0;
        double diff;
        double pack_period;
+#ifdef DEBUG /* ?? */
        double total_time;
        double total_time_prev;
+#endif
        gint32 silence_frames;
        int seq;
        double delay;
        double prev_diff;
+#ifdef DEBUG /* ?? */
        double mean_delay;
        double variation;
+#endif
        int decoded_bytes;
        int decoded_bytes_prev;
        int jitter_buff;
@@ -687,13 +691,17 @@ decode_rtp_stream(rtp_stream_info_t *rsi, gpointer ptr _U_)
        arrive_time = start_time = 0;
        arrive_time_prev = 0;
        pack_period = 0;
+#ifdef DEBUG /* ?? */
        total_time = 0;
        total_time_prev = 0;
+#endif
        seq = 0;
        delay = 0;
        prev_diff = 0;
+#ifdef DEBUG /* ?? */
        mean_delay = 0;
        variation = 0;
+#endif
        start_timestamp = 0;
        decoders_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, rtp_decoder_value_destroy);
 
@@ -758,8 +766,8 @@ decode_rtp_stream(rtp_stream_info_t *rsi, gpointer ptr _U_)
 
                if (diff<0) diff = -diff;
 
-               total_time = (double)rp->arrive_offset/1000;
 #ifdef DEBUG
+               total_time = (double)rp->arrive_offset/1000;
                printf("seq = %d arr = %f abs_diff = %f index = %d tim = %f ji=%d jb=%f\n",rp->info->info_seq_num,
                        total_time, diff, rci->samples->len, ((double)rci->samples->len/8000 - total_time)*1000, 0,
                                (mean_delay + 4*variation)*1000);
@@ -874,7 +882,7 @@ stop_channels(void)
        GtkWidget *dialog;
 
        /* we should never be here if we are already in STOP */
-       g_assert(rtp_channels->stop == FALSE); 
+       g_assert(rtp_channels->stop == FALSE);
 
        rtp_channels->stop = TRUE;
        /* force a draw_cursor to stop it */
index a639e9f821252cb5dc112d963414380142337db6..a7a3a71119b6894cb46f8ce157a5fdd5e3fdab03 100644 (file)
@@ -187,7 +187,6 @@ void
 update_analyse_dlg(struct sctp_analyse* u_data)
 {
        gchar label_txt[50];
-       gchar *data[1];
        gchar field[1][MAX_ADDRESS_LEN];
        GList *list;
        address *store = NULL;
@@ -241,7 +240,6 @@ update_analyse_dlg(struct sctp_analyse* u_data)
                list = g_list_first(u_data->assoc->addr1);
                while (list)
                {
-                       data[0] = &field[0][0];
                        store = (address *) (list->data);
                        if (store->type == AT_IPv4)
                        {
@@ -254,12 +252,13 @@ update_analyse_dlg(struct sctp_analyse* u_data)
                        list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW (u_data->analyse_nb->page2->clist))); /* Get store */
 
 #if GTK_CHECK_VERSION(2,6,0)
-               gtk_list_store_insert_with_values( list_store , &iter, G_MAXINT,
+                       gtk_list_store_insert_with_values( list_store , &iter, G_MAXINT,
+                                                          0,   field[0], -1);
 #else
-               gtk_list_store_append  (list_store, &iter);
-               gtk_list_store_set  (list_store, &iter,
+                       gtk_list_store_append  (list_store, &iter);
+                       gtk_list_store_set  (list_store, &iter,
+                                            0, field[0], -1);
 #endif
-                       0,      field[0], -1);
                        list = g_list_next(list);
                }
        }
@@ -305,7 +304,6 @@ update_analyse_dlg(struct sctp_analyse* u_data)
 
                while (list)
                {
-                       data[0] = &field[0][0];
                        store = (address *) (list->data);
                        if (store->type == AT_IPv4)
                        {
@@ -318,12 +316,13 @@ update_analyse_dlg(struct sctp_analyse* u_data)
                        list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW (u_data->analyse_nb->page3->clist))); /* Get store */
 
 #if GTK_CHECK_VERSION(2,6,0)
-               gtk_list_store_insert_with_values( list_store , &iter, G_MAXINT,
+                       gtk_list_store_insert_with_values( list_store , &iter, G_MAXINT,
+                                                          0,   field[0], -1);
 #else
-               gtk_list_store_append  (list_store, &iter);
-               gtk_list_store_set  (list_store, &iter,
+                       gtk_list_store_append  (list_store, &iter);
+                       gtk_list_store_set  (list_store, &iter,
+                                            0, field[0], -1);
 #endif
-                       0,      field[0], -1);
                        list = g_list_next(list);
                }
        }
@@ -482,11 +481,11 @@ GtkWidget *create_list(void)
        GtkCellRenderer *renderer;
        GtkTreeView *list_view;
        list_store = gtk_list_store_new(1,
-               G_TYPE_STRING /* IP address */
-                       );
+                                       G_TYPE_STRING /* IP address */
+               );
 
-    /* Create a view */
-    list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
+       /* Create a view */
+       list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
 
        list_view = GTK_TREE_VIEW(list);
 
@@ -495,24 +494,24 @@ GtkWidget *create_list(void)
        gtk_tree_view_set_fixed_height_mode(list_view, TRUE);
 #endif
 
-    /* The view now holds a reference.  We can get rid of our own reference */
-    g_object_unref (G_OBJECT (list_store));
+       /* The view now holds a reference.  We can get rid of our own reference */
+       g_object_unref (G_OBJECT (list_store));
 
-    /*
-     * Create the first column packet, associating the "text" attribute of the
-     * cell_renderer to the first column of the model
-     */
-       renderer = gtk_cell_renderer_text_new ();
-    column = gtk_tree_view_column_new_with_attributes ("Address", renderer,
-               "text", 0,
-               NULL);
+       /*
+        * Create the first column packet, associating the "text" attribute of the
+        * cell_renderer to the first column of the model
+        */
+       renderer = gtk_cell_renderer_text_new ();
+       column = gtk_tree_view_column_new_with_attributes ("Address", renderer,
+                                                          "text",      0,
+                                                          NULL);
 
-    gtk_tree_view_column_set_resizable(column, TRUE);
-    gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
-    gtk_tree_view_column_set_min_width(column, 300);
+       gtk_tree_view_column_set_resizable(column, TRUE);
+       gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
+       gtk_tree_view_column_set_min_width(column, 300);
 
        /* Add the column to the view. */
-    gtk_tree_view_append_column (list_view, column);
+       gtk_tree_view_append_column (list_view, column);
 
        gtk_tree_view_set_headers_visible(list_view, FALSE);
        return list;
@@ -865,8 +864,6 @@ void assoc_analyse(sctp_assoc_info_t* assoc)
 
 static void sctp_analyse_cb(struct sctp_analyse* u_data, gboolean ext)
 {
-       guint16 srcport;
-       guint16 dstport;
        GList *list, *framelist;
        dfilter_t *sfcode;
        capture_file *cf;
@@ -909,8 +906,6 @@ static void sctp_analyse_cb(struct sctp_analyse* u_data, gboolean ext)
                return;
        }
 
-       srcport = edt.pi.srcport;
-       dstport = edt.pi.destport;
        list = g_list_first(sctp_stat_get_info()->assoc_info_list);
 
        while (list)
index f81b1bf71dd42b4fc440710f025afebd3badf805..88e6fe9e3a9723de3c6f55e9ba672087b045d08d 100644 (file)
@@ -626,10 +626,8 @@ static void
 sctp_graph_close_cb(GtkWidget* widget _U_, gpointer u_data)
 {
        struct sctp_udata *udata;
-       int dir;
 
        udata = (struct sctp_udata *)u_data;
-       dir = udata->dir - 1;
        gtk_grab_remove(GTK_WIDGET(udata->io->window));
        gtk_widget_destroy(GTK_WIDGET(udata->io->window));
 }
@@ -1116,7 +1114,6 @@ static void
 gtk_sctpgraph_init(struct sctp_udata *u_data)
 {
        sctp_graph_t *io;
-       gint dir;
        sctp_min_max_t* tmp_minmax;
 
        io=g_malloc(sizeof(sctp_graph_t));
@@ -1128,7 +1125,6 @@ gtk_sctpgraph_init(struct sctp_udata *u_data)
        io->pixmap_width=800;
        io->pixmap_height=600;
        io->graph_type=0;
-       dir=u_data->dir-1;
        u_data->io=io;
 
 
index 5a046ed380ab50c4815165072e0b91d7b789a194..d06c80ab4e3ee23d9b96a45208c22b5891e3891b 100644 (file)
@@ -154,7 +154,7 @@ draw_sack_graph(struct sctp_udata *u_data)
        GdkGC *red_gc, *green_gc, *cyan_gc;
        struct sack_chunk_header *sack_header;
        struct gaps *gap;
-       guint32 max_num, diff;
+       guint32 /*max_num,*/ diff;
        guint32 *dup_list;
 
        red_gc = gdk_gc_new(u_data->io->draw_area->window);
@@ -221,7 +221,7 @@ draw_sack_graph(struct sctp_udata *u_data)
                                                {
                                                        gap_start=g_ntohs(gap->start);
                                                        gap_end = g_ntohs(gap->end);
-                                                       max_num=gap_end+tsnumber;
+                                                       /* max_num=gap_end+tsnumber; */
                                                        for (j=gap_start; j<=gap_end; j++)
                                                        {
                                                                if (u_data->io->uoff)
@@ -243,8 +243,10 @@ draw_sack_graph(struct sctp_udata *u_data)
                                                                gap++;
                                                }
                                        }
+                                       /*
                                        else
                                                max_num=tsnumber;
+                                       */
                                        if (tsnumber>=min_tsn)
                                        {
                                                if (u_data->io->uoff)
@@ -321,7 +323,7 @@ draw_nr_sack_graph(struct sctp_udata *u_data)
        GdkGC *red_gc, *blue_gc, *green_gc;
        struct nr_sack_chunk_header *nr_sack_header;
        struct gaps *nr_gap;
-       guint32 max_num, diff;
+       guint32 /*max_num,*/ diff;
        /* This holds the sum of gap acks and nr gap acks */
        guint16 total_gaps = 0;
 
@@ -391,7 +393,7 @@ draw_nr_sack_graph(struct sctp_udata *u_data)
                                                {
                                                        gap_start=g_ntohs(nr_gap->start);
                                                        gap_end = g_ntohs(nr_gap->end);
-                                                       max_num= gap_end + tsnumber;
+                                                       /* max_num= gap_end + tsnumber; */
                                                        for ( j = gap_start; j <= gap_end; j++)
                                                        {
                                                                if (u_data->io->uoff)
@@ -439,9 +441,10 @@ draw_nr_sack_graph(struct sctp_udata *u_data)
                                                                nr_gap++;
                                                }
                                        }
+                                       /*
                                        else
                                                max_num=tsnumber;
-
+                                       */
                                        if (tsnumber>=min_tsn)
                                        {
                                                if (u_data->io->uoff)
@@ -1459,7 +1462,6 @@ static void
 gtk_sctpgraph_init(struct sctp_udata *u_data)
 {
        sctp_graph_t *io;
-       gint dir;
        sctp_min_max_t* tmp_minmax;
 
        io=g_malloc(sizeof(sctp_graph_t));
@@ -1471,7 +1473,6 @@ gtk_sctpgraph_init(struct sctp_udata *u_data)
        io->pixmap_width=800;
        io->pixmap_height=600;
        io->graph_type=0;
-       dir=u_data->dir-1;
        u_data->io=io;
        u_data->io->x1_tmp_sec=u_data->assoc->min_secs;
        u_data->io->x1_tmp_usec=u_data->assoc->min_usecs;
index 16359fea9ff08e6a221c10d4eaf6bffa565ff738..f547febebcdc5519d049e0e1f8cf15afc5ade4f3 100644 (file)
@@ -529,7 +529,6 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
        sctp_tmp_info_t tmp_info;
        sctp_assoc_info_t *info = NULL;
        sctp_error_info_t *error = NULL;
-       char str[200];
        guint16 type, length;
        address *store = NULL;
        tsn_t   *tsn = NULL;
@@ -537,17 +536,12 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
        guint8  *t_s_n = NULL;
        gboolean sackchunk = FALSE;
        gboolean datachunk = FALSE;
-       guint32 max;
        struct tsn_sort *tsn_s;
        guint8* addr = NULL;
        int i;
        guint8 idx = 0;
 
-       sctp_allassocs_info_t *assoc_info=NULL;
-       assoc_info = &sctp_tapinfo_struct;
-
        sctp_info = (struct _sctp_info *) data;
-       max =0xFFFFFFFF;
 
        framenumber=pinfo->fd->num;
 
@@ -930,7 +924,6 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
                        {
                                error = g_malloc(sizeof(sctp_error_info_t));
                                error->frame_number = pinfo->fd->num;
-                               str[0] = '\0';
                                error->chunk_info[0] = '\0';
                                if ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID)
                                        g_strlcpy(error->chunk_info, val_to_str(tvb_get_guint8(sctp_info->tvb[0],0),chunk_type_values,"Reserved"), 200);