Replace case_ordering with subcase.
[pspp-builds.git] / src / language / stats / wilcoxon.c
index bca0b7d96a7ee95725e5fbb93b37ea9ba06964be..2f5bbea892745a99fb33fdbede97ce6baa29319c 100644 (file)
@@ -21,7 +21,7 @@
 #include <data/variable.h>
 #include <data/casereader.h>
 #include <data/casewriter.h>
-#include <data/case-ordering.h>
+#include <data/subcase.h>
 #include <math/sort.h>
 #include <libpspp/message.h>
 #include <xalloc.h>
@@ -89,7 +89,7 @@ wilcoxon_execute (const struct dataset *ds,
       struct casereader *r = casereader_clone (input);
       struct casewriter *writer;
       struct ccase c;
-      struct case_ordering *ordering = case_ordering_create ();
+      struct subcase ordering;
       variable_pair *vp = &t2s->pairs[i];
 
       const int reader_width = weight ? 3 : 2;
@@ -97,14 +97,14 @@ wilcoxon_execute (const struct dataset *ds,
       ws[i].sign = var_create_internal (0);
       ws[i].absdiff = var_create_internal (1);
 
-      case_ordering_add_var (ordering, ws[i].absdiff, SRT_ASCEND);
-
-
       r = casereader_create_filter_missing (r, *vp, 2,
                                            exclude,
                                            NULL, NULL);
 
-      writer = sort_create_writer (ordering, reader_width);
+      subcase_init_var (&ordering, ws[i].absdiff, SC_ASCEND);
+      writer = sort_create_writer (&ordering, reader_width);
+      subcase_destroy (&ordering);
+
       while (casereader_read (r, &c))
        {
          struct ccase output;
@@ -402,7 +402,6 @@ timed_wilcoxon_significance (double w, long int n, double timer)
   timeout_action.sa_mask = set;
   timeout_action.sa_flags = 0;
 
-  timeout_action.sa_restorer = 0;
   timeout_action.sa_handler = give_up_callback;
 
   if ( 0 == sigsetjmp (env, 1))