Canonicalise some printed strings, to make translators' lives easier
[pspp-builds.git] / src / language / dictionary / modify-variables.c
index 0dbded8279920d6e127e7914443d07615d129e57..64204b78ec374cd0ef3477e0157b9a3883e994bf 100644 (file)
@@ -1,20 +1,18 @@
-/* PSPP - computes sample statistics.
+/* PSPP - a program for statistical analysis.
    Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA. */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
 #include <config.h>
 
 #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)
 
@@ -113,7 +111,7 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds)
 
          if (already_encountered & 1)
            {
-             msg (SE, _("REORDER subcommand may be given at most once."));
+             msg (SE, _("%s subcommand may be given at most once."), "REORDER");
              goto done;
            }
          already_encountered |= 1;
@@ -140,13 +138,13 @@ 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
                {
                  if (!lex_match (lexer, '('))
                    {
-                     msg (SE, _("`(' expected on REORDER subcommand."));
+                     msg (SE, _("`(' expected on %s subcommand."), "REORDER");
                      free (v);
                      goto done;
                    }
@@ -176,7 +174,7 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds)
        {
          if (already_encountered & 2)
            {
-             msg (SE, _("RENAME subcommand may be given at most once."));
+             msg (SE, _("%s subcommand may be given at most once."), "RENAME");
              goto done;
            }
          already_encountered |= 2;
@@ -189,7 +187,7 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds)
 
              if (!lex_match (lexer, '('))
                {
-                 msg (SE, _("`(' expected on RENAME subcommand."));
+                 msg (SE, _("`(' expected on %s subcommand."), "RENAME");
                  goto done;
                }
              if (!parse_variables (lexer, dataset_dict (ds),
@@ -208,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);
@@ -233,8 +230,8 @@ cmd_modify_vars (struct lexer *lexer, struct dataset *ds)
 
          if (already_encountered & 4)
            {
-             msg (SE, _("KEEP subcommand may be given at most once.  It may not"
-                  "be given in conjunction with the DROP subcommand."));
+             msg (SE, _("KEEP subcommand may be given at most once.  It may "
+                   "not be given in conjunction with the DROP subcommand."));
              goto done;
            }
          already_encountered |= 4;
@@ -370,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