Text   |  XML   |  ReML   |   Visible Warnings:

Useless Assignment  at prefs_dlg.c:320

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

module_prefs_show

(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/prefs_dlg.c)expand/collapse
Show more  
 262  module_prefs_show(module_t *module, gpointer user_data)
 263  {
 264    struct ct_struct *cts = user_data;
 265    struct ct_struct child_cts;
 266    GtkWidget        *main_vb, *main_tb, *frame, *main_sw;
 267    gchar            label_str[MAX_TREE_NODE_NAME_LEN];
 268    GtkTreeStore     *model;
 269    GtkTreeIter      iter;
 270   
 271    /*
 272     * Is this module a subtree, with modules underneath it?
 273     */
 274    if (!prefs_module_has_submodules(module)) {
 275      /*
 276       * No.
 277       * Does it have any preferences (other than possibly obsolete ones)?
 278       */
 279      if (prefs_pref_foreach(module, pref_exists, NULL) == 0) {
 280        /*
 281         * No.  Don't put the module into the preferences window.
 282         * XXX - we should do the same for subtrees; if a subtree has
 283         * nothing under it that will be displayed, don't put it into 
 284         * the window.
 285         */
 286        return 0;
 287      }
 288    }
 289   
 290    /*
 291     * Add this module to the tree.
 292     */
 293    g_strlcpy(label_str, module->title, MAX_TREE_NODE_NAME_LEN);
 294    model = GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(cts->tree)));
 295    if (prefs_module_has_submodules(module) && !cts->iter.stamp)
 296      gtk_tree_store_append(model, &iter, NULL);
 297    else 
 298      gtk_tree_store_append(model, &iter, &cts->iter);
 299   
 300    /*
 301     * Is this a subtree?
 302     */
 303    if (prefs_module_has_submodules(module)) {
 304      /*
 305       * Yes.
 306       */
 307   
 308      gtk_tree_store_set(model, &iter, 0, label_str, 1, -1, -1);
 309   
 310      /*
 311       * Walk the subtree and attach stuff to it.
 312       */
 313      child_cts = *cts;
 314      child_cts.iter = iter;
 315      if (module == protocols_module)
 316        child_cts.is_protocol = TRUE;
 317      prefs_modules_foreach_submodules(module, module_prefs_show, &child_cts);
 318   
 319      /* keep the page count right */
 320      cts->page = child_cts.page;
 321   
 322    }  
 323    if(module->prefs) {
 324      /*
 325       * Has preferences.  Create a notebook page for it.
 326       */
 327   
 328      /* Scrolled window */
 329      main_sw = gtk_scrolled_window_new(NULL, NULL);
 330      gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(main_sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
 331   
 332      /* Frame */
 333      frame = gtk_frame_new(module->description);
 334      gtk_container_set_border_width(GTK_CONTAINER(frame), 5);
 335      gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(main_sw), frame);
 336      g_object_set_data(G_OBJECT(main_sw), E_PAGESW_FRAME_KEY, frame);
 337   
 338      /* Main vertical box */
 339      main_vb = gtk_vbox_new(FALSE, 5);
 340      gtk_container_set_border_width(GTK_CONTAINER(main_vb), 5);
 341      gtk_container_add(GTK_CONTAINER(frame), main_vb);
 342   
 343      /* Main table */
 344      main_tb = gtk_table_new(module->numprefs, 2, FALSE);
 345      gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
 346      gtk_table_set_row_spacings(GTK_TABLE(main_tb), 10);
 347      gtk_table_set_col_spacings(GTK_TABLE(main_tb), 15);
 348      g_object_set_data(G_OBJECT(main_tb), E_TOOLTIPS_KEY, cts->tooltips);
 349   
 350      /* Add items for each of the preferences */
 351      prefs_pref_foreach(module, pref_show, main_tb);
 352   
 353      /* Associate this module with the page's frame. */
 354      g_object_set_data(G_OBJECT(frame), E_PAGE_MODULE_KEY, module);
 355   
 356      /* Add the page to the notebook */
 357      gtk_notebook_append_page(GTK_NOTEBOOK(cts->notebook), main_sw, NULL);
 358   
 359      /* Attach the page to the tree item */
 360      gtk_tree_store_set(model, &iter, 0, label_str, 1, cts->page, -1);
 361      g_object_set_data(G_OBJECT(frame), E_PAGE_ITER_KEY, gtk_tree_iter_copy(&iter));
 362   
 363      cts->page++;
 364   
 365      /* Show 'em what we got */
 366      gtk_widget_show_all(main_sw);
 367    } else {
 368      /* show the protocols page */
 369   
 370      gtk_tree_store_set(model, &iter, 0, label_str, 1, protocols_page, -1);  
 371   
 372    }
 373   
 374    return 0;
 375  }
Show more  




Change Warning 4206.29870 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: