(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/proto_hier_stats_dlg.c) |
| |
| 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; |
Unused Value
The value assigned to is_leaf is never subsequently used on any execution path. |
|
| 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));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/proto_hier_stats_dlg.c |
| |
67 | #define BANDWITDH(bytes,secs) ((bytes) * 8.0 / ((secs) * 1000.0 * 1000.0)) |
| |
|
| 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));
x /home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/proto_hier_stats_dlg.c |
| |
67 | #define BANDWITDH(bytes,secs) ((bytes) * 8.0 / ((secs) * 1000.0 * 1000.0)) |
| |
|
| 182 | | | } else { |
| 183 | | | text[7] = "n.c."; |
| 184 | | | } |
| 185 | | | |
| 186 | | | store = GTK_TREE_STORE(gtk_tree_view_get_model(tree_view));
x /usr/include/gtk-2.0/gtk/gtktreestore.h |
| |
37 | #define GTK_TREE_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_STORE, GtkTreeStore)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/gtk-2.0/gtk/gtktreestore.h |
| |
36 | #define GTK_TYPE_TREE_STORE (gtk_tree_store_get_type ()) |
| |
|
| 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 | | | } |
| |