math: Make 'accumulate' a feature of order statistics, not all stats.
[pspp] / src / math / shapiro-wilk.c
index 30feb39d9ddfb94cb9f844ae5f78444657a54126..c2c8da6a9b363bb3b2740f5a954fc60ff83ad024 100644 (file)
@@ -26,7 +26,6 @@
 #include "libpspp/message.h"
 
 #include "gettext.h"
-#define _(msgid) gettext (msgid)
 #define N_(msgid) msgid
 
 /* Return the sum of coeff[i] * x^i for all i in the range [0,order).
@@ -119,7 +118,7 @@ shapiro_wilk_create (int n, double mean)
   if (n < 3 || n > 5000)
     return NULL;
 
-  struct shapiro_wilk *sw = xzalloc (sizeof (*sw));
+  struct shapiro_wilk *sw = XZALLOC (struct shapiro_wilk);
   struct order_stats *os = &sw->parent;
   struct statistic *stat = &os->parent;
 
@@ -155,7 +154,7 @@ shapiro_wilk_create (int n, double mean)
 
   sw->warned = false;
 
-  stat->accumulate = acc;
+  os->accumulate = acc;
   stat->destroy = destroy;
 
   return sw;