#define N_(msgid) msgid
#include <libpspp/assertion.h>
+#include <libpspp/cast.h>
#include <data/val-type.h>
#include <gl/xalloc.h>
#include <data/variable.h>
double
percentile_calculate (const struct percentile *ptl, enum pc_alg alg)
{
- struct percentile *mutable = (struct percentile *) ptl;
+ struct percentile *mutable = CONST_CAST (struct percentile *, ptl);
const struct order_stats *os = &ptl->parent;
assert (os->cc == ptl->w);
static void
destroy (struct statistic *stat)
{
- struct order_stats *os = (struct order_stats *) stat;
+ struct percentile *ptl = UP_CAST (stat, struct percentile, parent.parent);
+ struct order_stats *os = &ptl->parent;
free (os->k);
- free (os);
+ free (ptl);
}