Text   |  XML   |  ReML   |   Visible Warnings:

Useless Assignment  at stats_tree.c:436

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

new_stat_node

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/stats_tree.c)expand/collapse
Show more  
 427  static stat_node*
 428  new_stat_node(stats_tree *st, const gchar *name, int parent_id,
 429                gboolean with_hash, gboolean as_parent_node)
 430  {
 431   
 432          stat_node *node = g_malloc (sizeof(stat_node));
 433          stat_node *last_chld = NULL;
 434           
 435          node->counter = 0;
 436          node->name = g_strdup(name);
 437          node->children = NULL;
 438          node->next = NULL;
 439          node->st = (stats_tree*) st;
 440          node->hash = with_hash ? g_hash_table_new(g_str_hash,g_str_equal) : NULL;
 441          node->parent = NULL;
 442          node->rng  =  NULL;
 443   
 444          if (as_parent_node) {
 445                  g_hash_table_insert(st->names,
 446                                                          node->name,
 447                                                          node);
 448                   
 449                  g_ptr_array_add(st->parents,node);
 450                   
 451                  node->id = st->parents->len - 1;
 452          } else {
 453                  node->id = -1;
 454          }
 455           
 456          if (parent_id >= 0 && parent_id < (int) st->parents->len ) {
 457                  node->parent = g_ptr_array_index(st->parents,parent_id);
 458          } else {
 459                  /* ??? should we set the parent to be root ??? */
 460                  g_assert_not_reached();
 461          }
 462           
 463          if (node->parent->children) {
 464                  /* insert as last child */
 465                   
 466                  for (last_chld = node->parent->children;
 467                           last_chld->next;
 468                           last_chld = last_chld->next ) ;
 469                   
 470                  last_chld->next = node;
 471                   
 472          } else {
 473                  /* insert as first child */
 474                  node->parent->children = node;
 475          }
 476           
 477          if(node->parent->hash) {
 478                  g_hash_table_insert(node->parent->hash,node->name,node);
 479          }
 480           
 481          if (st->cfg->setup_node_pr) {
 482                  st->cfg->setup_node_pr(node);
 483          } else {
 484                  node->pr = NULL;
 485          }
 486           
 487          return node;
 488  }
Show more  




Change Warning 2638.29458 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: