Replace syntactical keywords in error/warning messages by printf directives.
[pspp] / src / language / stats / t-test-parser.c
index 7c8d8a548a5ea42b7343e5fe8b5b716c744bc37a..9e134e2a72372f79f7d57f59df04a102f402771a 100644 (file)
@@ -48,18 +48,18 @@ cmd_t_test (struct lexer *lexer, struct dataset *ds)
   const struct variable **v2 = NULL;
   size_t n_v2;
          
-  size_t n_pairs;
+  size_t n_pairs = 0;
   vp *pairs = NULL;
 
 
   /* One sample mode */
-  double testval;
+  double testval = SYSMIS;
 
   /* Independent samples mode */
   const struct variable *gvar;
   union value gval0;
   union value gval1;
-  bool cut;
+  bool cut = false;
 
   tt.wv = dict_get_weight (dict);
   tt.dict = dict;
@@ -120,8 +120,8 @@ cmd_t_test (struct lexer *lexer, struct dataset *ds)
 
          if ( cut == true && var_is_alpha (gvar))
            {
-             msg (SE, _("When applying GROUPS to a string variable, two "
-                        "values must be specified."));
+             msg (SE, _("When applying %s to a string variable, two "
+                        "values must be specified."), "GROUPS");
              goto parse_failed;
            }
        }
@@ -132,7 +132,7 @@ cmd_t_test (struct lexer *lexer, struct dataset *ds)
 
          if (tt.n_vars > 0)
            {
-             msg (SE, _("VARIABLES subcommand may not be used with PAIRS."));
+             msg (SE, _("%s subcommand may not be used with %s."), "VARIABLES", "PAIRS");
              goto parse_failed;
            }
 
@@ -178,8 +178,7 @@ cmd_t_test (struct lexer *lexer, struct dataset *ds)
            else
              n_pairs = n_v1 * n_v2;
          
-           pairs = xcalloc (sizeof *pairs, n_pairs);
-
+           pairs = xcalloc (n_pairs, sizeof *pairs);
 
            if ( with)
              {
@@ -229,7 +228,7 @@ cmd_t_test (struct lexer *lexer, struct dataset *ds)
        {
          if ( tt.mode == MODE_PAIRED)
            {
-             msg (SE, _("VARIABLES subcommand may not be used with PAIRS."));
+             msg (SE, _("%s subcommand may not be used with %s."), "VARIABLES", "PAIRS");
              goto parse_failed;
            }
 
@@ -298,7 +297,7 @@ cmd_t_test (struct lexer *lexer, struct dataset *ds)
 
   if (tt.n_vars == 0 && tt.mode != MODE_PAIRED)
     {
-      msg (SE, _("One or more VARIABLES must be specified."));
+      lex_sbc_missing ("VARIABLES");
       goto parse_failed;
     }