(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/sctp_chunk_stat.c) |
| |
| 284 | | | sctpstat_init(const char *optarg, void *userdata _U_) |
| 285 | | | { |
| 286 | | | sctpstat_t *hs; |
| 287 | | | const char *filter=NULL; |
| 288 | | | GString *error_string; |
| 289 | | | GtkWidget *bbox; |
| 290 | | | GtkWidget *close_bt; |
| 291 | | | |
| 292 | | | if(strncmp(optarg,"sctp,stat,",10) == 0){ |
| 293 | | | filter=optarg+10; |
| 294 | | | } else { |
| 295 | | | filter=""; |
| 296 | | | } |
| 297 | | | |
| 298 | | | hs=g_malloc(sizeof(sctpstat_t)); |
| 299 | | | hs->filter=g_strdup(filter); |
| 300 | | | hs->ep_list = NULL; |
| 301 | | | hs->number_of_packets = 0; |
| 302 | | | sctpstat_reset(hs); |
| 303 | | | |
| 304 | | | hs->win=window_new(GTK_WINDOW_TOPLEVEL, "Wireshark: SCTP Chunk Statistics"); |
| 305 | | | gtk_window_set_default_size(GTK_WINDOW(hs->win), 600, 200);
x /usr/include/gtk-2.0/gtk/gtkwindow.h |
| |
42 | #define GTK_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_WINDOW, GtkWindow)) |
| |
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/gtkwindow.h |
| |
41 | #define GTK_TYPE_WINDOW (gtk_window_get_type ()) |
| |
|
| 306 | | | |
| 307 | | | hs->vbox=gtk_vbox_new(FALSE, 3); |
Useless Assignment
This code assigns the variable the same value it already had. |
|
| 308 | | | gtk_container_set_border_width(GTK_CONTAINER(hs->vbox), 12);
x /usr/include/gtk-2.0/gtk/gtkcontainer.h |
| |
42 | #define GTK_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CONTAINER, GtkContainer)) |
| |
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/gtkcontainer.h |
| |
41 | #define GTK_TYPE_CONTAINER (gtk_container_get_type ()) |
| |
|
| 309 | | | |
| 310 | | | init_main_stat_window(hs->win, hs->vbox, "SCTP Chunk Counter", filter); |
| 311 | | | |
| 312 | | | |
| 313 | | | hs->scrolled_window = scrolled_window_new(NULL, NULL); |
| 314 | | | |
| 315 | | | hs->table = create_stat_table(hs->scrolled_window, hs->vbox, 15, titles); |
| 316 | | | |
| 317 | | | error_string=register_tap_listener("sctp", hs, filter, |
| 318 | | | sctpstat_reset, |
| 319 | | | sctpstat_packet, |
| 320 | | | sctpstat_draw); |
| 321 | | | if(error_string){ |
| 322 | | | simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str); |
| 323 | | | g_string_free(error_string, TRUE); |
| 324 | | | g_free(hs->filter); |
| 325 | | | g_free(hs); |
| 326 | | | return; |
| 327 | | | } |
| 328 | | | |
| 329 | | | |
| 330 | | | bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL);
x /usr/include/gtk-2.0/gtk/gtkstock.h |
| |
146 | #define GTK_STOCK_CLOSE "gtk-close" |
| |
|
| 331 | | | gtk_box_pack_end(GTK_BOX(hs->vbox), bbox, FALSE, FALSE, 0);
x /usr/include/gtk-2.0/gtk/gtkbox.h |
| |
42 | #define GTK_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BOX, GtkBox)) |
| |
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/gtkbox.h |
| |
41 | #define GTK_TYPE_BOX (gtk_box_get_type ()) |
| |
|
| 332 | | | |
| 333 | | | close_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLOSE);
x /usr/include/glib-2.0/gobject/gobject.h |
| |
52 | #define G_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_OBJECT, GObject)) |
| |
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/glib-2.0/gobject/gtype.h |
| |
181 | #define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
222 | #define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) |
| |
x /usr/include/gtk-2.0/gtk/gtkstock.h |
| |
146 | #define GTK_STOCK_CLOSE "gtk-close" |
| |
|
| 334 | | | window_set_cancel_button(hs->win, close_bt, window_cancel_button_cb); |
| 335 | | | |
| 336 | | | g_signal_connect(hs->win, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
x /usr/include/glib-2.0/gobject/gsignal.h |
| |
421 | #define g_signal_connect(instance, detailed_signal, c_handler, data) \ |
422 | g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0) |
| |
x /usr/include/glib-2.0/gobject/gclosure.h |
| |
72 | #define G_CALLBACK(f) ((GCallback) (f)) |
| |
|
| 337 | | | g_signal_connect(hs->win, "destroy", G_CALLBACK(win_destroy_cb), hs);
x /usr/include/glib-2.0/gobject/gsignal.h |
| |
421 | #define g_signal_connect(instance, detailed_signal, c_handler, data) \ |
422 | g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0) |
| |
x /usr/include/glib-2.0/gobject/gclosure.h |
| |
72 | #define G_CALLBACK(f) ((GCallback) (f)) |
| |
|
| 338 | | | |
| 339 | | | gtk_widget_show_all(hs->win); |
| 340 | | | window_present(hs->win); |
| 341 | | | |
| 342 | | | cf_retap_packets(&cfile, FALSE); |
| 343 | | | } |
| |