X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Fhistogram.c;h=3c88c3858f61c6b1c2230843a7b9151a47902956;hb=f1a07a055a9e1fce1024443e8bf9dcd36c0739f2;hp=c41bdc08508bc8be9e9f3d0b8b55f33fdf3cc79b;hpb=b46b794dfb9f0758aafec83f50993d1930894099;p=pspp diff --git a/src/math/histogram.c b/src/math/histogram.c index c41bdc0850..3c88c3858f 100644 --- a/src/math/histogram.c +++ b/src/math/histogram.c @@ -19,6 +19,7 @@ #include #include +#include #include #include "chart-geometry.h" @@ -37,7 +38,7 @@ histogram_add (struct histogram *h, double y, double c) static void acc (struct statistic *s, const struct ccase *cx UNUSED, double c, double cc UNUSED, double y) { - struct histogram *hist = (struct histogram *) s; + struct histogram *hist = UP_CAST (s, struct histogram, parent); gsl_histogram_accumulate (hist->gsl_hist, y, c); } @@ -46,7 +47,7 @@ acc (struct statistic *s, const struct ccase *cx UNUSED, double c, double cc UNU static void destroy (struct statistic *s) { - struct histogram *h = (struct histogram *) s; + struct histogram *h = UP_CAST (s, struct histogram, parent); gsl_histogram_free (h->gsl_hist); free (s); }