pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dict_get_vars ()


From: Jason Stover
Subject: dict_get_vars ()
Date: Sun, 12 Mar 2006 13:22:34 -0500
User-agent: Mutt/1.5.10i

Calling dict_get_vars (default_dict, &v_variables, &n_variables, DC_SYSTEM)
doesn't do what I thought it would do. The comment above the definition
of dict_get_vars() says:

/* Sets *VARS to an array of pointers to variables in D and *CNT to
   the number of variables in *D.  By default all variables are
   returned, but bits may be set in EXCLUDE_CLASSES to exclude
   ordinary, system, and/or scratch variables. */

Then this loop should count the relevant variables:

      for (i = 0; i < d->var_cnt; i++)
         if (!(exclude_classes & (1u << dict_class_from_id (d->var[i]->name))))
           count++;

...but (DC_SYSTEM & (1u << DC_ORDINARY)) is 1, so count is never
incremented for an ordinary variable. Shouldn't that statement be

          if (exclude_classes & (1u << dict_class_from_id
                                          (d->var[i]->name)))

?

-Jason




reply via email to

[Prev in Thread] Current Thread [Next in Thread]