Text   |  XML   |  ReML   |   Visible Warnings:

Redundant Condition  at dcerpc_stat.c:603

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

gtk_dcerpcstat_cb

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/dcerpc_stat.c)expand/collapse
Show more  
 546  gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
 547  {
 548          GtkWidget *dlg_box;
 549          GtkWidget *prog_box, *prog_label, *prog_opt;
 550          GtkWidget *vers_label;
 551          GtkWidget *filter_box, *filter_bt;
 552          GtkWidget *bbox, *start_button, *cancel_button;
 553          const char *filter;
 554          static construct_args_t args = {
 555            "Service Response Time Statistics Filter",
 556            FALSE,
 557            FALSE,
 558            FALSE 
 559          };
 560   
 561          /* if the window is already open, bring it to front and 
 562             un-minimize it, as necessary */
 563          if(dlg){
 564                  reactivate_window(dlg);
 565                  return;
 566          }
 567   
 568          dlg=dlg_window_new("Wireshark: Compute DCE-RPC SRT statistics");
 569          gtk_window_set_default_size(GTK_WINDOW(dlg), 400, -1);
 570   
 571          dlg_box=gtk_vbox_new(FALSE, 10);
 572          gtk_container_set_border_width(GTK_CONTAINER(dlg_box), 10);
 573          gtk_container_add(GTK_CONTAINER(dlg), dlg_box);
 574          gtk_widget_show(dlg_box);
 575   
 576          /* Program box */
 577          prog_box=gtk_hbox_new(FALSE, 3);
 578   
 579          /* Program label */
 580          gtk_container_set_border_width(GTK_CONTAINER(prog_box), 10);
 581          prog_label=gtk_label_new("Program:");
 582          gtk_box_pack_start(GTK_BOX(prog_box), prog_label, FALSE, FALSE, 0);
 583          gtk_widget_show(prog_label);
 584   
 585          /* Program menu */
 586          prog_opt=gtk_option_menu_new();
 587          prog_menu=gtk_menu_new();
 588          current_uuid_key=NULL;
 589          current_uuid_value=NULL;
 590  /*qqq*/
 591          program_submenu_item=NULL;
 592          program_submenu_menu=NULL;
 593          program_subitem_index=0;
 594          do {
 595                  new_uuid_key=NULL;
 596                  new_uuid_value=NULL;
 597                  g_hash_table_foreach(dcerpc_uuids, (GHFunc)dcerpcstat_find_next_program, NULL);
 598                  if(new_uuid_key){
 599                          dcerpcstat_add_program_to_menu(new_uuid_key, new_uuid_value);
 600                  }
 601                  current_uuid_key=new_uuid_key;
 602                  current_uuid_value=new_uuid_value;
 603          } while(new_uuid_key!=NULL);
 604   
 605          gtk_option_menu_set_menu(GTK_OPTION_MENU(prog_opt), prog_menu);
 606          gtk_box_pack_start(GTK_BOX(prog_box), prog_opt, TRUE, TRUE, 0);
 607          gtk_widget_show(prog_opt);
 608   
 609          /* Version label */
 610          gtk_container_set_border_width(GTK_CONTAINER(prog_box), 10);
 611          vers_label=gtk_label_new("Version:");
 612          gtk_box_pack_start(GTK_BOX(prog_box), vers_label, FALSE, FALSE, 0);
 613          gtk_widget_show(vers_label);
 614   
 615          /* Version menu */
 616          vers_opt=gtk_option_menu_new();
 617          vers_menu=gtk_menu_new();
 618          dcerpc_version=0xffff;
 619          g_hash_table_foreach(dcerpc_uuids, (GHFunc)dcerpcstat_find_vers, NULL);
 620          gtk_option_menu_set_menu(GTK_OPTION_MENU(vers_opt), vers_menu);
 621          gtk_box_pack_start(GTK_BOX(prog_box), vers_opt, TRUE, TRUE, 0);
 622          gtk_widget_show(vers_opt);
 623   
 624          gtk_box_pack_start(GTK_BOX(dlg_box), prog_box, TRUE, TRUE, 0);
 625          gtk_widget_show(prog_box);
 626   
 627          /* Filter box */
 628          filter_box=gtk_hbox_new(FALSE, 3);
 629   
 630          /* Filter label */
 631          filter_bt=gtk_button_new_from_stock(WIRESHARK_STOCK_DISPLAY_FILTER_ENTRY);
 632          g_signal_connect(filter_bt, "clicked", G_CALLBACK(display_filter_construct_cb), &args);
 633          gtk_box_pack_start(GTK_BOX(filter_box), filter_bt, FALSE, FALSE, 0);
 634          gtk_widget_show(filter_bt);
 635   
 636          /* Filter entry */
 637          filter_entry=gtk_entry_new();
 638          g_signal_connect(filter_entry, "changed", G_CALLBACK(filter_te_syntax_check_cb), NULL);
 639          g_object_set_data(G_OBJECT(filter_box), E_FILT_AUTOCOMP_PTR_KEY, NULL);
 640          g_signal_connect(filter_entry, "key-press-event", G_CALLBACK (filter_string_te_key_pressed_cb), NULL);
 641          g_signal_connect(dlg, "key-press-event", G_CALLBACK (filter_parent_dlg_key_pressed_cb), NULL);
 642          gtk_box_pack_start(GTK_BOX(filter_box), filter_entry, TRUE, TRUE, 0);
 643          filter=gtk_entry_get_text(GTK_ENTRY(main_display_filter_widget));
 644          if(filter){
 645                  gtk_entry_set_text(GTK_ENTRY(filter_entry), filter);
 646          } else {
 647                  colorize_filter_te_as_empty(filter_entry);
 648          }
 649          gtk_widget_show(filter_entry);
 650   
 651          gtk_box_pack_start(GTK_BOX(dlg_box), filter_box, TRUE, TRUE, 0);
 652          gtk_widget_show(filter_box);
 653   
 654          g_object_set_data(G_OBJECT(filter_bt), E_FILT_TE_PTR_KEY, filter_entry);
 655   
 656          /* button box */
 657          bbox = dlg_button_row_new(WIRESHARK_STOCK_CREATE_STAT, GTK_STOCK_CANCEL, NULL);
 658          gtk_box_pack_start(GTK_BOX(dlg_box), bbox, FALSE, FALSE, 0);
 659          gtk_widget_show(bbox);
 660   
 661          start_button = g_object_get_data(G_OBJECT(bbox), WIRESHARK_STOCK_CREATE_STAT);
 662          g_signal_connect_swapped(start_button, "clicked",
 663                                G_CALLBACK(dcerpcstat_start_button_clicked), NULL);
 664   
 665          cancel_button = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CANCEL);
 666          window_set_cancel_button(dlg, cancel_button, window_cancel_button_cb);
 667   
 668          g_signal_connect(dlg, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
 669          g_signal_connect(dlg, "destroy", dlg_destroy_cb, NULL);
 670   
 671          /* Catch the "activate" signal on the filter text entry, so that
 672             if the user types Return there, we act as if the "Create Stat"
 673             button had been selected, as happens if Return is typed if some
 674             widget that *doesn't* handle the Return key has the input 
 675             focus. */
 676          dlg_set_activate(filter_entry, start_button);
 677   
 678          gtk_widget_grab_default(start_button );
 679   
 680          /* Give the initial focus to the "Filter" entry box. */
 681          gtk_widget_grab_focus(filter_entry);
 682   
 683          gtk_widget_show_all(dlg);
 684          window_present(dlg);
 685  }
Show more  




Change Warning 4353.30060 : Redundant Condition

Priority:
State:
Finding:
Owner:
Note: