xalloc.h-instead-of-alloc.h.patch from patch #6230.
[pspp-builds.git] / src / language / stats / t-test.q
index 2e14632dc9b4f698b3fec8e2cf2c63331b81a5f1..fa33a4461db3d8a8a9d2b6413d4733640846e137 100644 (file)
 #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>
@@ -46,6 +44,7 @@
 #include <output/table.h>
 
 #include "size_max.h"
+#include "xalloc.h"
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -736,8 +735,8 @@ ssbox_independent_samples_populate(struct ssbox *ssb,
 
   if (gp.criterion == CMP_LE )
     {
-      strcpy(prefix[0],"");
-      strcpy(prefix[1],">=");
+      strcpy(prefix[0],">=");
+      strcpy(prefix[1],"<");
       indep_value[0] = gp.v.critical_value;
       indep_value[1] = gp.v.critical_value;
     }
@@ -785,13 +784,13 @@ ssbox_independent_samples_populate(struct ssbox *ssb,
            {
              if ( count == 0 )
                {
-                 /*  less than ( < )  case */
-                 search_val.f = gp.v.critical_value - 1.0;
+                 /* >= case  */
+                 search_val.f = gp.v.critical_value + 1.0;
                }
              else
                {
-                 /* >= case  */
-                 search_val.f = gp.v.critical_value + 1.0;
+                 /*  less than ( < )  case */
+                 search_val.f = gp.v.critical_value - 1.0;
                }
            }
          else
@@ -1688,7 +1687,6 @@ group_precalc (struct cmd_t_test *cmd )
            }
 
          hsh_insert ( ttpr->group_hash, (void *) gs );
-
        }
     }
 
@@ -1788,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);
 
@@ -1850,6 +1851,8 @@ calculate(struct cmd_t_test *cmd,
       trbox_populate(&test_results_box,cmd);
       trbox_finalize(&test_results_box);
     }
+
+  taint_destroy (taint);
 }
 
 short which_group(const struct group_statistics *g,
@@ -1867,7 +1870,7 @@ compare_group_binary(const struct group_statistics *a,
 
   if ( p->criterion == CMP_LE )
     {
-      /* less-than-or-equal comparision is not meaningfull for
+      /* less-than comparision is not meaningfull for
         alpha variables, so we shouldn't ever arrive here */
       assert(p->indep_width == 0 ) ;