Actually implement the new procedure code and adapt all of its clients
[pspp-builds.git] / src / language / dictionary / modify-variables.c
index 5322c2e31b70234391357e4f1f47def46693893d..41709416ae669e349a6fa6263322cae3bed0d2d1 100644 (file)
@@ -1,6 +1,5 @@
 /* PSPP - computes sample statistics.
    Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
-   Written by Ben Pfaff <blp@gnu.org>.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -41,7 +40,6 @@
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
-/* FIXME: should change weighting variable, etc. */
 /* These control the ordering produced by
    compare_variables_given_ordering(). */
 struct ordering
@@ -142,7 +140,7 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds)
                           "of variables."));
                      goto done;
                    }
-                 dict_get_vars (dataset_dict (ds), &v, &nv, 1u << DC_SYSTEM);
+                 dict_get_vars_mutable (dataset_dict (ds), &v, &nv, 1u << DC_SYSTEM);
                }
              else
                {
@@ -211,7 +209,8 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds)
                {
                  msg (SE, _("Differing number of variables in old name list "
                       "(%d) and in new name list (%d)."),
-                      vm.rename_cnt - prev_nv_2, prev_nv_1 - prev_nv_2);
+                      (int) (vm.rename_cnt - prev_nv_2),
+                       (int) (prev_nv_1 - prev_nv_2));
                  for (i = 0; i < prev_nv_1; i++)
                    free (vm.new_names[i]);
                  free (vm.new_names);
@@ -250,7 +249,7 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds)
          sort (keep_vars, keep_cnt, sizeof *keep_vars,
                 compare_variables_given_ordering, &forward_positional_ordering);
 
-          dict_get_vars (dataset_dict (ds), &all_vars, &all_cnt, 0);
+          dict_get_vars_mutable (dataset_dict (ds), &all_vars, &all_cnt, 0);
           assert (all_cnt >= keep_cnt);
 
           drop_cnt = all_cnt - keep_cnt;
@@ -322,7 +321,7 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds)
   if (already_encountered & (1 | 4))
     {
       /* Read the data. */
-      if (!procedure (ds,NULL, NULL)) 
+      if (!proc_execute (ds)) 
         goto done; 
     }
 
@@ -408,7 +407,7 @@ validate_var_modification (const struct dictionary *d,
   size_t i;
 
   /* All variables, in index order. */
-  dict_get_vars (d, &all_vars, &all_cnt, 0);
+  dict_get_vars_mutable (d, &all_vars, &all_cnt, 0);
 
   /* Drop variables, in index order. */
   drop_cnt = vm->drop_cnt;