magic-elimination.patch from patch #6230.
[pspp-builds.git] / src / language / stats / t-test.q
index d4e6245841ab4995af5cce91c4b60a78fd6c86eb..dc227c1f7fbb3bdce9c781d2e0eb636a494b38be 100644 (file)
@@ -1,21 +1,18 @@
-/* PSPP - computes sample statistics. -*-c-*-
-
+/* 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>
 
@@ -38,7 +35,6 @@
 #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>
@@ -739,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;
     }
@@ -788,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
@@ -1691,7 +1687,6 @@ group_precalc (struct cmd_t_test *cmd )
            }
 
          hsh_insert ( ttpr->group_hash, (void *) gs );
-
        }
     }
 
@@ -1791,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);
 
@@ -1853,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,
@@ -1870,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 ) ;
 
@@ -1931,3 +1931,8 @@ which_group(const struct group_statistics *g,
   return 2;
 }
 
+/*
+  Local Variables:
+  mode: c
+  End:
+*/