Change explicit variable name checks into use of dict_class_from_id().
[pspp] / src / sel-if.c
index 07fe318f114b578991aee80a73235f46d5fee1f7..f686a9ddf57ed9180f815a1965daa17ead0c909b 100644 (file)
@@ -33,8 +33,8 @@ struct select_if_trns
     struct expression *e;      /* Test expression. */
   };
 
-static int select_if_proc (struct trns_header *, struct ccase *);
-static void select_if_free (struct trns_header *);
+static trns_proc_func select_if_proc;
+static trns_free_func select_if_free;
 
 /* Parses the SELECT IF transformation. */
 int
@@ -68,9 +68,11 @@ cmd_select_if (void)
 
 /* Performs the SELECT IF transformation T on case C. */
 static int
-select_if_proc (struct trns_header * t, struct ccase * c)
+select_if_proc (struct trns_header * t, struct ccase * c,
+                int case_num)
 {
-  return (expr_evaluate (((struct select_if_trns *) t)->e, c, NULL) == 1.0) - 2;
+  return (expr_evaluate (((struct select_if_trns *) t)->e, c,
+                         case_num, NULL) == 1.0) - 2;
 }
 
 /* Frees SELECT IF transformation T. */
@@ -103,7 +105,7 @@ cmd_filter (void)
          return CMD_FAILURE;
        }
 
-      if (v->name[0] == '#')
+      if (dict_class_from_id (v->name) == DC_SCRATCH)
        {
          msg (SE, _("The filter variable may not be scratch."));
          return CMD_FAILURE;