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
/
histogram.c
diff --git
a/src/math/histogram.c
b/src/math/histogram.c
index c41bdc08508bc8be9e9f3d0b8b55f33fdf3cc79b..0c641b56e127ddbdf9a180363629101fad746b6c 100644
(file)
--- a/
src/math/histogram.c
+++ b/
src/math/histogram.c
@@
-19,6
+19,7
@@
#include <gl/xalloc.h>
#include <libpspp/assertion.h>
#include <gl/xalloc.h>
#include <libpspp/assertion.h>
+#include <libpspp/cast.h>
#include <gsl/gsl_histogram.h>
#include "chart-geometry.h"
#include <gsl/gsl_histogram.h>
#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)
{
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);
}
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)
{
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);
}
gsl_histogram_free (h->gsl_hist);
free (s);
}
@@
-64,7
+65,7
@@
histogram_create (int bins, double min, double max)
int n = ceil (max / (bin_width_2) ) ;
int n = ceil (max / (bin_width_2) ) ;
- assert (max > min);
+ assert (max >
=
min);
if ( ! (n % 2 ) ) n++;
upper_limit = n * bin_width_2;
if ( ! (n % 2 ) ) n++;
upper_limit = n * bin_width_2;