X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Fpercentiles.c;h=3aec0c96fdd01514676ef17a7222c959b789da0d;hb=b46b794dfb9f0758aafec83f50993d1930894099;hp=bf99de163ffbaafe2af8711685e9a640a0256784;hpb=c3ac5a8af9c449072c7e872ca70a78c1755ae309;p=pspp diff --git a/src/math/percentiles.c b/src/math/percentiles.c index bf99de163f..3aec0c96fd 100644 --- a/src/math/percentiles.c +++ b/src/math/percentiles.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008, 2009 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 @@ -160,12 +160,12 @@ destroy (struct statistic *stat) } -struct order_stats * +struct percentile * percentile_create (double p, double W) { struct percentile *ptl = xzalloc (sizeof (*ptl)); - struct order_stats *os = (struct order_stats *) ptl; - struct statistic *stat = (struct statistic *) ptl; + struct order_stats *os = &ptl->parent; + struct statistic *stat = &os->parent; assert (p >= 0); assert (p <= 1.0); @@ -186,6 +186,6 @@ percentile_create (double p, double W) stat->destroy = destroy; - return os; + return ptl; }