Patch #6262. New developers guide and resulting fixes and cleanups.
[pspp-builds.git] / src / language / stats / t-test.q
index a1665d53adc800b1092c23d5894e4d01112eb242..c0e90705c3e1fae05af88fcfab7244226697f246 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <gsl/gsl_cdf.h>
 #include <math.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 
 #include <language/command.h>
 #include <language/dictionary/split-file.h>
 #include <language/lexer/lexer.h>
-#include <libpspp/alloc.h>
 #include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/hash.h>
-#include <libpspp/magic.h>
 #include <libpspp/message.h>
 #include <libpspp/misc.h>
 #include <libpspp/str.h>
@@ -45,7 +44,7 @@
 #include <output/manager.h>
 #include <output/table.h>
 
-#include "size_max.h"
+#include "xalloc.h"
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -148,7 +147,7 @@ struct pair
 
 static struct pair *pairs=0;
 
-static int parse_value (struct lexer *lexer, union value * v, enum var_type);
+static int parse_value (struct lexer *lexer, union value * v, enum val_type);
 
 /* Structures and Functions for the Statistics Summary Box */
 struct ssbox;
@@ -485,9 +484,9 @@ tts_custom_pairs (struct lexer *lexer, struct dataset *ds, struct cmd_t_test *cm
        {
          free (vars);
          msg (SE, _("PAIRED was specified but the number of variables "
-                    "preceding WITH (%d) did not match the number "
-                    "following (%d)."),
-              (int) n_before_WITH, (int) n_after_WITH );
+                    "preceding WITH (%zu) did not match the number "
+                    "following (%zu)."),
+               n_before_WITH, n_after_WITH);
          return 0;
        }
       n_pairs_local = n_before_WITH;
@@ -566,9 +565,9 @@ tts_custom_pairs (struct lexer *lexer, struct dataset *ds, struct cmd_t_test *cm
 /* Parses the current token (numeric or string, depending on type)
     value v and returns success. */
 static int
-parse_value (struct lexer *lexer, union value * v, enum var_type type)
+parse_value (struct lexer *lexer, union value * v, enum val_type type)
 {
-  if (type == VAR_NUMERIC)
+  if (type == VAL_NUMERIC)
     {
       if (!lex_force_num (lexer))
        return 0;
@@ -1787,7 +1786,10 @@ calculate(struct cmd_t_test *cmd,
   enum mv_class exclude = cmd->miss != TTS_INCLUDE ? MV_ANY : MV_SYSTEM;
 
   if (!casereader_peek (input, 0, &c))
-    return;
+    {
+      casereader_destroy (input);
+      return;
+    }
   output_split_file_values (ds, &c);
   case_destroy (&c);