Patch #6262. New developers guide and resulting fixes and cleanups.
[pspp-builds.git] / src / language / dictionary / modify-variables.c
index c20285fe2c8b09c113cd0bbc9b2ec86350020b0d..cd5016910d61242c0c6afa8698a8f43553d38308 100644 (file)
 #include <language/command.h>
 #include <language/lexer/lexer.h>
 #include <language/lexer/variable-parser.h>
-#include <libpspp/alloc.h>
 #include <libpspp/assertion.h>
 #include <libpspp/array.h>
 #include <libpspp/bit-vector.h>
 #include <libpspp/compiler.h>
 #include <libpspp/hash.h>
 #include <libpspp/message.h>
-#include <libpspp/message.h>
 #include <libpspp/misc.h>
 #include <libpspp/str.h>
 
+#include "xalloc.h"
+
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
@@ -138,7 +138,7 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds)
                           "of variables."));
                      goto done;
                    }
-                 dict_get_vars_mutable (dataset_dict (ds), &v, &nv, 1u << DC_SYSTEM);
+                 dict_get_vars_mutable (dataset_dict (ds), &v, &nv, DC_SYSTEM);
                }
              else
                {
@@ -206,9 +206,8 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds)
              if (prev_nv_1 != vm.rename_cnt)
                {
                  msg (SE, _("Differing number of variables in old name list "
-                      "(%d) and in new name list (%d)."),
-                      (int) (vm.rename_cnt - prev_nv_2),
-                       (int) (prev_nv_1 - prev_nv_2));
+                             "(%zu) and in new name list (%zu)."),
+                      vm.rename_cnt - prev_nv_2, prev_nv_1 - prev_nv_2);
                  for (i = 0; i < prev_nv_1; i++)
                    free (vm.new_names[i]);
                  free (vm.new_names);
@@ -368,7 +367,7 @@ compare_variables_given_ordering (const void *a_, const void *b_,
 struct var_renaming
   {
     struct variable *var;
-    char new_name[LONG_NAME_LEN + 1];
+    char new_name[VAR_NAME_LEN + 1];
   };
 
 /* A algo_compare_func that compares new_name members in struct