Text   |  XML   |  ReML   |   Visible Warnings:

Useless Assignment  at dfilter_expr_dlg.c:470

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

display_value_fields

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/dfilter_expr_dlg.c)expand/collapse
Show more  
 425  display_value_fields(header_field_info *hfinfo, gboolean is_comparison,
 426                       GtkWidget *value_label, GtkWidget *value_entry,
 427                       GtkWidget *value_list_label,
 428                       GtkWidget  *value_list _U_,
 429                       GtkWidget *value_list_scrolled_win, GtkWidget *range_label,
 430                       GtkWidget *range_entry)
 431  {
 432          gboolean show_value_label = FALSE;
 433          gboolean show_value_list = FALSE;
 434          gboolean show_range = FALSE;
 435   
 436          /*
 437           * Either:
 438           *
 439           *      this is an FT_NONE variable, in which case you can 
 440           *      only check whether it's present or absent in the 
 441           *      protocol tree 
 442           *
 443           * or 
 444           *
 445           *      this is a Boolean variable, in which case you
 446           *      can't specify a value to compare with, you can
 447           *      only specify whether to test for the Boolean 
 448           *      being true or to test for it being false
 449           *
 450           * or 
 451           *
 452           *      this isn't a Boolean variable, in which case you
 453           *      can test for its presence in the protocol tree,
 454           *      and the default relation is such a test, in 
 455           *      which case you don't compare with a value
 456           *
 457           * so we hide the value entry.
 458           */
 459          show_value_list = is_comparison;
 460          if (is_comparison) {
 461                  /*
 462                   * If we're showing the entry; show the label as well.
 463                   */
 464                  show_value_label = TRUE;
 465          }
 466   
 467          switch (hfinfo->type) {
 468   
 469          case FT_BOOLEAN:
 470                  show_value_list = is_comparison;
 471                  if (is_comparison) {
 472                          /*
 473                           * If we're showing the value list; show the label as well.
 474                           */
 475                          show_value_label = TRUE;
 476                  }
 477                  break;
 478   
 479          case FT_UINT8:
 480          case FT_UINT16:
 481          case FT_UINT24:
 482          case FT_UINT32:
 483          case FT_INT8:
 484          case FT_INT16:
 485          case FT_INT24:
 486          case FT_INT32:
 487                  if (hfinfo->strings != NULL) {
 488                          /*
 489                           * We have a list of values to show.
 490                           */
 491   
 492                          show_value_list = is_comparison;
 493                          if (is_comparison) {
 494                                  /*
 495                                   * We're showing the entry; show the label 
 496                                   * as well.
 497                                   */
 498                                  show_value_label = TRUE;
 499                          }
 500                  } else {
 501                          /*
 502                           * There is no list of names for values, so don't
 503                           * show it.
 504                           */
 505                          show_value_list = FALSE;
 506                  }
 507                  break;
 508   
 509          default:
 510                  /*
 511                   * There is no list of names for values; hide the list.
 512                   */
 513                  show_value_list = FALSE;
 514                  break;
 515          }
 516   
 517          gtk_widget_set_sensitive(value_label,               show_value_label);
 518          gtk_widget_set_sensitive(value_entry,               show_value_label);
 519   
 520          gtk_widget_set_sensitive(value_list_label,          show_value_list);
 521          gtk_widget_set_sensitive(value_list_scrolled_win,   show_value_list);
 522   
 523          /*
 524           * Is this a comparison, and are ranges supported by this type?
 525           * If both are true, show the range stuff, otherwise hide it.
 526           */
 527          show_range = (is_comparison && ftype_can_slice(hfinfo->type));
 528          gtk_widget_set_sensitive(range_label, show_range);
 529          gtk_widget_set_sensitive(range_entry, show_range);
 530  }
Show more  




Change Warning 4049.29694 : Useless Assignment

Because they are very similar, this warning shares annotations with warning 4049.29697.

Priority:
State:
Finding:
Owner:
Note: