Text   |  XML   |  ReML   |   Visible Warnings:

Redundant Condition  at color_edit_dlg.c:468

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

color_sel_win_new

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/color_edit_dlg.c)expand/collapse
Show more  
 443  static GtkWidget*
 444  color_sel_win_new(color_filter_t *colorf, gboolean is_bg)
 445  {
 446    gchar *title;
 447    GtkWidget *color_sel_win;
 448    color_t   *color;
 449    GdkColor   gcolor;
 450    GtkWidget *color_sel_ok;
 451    GtkWidget *color_sel_cancel;
 452    GtkWidget *color_sel_help;
 453   
 454    if (is_bg) {
 455      color = &colorf->bg_color;
 456      title = g_strdup_printf("Wireshark: Choose background color for \"%s\"",
 457          colorf->filter_name);
 458    } else {
 459      color = &colorf->fg_color;
 460      title = g_strdup_printf("Wireshark: Choose foreground color for \"%s\"",
 461          colorf->filter_name);
 462    }
 463    color_sel_win = gtk_color_selection_dialog_new(title);
 464    g_free(title);
 465    g_object_set_data(G_OBJECT(color_sel_win), "color_sel_win", color_sel_win);
 466    gtk_container_set_border_width (GTK_CONTAINER (color_sel_win), 10);
 467   
 468    if (color != NULL) {
 469      color_t_to_gdkcolor(&gcolor, color);
 470      gtk_color_selection_set_current_color(
 471                      GTK_COLOR_SELECTION(
 472                              GTK_COLOR_SELECTION_DIALOG(color_sel_win)->colorsel), &gcolor);
 473    }
 474   
 475    color_sel_ok = GTK_COLOR_SELECTION_DIALOG (color_sel_win)->ok_button;
 476    g_object_set_data(G_OBJECT(color_sel_win), "color_sel_ok", color_sel_ok);
 477    GTK_WIDGET_SET_FLAGS (color_sel_ok, GTK_CAN_DEFAULT);
 478   
 479    color_sel_cancel = GTK_COLOR_SELECTION_DIALOG (color_sel_win)->cancel_button;
 480    g_object_set_data(G_OBJECT(color_sel_win), "color_sel_cancel", color_sel_cancel);
 481    GTK_WIDGET_SET_FLAGS (color_sel_cancel, GTK_CAN_DEFAULT);
 482    window_set_cancel_button(color_sel_win, color_sel_cancel, NULL); /* ensure esc does req'd local cxl action.    */
 483                                                                     /* esc as handled by the                      */
 484                                                                     /* gtk_color_selection_dialog widget          */
 485                                                                     /*  doesn't result in this happening.         */
 486   
 487    color_sel_help = GTK_COLOR_SELECTION_DIALOG (color_sel_win)->help_button;
 488    g_object_set_data(G_OBJECT(color_sel_win), "color_sel_help", color_sel_help);
 489   
 490   
 491    GTK_WIDGET_SET_FLAGS (color_sel_help, GTK_CAN_DEFAULT);
 492   
 493    g_signal_connect(color_sel_ok, "clicked", G_CALLBACK(color_sel_ok_cb), color_sel_win);
 494    g_signal_connect(color_sel_cancel, "clicked", G_CALLBACK(color_sel_cancel_cb), color_sel_win);
 495   
 496    gtk_widget_show_all(color_sel_win);
 497    return color_sel_win;
 498  }
Show more  




Change Warning 4021.29817 : Redundant Condition

Priority:
State:
Finding:
Owner:
Note: