projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
q2c: T_RPAREN should be T_LPAREN for matching a left parenthesis.
[pspp]
/
src
/
math
/
percentiles.c
diff --git
a/src/math/percentiles.c
b/src/math/percentiles.c
index 3aec0c96fdd01514676ef17a7222c959b789da0d..c76bb492ba767a90ffa2c03c8d35bf8a7d532ab6 100644
(file)
--- a/
src/math/percentiles.c
+++ b/
src/math/percentiles.c
@@
-24,6
+24,7
@@
#define N_(msgid) msgid
#include <libpspp/assertion.h>
#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>
#include <data/val-type.h>
#include <gl/xalloc.h>
#include <data/variable.h>
@@
-44,7
+45,7
@@
const char *const ptile_alg_desc[] = {
double
percentile_calculate (const struct percentile *ptl, enum pc_alg alg)
{
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);
const struct order_stats *os = &ptl->parent;
assert (os->cc == ptl->w);
@@
-154,9
+155,10
@@
percentile_calculate (const struct percentile *ptl, enum pc_alg alg)
static void
destroy (struct statistic *stat)
{
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->k);
- free (
os
);
+ free (
ptl
);
}
}