Follow-up Comment #1, patch #5872 (project pspp):

It works and seems fine for the tests I ran. I have two concerns: In
category.c, this code: 

if (!var_has_obs_vals (v))
    {
      struct cat_vals *obs_vals = xmalloc (sizeof *obs_vals);
      obs_vals->n_categories = 0;
      obs_vals->n_allocated_categories = N_INITIAL_CATEGORIES;
      obs_vals->vals = xnmalloc (N_INITIAL_CATEGORIES, sizeof
*obs_vals->vals);
      var_set_obs_vals (v, obs_vals);
    } 

was mean to prevent a procedure from re-creating those binary vectors if they
had already been created by another procedure. By removing the 'if' statement,
and moving the call var_set_obs_vals() to regression.q, no such checking
occurs, so any procedure will end up re-creating the binary vectors, unless
that procedure checks for them itself. I put the checking in category.c so
the procedures wouldn't have to be that smart.

The second, minor concern is that cat_vector_to_value() might be necessary
later. But since it isn't necessary now, dropping it wouldn't hurt, since we
could replace easily it if necessary.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?5872>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to