Text   |  XML   |  ReML   |   Visible Warnings:

Unused Value  at proto_hier_stats_dlg.c:160

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

fill_in_tree_node

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/proto_hier_stats_dlg.c)expand/collapse
Show more  
 142  fill_in_tree_node(GNode *node, gpointer data)
 143  {
 144      ph_stats_node_t *stats = node->data;
 145      draw_info_t     *di = data;
 146      ph_stats_t      *ps = di->ps;
 147      gboolean    is_leaf;
 148      draw_info_t     child_di;
 149      double          seconds;
 150      gchar           *text[NUM_STAT_COLUMNS];
 151      float           percent;
 152      GtkTreeView     *tree_view = di->tree_view;
 153      GtkTreeIter     *iter = di->iter;
 154      GtkTreeStore    *store;
 155      GtkTreeIter      new_iter;
 156   
 157      if (g_node_n_children(node) > 0) {
 158          is_leaf = FALSE;
 159      } else {
 160          is_leaf = TRUE;
 161      }
 162   
 163      seconds = ps->last_time - ps->first_time;
 164   
 165      percent = (float) PCT(stats->num_pkts_total, ps->tot_packets);
 166      text[0] = (gchar *) (stats->hfinfo->name);
 167      text[1] = g_strdup_printf("%.2f %%", percent);
 168                                 
 169      text[2] = g_strdup_printf("%u", stats->num_pkts_total);
 170      text[3] = g_strdup_printf("%u", stats->num_bytes_total);
 171      if (seconds > 0.0) {
 172          text[4] = g_strdup_printf("%.3f",  
 173                                    BANDWITDH(stats->num_bytes_total, seconds));
 174      } else {
 175          text[4] = "n.c.";
 176      }
 177      text[5] = g_strdup_printf("%u", stats->num_pkts_last);
 178      text[6] = g_strdup_printf("%u", stats->num_bytes_last);
 179      if (seconds > 0.0) {
 180          text[7] = g_strdup_printf("%.3f",  
 181                                    BANDWITDH(stats->num_bytes_last, seconds));
 182      } else {
 183          text[7] = "n.c.";
 184      }
 185   
 186      store = GTK_TREE_STORE(gtk_tree_view_get_model(tree_view));
 187      gtk_tree_store_append(store, &new_iter, iter);
 188      gtk_tree_store_set(store, &new_iter,
 189                         PROTOCOL_COLUMN, text[0],
 190                         PRCT_PKTS_COLUMN, text[1],
 191                         PKTS_COLUMN, text[2],
 192                         BYTES_COLUMN, text[3],
 193                         BANDWIDTH_COLUMN, text[4],
 194                         END_PKTS_COLUMN, text[5],
 195                         END_BYTES_COLUMN, text[6],
 196                         END_BANDWIDTH_COLUMN, text[7],
 197                         FILTER_NAME, stats->hfinfo->abbrev,
 198                         PRCT_PKTS_VALUE_COLUMN, percent,
 199                         -1);
 200   
 201      g_free(text[1]);
 202      g_free(text[2]);
 203      g_free(text[3]);
 204      if (seconds > 0.0) g_free(text[4]);
 205      g_free(text[5]);
 206      g_free(text[6]);
 207      if (seconds > 0.0) g_free(text[7]);
 208   
 209      child_di.tree_view = tree_view;
 210      child_di.iter = &new_iter;
 211      child_di.ps = ps;
 212   
 213      g_node_children_foreach(node, G_TRAVERSE_ALL,
 214                              fill_in_tree_node, &child_di);
 215  }
Show more  




Change Warning 4252.29568 : Unused Value

Priority:
State:
Finding:
Owner:
Note: